public function _initialize($userid) { parent::_initialize(); // header("Cache-control:no-cache,no-store,must-revalidate"); //header("Pragma:no-cache"); // header("Expires:0"); //C('HTTP_CACHE_CONTROL','no-cache, no-store'); //dump($_SERVER); $userid = I('uid', $_SESSION['cs_home']['user_auth']['uid'], 'int'); //判断进入个人中心的是谁,两种情况,一种没有参数,直接访问,可以访问自己的个人中心,带参数则是访问别人的个人中心 //如果访问别人的个人中心,是可以访问的,但是不能发给对方发私信,在消息哪里提示登录 if ($_SESSION['cs_home']['user_auth']['uid'] < 1) { $this->error('你还未登录,请登录后重试!', U('User/login')); } if ($userid == 0 || $_SESSION['cs_home']['user_auth']['uid'] == $userid) { $cxuid = $_SESSION['cs_home']['user_auth']['uid']; $ucenter = true; $userart = '5,2,1'; } else { $cxuid = $userid; $ucenter = false; $userart = '1'; } $cxuser = query_user(array('pos_province', 'pos_community', 'pos_city', 'pos_district', 'zan', 'fensi', 'focusnum', 'scartnum', 'tagfocusnum', 'supportnum', 'score', 'signature', 'commentnum', 'artnum', 'allartnum', 'email', 'uid', 'username', 'nickname', 'name', 'login', 'reg_time', 'space_url', 'last_login_time', 'avatar32', 'avatar64', 'avatar128', 'avatar256'), $cxuid); $hasfocususer = hasguanzhu($cxuid, $_SESSION['cs_home']['user_auth']['uid'], 0); $this->assign('hasfocususer', $hasfocususer); $map['uid'] = $cxuid; $map['status'] = 1; $map['tag'] = array('neq', 'null'); $tagarr = array_filter(M('article')->where($map)->getField('tag', true)); if ($tagarr != null) { $taglist = implode(',', $tagarr); $taglistcache = explode(',', $taglist); $taglistcache = array_unique($taglistcache); foreach ($taglistcache as $key => $vo) { $usertaglist[$key] = gettaginfobytitle($vo); } } $usertaglist = array_filter($usertaglist); $this->assign('usertaglist', $usertaglist); timetonow(); $this->assign('cxuid', $cxuid); $this->assign('ucenter', $ucenter); $this->assign('cxuser', $cxuser); $this->assign('userid', $userid); $this->assign('webdescription', '用户中心'); $this->assign('webkeyword', '用户中心'); $this->assign('webtitle', '用户中心'); }
public function getUser($uid, $row, $limit) { $mapfocus['id'] = $uid; $mapfocus['type'] = 0; $count = $this->model->where($mapfocus)->count(); if ($count > 0) { $p = I(C('VAR_PAGE')); if ($limit) { $data = $this->model->where($mapfocus)->order('rowid desc')->limit($row)->select(); } else { $data = $this->model->where($mapfocus)->order('rowid desc')->page(!empty($p) ? $p : 1, $row)->select(); } } if ($data == null) { $this->apiError("获取用户关注列表失败", null); } else { foreach ($data as $key => $vo) { $data[$key]['user'] = query_user(array('zan', 'uid', 'fensi', 'score', 'artnum', 'nickname', 'username', 'space_url', 'avatar32', 'avatar64'), $vo['rowid']); $data[$key]['hasfocususer'] = hasguanzhu($vo['rowid'], $uid, 0); $data[$key]['hufen'] = hasguanzhu($uid, $vo['rowid'], 0); } $this->apiSuccess("获取用户关注列表成功", null, array('data' => $data)); } }
public function tagart() { $id = I('id', 0); if ($id == 0) { $this->error('请选择一个标签查询!', U('Index/index'), false, true, 'Public:404'); } $hasgz = hasguanzhu($id, is_login(), 2); $this->assign('hasgz', $hasgz); $map['id'] = $id; $tag = M('tags')->where($map)->getField('title'); $taginfo = M('tags')->where($map)->find(); $taginfo['path'] = getThumbImageById($taginfo['img']); $focus['rowid'] = $id; $focus['type'] = 2; $focusnum = M('focus')->where($focus)->count(); $this->assign('focusnum', $focusnum); if ($taginfo['des'] == 0) { $taginfo['des'] = '暂无介绍'; } $this->assign('webdescription', $tag); $this->assign('webkeyword', $tag); $this->assign('webtitle', $tag); $this->assign('tag', $tag); $this->assign('taginfo', $taginfo); $this->display(); }