public function follower()
{
// 获取用户信息
$user_info = model('User')->getUserInfo($this->uid);
// 用户为空,则跳转用户不存在
if (empty($user_info)) {
$this->error(L('PUBLIC_USER_NOEXIST'));
}
// 个人空间头部
$this->_top();
// 判断隐私设置
$userPrivacy = $this->privacy($this->uid);
if ($userPrivacy['space'] !== 1) {
$key = t($_REQUEST['follow_key']);
if ($key === '') {
$follower_list = model('Follow')->getFollowerList($this->uid, 20);
} else {
$follower_list = model('Follow')->searchFollows($key, 'follower', 20, $this->uid);
$this->assign('follow_key', $key);
$this->assign('jsonKey', json_encode($key));
}
$fids = getSubByKey($follower_list['data'], 'fid');
if ($fids) {
$uids = array_merge($fids, array($this->uid));
} else {
$uids = array($this->uid);
}
// 获取用户用户组信息
$userGroupData = model('UserGroupLink')->getUserGroupData($uids);
$this->assign('userGroupData', $userGroupData);
$this->_assignFollowState($uids);
$this->_assignUserInfo($uids);
$this->_assignUserProfile($uids);
$this->_assignUserTag($uids);
$this->_assignUserCount($fids);
// 更新查看粉丝时间
if ($this->uid == $this->mid) {
$t = time() - intval($GLOBALS['ts']['_userData']['view_follower_time']);
// 避免服务器时间不一致
model('UserData')->setUid($this->mid)->updateKey('view_follower_time', $t, true);
}
$this->assign('follower_list', $follower_list);
} else {
$this->_assignUserInfo($this->uid);
}
model('UserCount')->resetUserCount($this->mid, 'new_folower_count', 0);
$this->assign('userPrivacy', $userPrivacy);
$this->setTitle(L('PUBLIC_TA_FOLLWER', array('user' => $GLOBALS['ts']['_user']['uname'])));
$this->setKeywords(L('PUBLIC_TA_FOLLWER', array('user' => $GLOBALS['ts']['_user']['uname'])));
$this->display();
}