user_h5.action.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | FANWE 直播系统
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2011 http://www.fanwe.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: 云淡风轻(1956838968@qq.com)
  8. // +----------------------------------------------------------------------
  9. class user_h5Module extends baseModule{
  10. public function userinfo(){
  11. $root = array();
  12. if(!$GLOBALS['user_info']){
  13. $root['error'] = "用户未登陆,请先登陆.";
  14. $root['status'] = 0;
  15. $root['user_login_status'] = 0;//有这个参数: user_login_status = 0 时,表示服务端未登陆、要求登陆,操作
  16. ajax_return($root);
  17. }else {
  18. $user_id = intval($GLOBALS['user_info']['id']);
  19. $podcast_id = intval($_REQUEST['podcast_id']);//主播id,fanwe_user.id
  20. $to_user_id = intval($_REQUEST['to_user_id']);//需要查看的用户id
  21. if ($to_user_id == 0){
  22. $to_user_id = $user_id;
  23. }
  24. $root = getuserinfo($user_id,$podcast_id,$to_user_id,$_REQUEST);
  25. $m_config = load_auto_cache("m_config");//初始化手机端配置
  26. $root['init_version'] = intval($m_config['init_version']);//手机端配置版本号
  27. $root['ticket_name'] = trim($m_config['ticket_name']);//印票名称
  28. $root['account_name'] = trim($m_config['account_name']);//印客名称
  29. if($m_config['name_limit']==1){
  30. $user = $GLOBALS['db']->getRow("select nick_name from ".DB_PREFIX."user where id = ".$user_id);
  31. $nick_name=$user['nick_name'];
  32. //进入个人中心过滤铭感词汇
  33. $limit_sql =$GLOBALS['db']->getCol("SELECT name FROM ".DB_PREFIX."limit_name");
  34. if($GLOBALS['db']->getCol("SELECT name FROM ".DB_PREFIX."limit_name WHERE '$nick_name' like concat('%',name,'%')")){
  35. $nick_name=str_replace($limit_sql,'*',$nick_name);
  36. }
  37. //判断用户名如果被过滤后为空,格式则变更为: 账号+ID
  38. if($nick_name==''){
  39. $nick_name=('账号'.$user_id);
  40. }
  41. //更新数据库
  42. $sql = "update ".DB_PREFIX."user set nick_name = '$nick_name' where id=".$user_id;
  43. $GLOBALS['db']->query($sql);
  44. //更新redis
  45. user_deal_to_reids(array($user_id));
  46. }
  47. $root['status'] = 1;
  48. api_ajax_return($root);
  49. }
  50. }
  51. }