function Relation() { $this->ProfileCommon(); $type = $this->QueryString('type'); if (!$type || $type == '') { $type = "all"; } //没有登录无法查看共同关注,共同好友以及共同粉丝 if (($type == 'bfollow' || $type == 'bfans' || $type == 'bfriend') && $this->IsLogin != 1) { $this->GotoLogin(); return; } $page = $this->QueryString('page'); if (!$page || $page == '' || $page <= 0) { $page = 1; } $pageSize = $this->Config['user_profile_user_pagesize']; $uids = ""; switch ($type) { case "follow": $uids = "select buddyid from buddys where uid={$this->uid}"; break; case "fans": $uids = "select uid from buddys where buddyid={$this->uid}"; break; case "friend": $uids = "select buddyid from buddys where isfriend=1 and uid={$this->uid}"; break; case "bfollow": $uids = "select buddyid from buddys where uid={$this->uid} and buddyid in (select buddyid from buddys where uid={$this->loginid})"; break; case "bfans": $uids = "select uid from buddys where buddyid={$this->uid} and uid in(select uid from buddys where buddyid={$this->loginid})"; break; case "bfriend": $uids = "select buddyid from buddys where isfriend=1 and uid={$this->uid} and buddyid in (select buddyid from buddys where isfriend=1 and uid={$this->loginid})"; break; } $results = $this->UserLogic->SearchUsers($uids, '', '', '', '', '', '', false, false, false, false, $page, $pageSize, true, $this->loginid, false, '', $orderBy = 'lastlogin'); $total = $results['total']; $users = $results['data']; $url = "index.php?mod=" . $this->Module . "&action=" . $this->Code . "&id=" . $this->uid . "&type=" . $type; $pager = NewPager($url, $pageSize, $page, 5, $total); $this->TemplateHandler->AssignValue('type', $type); $this->TemplateHandler->AssignValue('upusers', $users); $this->TemplateHandler->AssignValue('pager', $pager); $this->TemplateHandler->Display("user_profile.html"); }
private function LoadTopics() { $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; $pageSize = $this->Config['topic_pagesize']; $pstepsize = $this->Config['page_step_size_topic']; if ($page == '') { $page = 1; } $createduid = "select buddyid from buddys where isfollowed=1 and uid=" . $this->User['uid']; $containers = array(); $building = array(); $building['name'] = 'building'; $building['ids'] = "select building_id from userpoints where uid=" . $this->User['uid'] . " and (isfollowed=1) order by upid desc"; $containers[] = $building; $result = $this->TopicLogic->SearchTopics2($createduid, $containers, false, '', '', '', '', '', '', '', '', '', '', '', '', $page, $pageSize); $total = $result['total']; $records = $result['data']; $url = "index.php?mod=user&action=index"; $pageHtml = NewPager($url, $pageSize, $page, 4, $total); $this->TemplateHandler->AssignValue('cpage', $page); $this->TemplateHandler->AssignValue('pageHtml', $pageHtml); $this->TemplateHandler->AssignValue('total', $total); $this->TemplateHandler->AssignValue('topics', $records); }
function GetMyComments() { $this->GotoLogin(); $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; $pageSize = $this->Config['topic_pagesize']; $pstepsize = $this->Config['page_step_size_topic']; if ($page == '') { $page = 1; } $uid = $this->User['uid']; $topic_ids = "select tid from topic where touid={$uid} and type='reply'"; $results = $this->TopicLogic->SearchTopics('', '', '', false, '', '', $topic_ids, '', '', '', '', '', '', '', '', '', $page, $pageSize, false); $total = $results['total']; $topicList = $results['data']; $url = "index.php?mod=topic&action=mycomments"; //$pageHtml=PagerRecords('', $url, $pageSize, $page, $total, $pstepsize,0); $pageHtml = NewPager($url, $pageSize, $page, 6, $total); $un = $this->UserLogic->GetUserNotifications($uid); $un->CommentsNew = 0; $this->UserLogic->UpdateUserNotification($un); $this->TemplateHandler->AssignValue('title', '我的评论 - ' . $this->Config['sitetitle']); $this->TemplateHandler->AssignValue('topics', $topicList); $this->TemplateHandler->Display('topic_main.html'); }
function UserCreatedPoint() { $this->GotoLogin(); $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; $pageSize = $this->Config['building_pagesize_user']; $pstepsize = $this->Config['page_step_size_user']; if (!$page || $page == '') { $page = 1; } $datalist = $this->BuildingLogic->SearchBuildings('', $this->User['uid'], '', '', '', '', '', '', '', $pageSize, $page, true); $this->TemplateHandler->AssignValue('dlist', $datalist['data']); $this->TemplateHandler->AssignValue('total', $datalist['total']); $total = $datalist['total']; $url = split('?', $_SERVER['REQUEST_URI']); $url = $url[0] . "index.php?mod=point&action=myc"; $formId = "building_search_form"; //$pageHtml=PagerRecords('', $url, $pageSize, $page, $total, $pstepsize,0); $pageHtml = NewPager($url, $pageSize, $page, 6, $total); $this->TemplateHandler->AssignValue('total', $total); $this->TemplateHandler->AssignValue('pageHtml', $pageHtml); $this->TemplateHandler->AssignValue('title', '我创建的位置' . $this->Config['sitetitle']); $this->GetHotBuildings(); $this->TemplateHandler->Display('point_main.html'); }
function Profile() { $bid = 0; $tid = $this->QueryString('tid'); $bfrom = $this->Post['from'] ? $this->Post['from'] : $this->Get['from']; if (!is_numeric($tid)) { $this->Messager("分享主题的ID必须是整数", "index.php?mod=user&action=index"); } $current_topic = $this->TopicLogic->GetTopicById($tid); $bid = $current_topic['item_id']; $totid = $current_topic['totid']; if ($totid && $totid > 0 && $totid != $tid) { $to_topic = $this->TopicLogic->GetTopicById($totid); } else { $to_topic = $current_topic; } $this->TemplateHandler->AssignValue('current_topic', $current_topic); $this->TemplateHandler->AssignValue('to_topic', $to_topic); //get baobei's information $baobei = $this->BaobeiLogic->GetBaobeiDetail($bid, $bfrom); $this->TemplateHandler->AssignValue('title', $baobei['title'] . '-' . $this->Config['sitetitle']); $this->TemplateHandler->AssignValue('baobei', $baobei); //get baobei's comments $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; $pageSize = $this->Config['baobei_reply_pagesize']; $pstepsize = $this->Config['page_step_size_baobei']; if ($page == '') { $page = 1; } $result = $this->TopicLogic->SearchTopics('', '', '', false, '', '', '', 'baobei', $bid, '', '', '', 'reply', '', '', '', $page, $pageSize, false); $total = $result['total']; $records = $result['data']; $this->TemplateHandler->AssignValue('comments', $records); $url = "index.php?mod=baobei&action=profile&id={$bid}&from={$bfrom}"; $pageHtml = NewPager($url, $pageSize, $page, $pstepsize, $total); //$pageHtml=PagerRecords('', $url, $pageSize, $page, $total, $pstepsize,0,"#baobei_comments"); $this->TemplateHandler->AssignValue('pageHtml', $pageHtml); //get people who likes this baobei $people_result = $this->BaobeiLogic->GetBaobeiFans($bid, 1, 28, 'baobei'); $fans = array(); if ($people_result['total'] > 0) { $fans = $people_result['data']; } $this->TemplateHandler->AssignValue('likers', $fans); //get hot baobei //$hotresult=$this->BaobeiLogic->SearchBaobeis('','','','','','','',1,9); $hotresult = $this->TopicLogic->SearchTopics('', '', '', true, '', '', '', 'baobei', '', '', '', '', 'first', '', '', '', 1, 9, false, true, false, 'forward'); $hotbaobeis = array(); if ($hotresult['total'] > 0) { $hotbaobeis = $hotresult['data']; } $this->TemplateHandler->AssignValue('hotbbs', $hotbaobeis); //display page $this->TemplateHandler->Display('baobei_profile.html'); }
function DeleteUser() { if ($this->UserPermission->DELETE_USER == 0) { $this->Messager("没有权限删除用户"); exit; } $this->TemplateHandler->AssignValue("userpermissions", $this->UserPermission); $page = $this->QueryString("page"); if (!$page || $page == '') { $page = 1; } $result = $this->UserLogic->SearchUsers($uids, '', '', '', $page, $this->Config['admin_user_pagesize']); $data = $result['data']; $total = $result['total']; $url = "index.php?mod=admin&action=deluser"; $pageHtml = NewPager($url, $pageSize, $page, 4, $total); $this->TemplateHandler->AssignValue("loginuser", $this->User['uid']); $this->TemplateHandler->AssignValue("pageHtml", $pageHtml); $this->TemplateHandler->AssignValue("users", $data); $this->TemplateHandler->Display('index.html'); }