function GetTopicByTags() { $tagName = $this->Post['name'] ? $this->Post['name'] : $this->Get['name']; $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']; if ($tagName != '') { $tagName = urldecode($tagName); $tagName = safe_str($tagName); $topic_ids = "select item_id from item_tag where tag_id in (select id from tag where name='{$tagName}')"; } else { $topic_ids = ''; } $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); $hotTags = $this->TagBiz->GetHotTags('topic', 1, $this->Config['hot_tag_pagesize']); $this->TemplateHandler->AssignValue('hottags_total', $hotTags['total']); $this->TemplateHandler->AssignValue('hottags', $hotTags['data']); $this->TemplateHandler->AssignValue('hottags_ps', $this->Config['hot_tag_pagesize']); $un = $this->UserLogic->GetUserNotifications($uid); $un->CommentsNew = 0; $this->UserLogic->UpdateUserNotification($un); $this->TemplateHandler->AssignValue('title', "#{$tagName}# 相关主题" . $this->Config['sitetitle']); $this->TemplateHandler->AssignValue('topics', $topicList); $this->TemplateHandler->AssignValue('total', $total); $this->TemplateHandler->Display('topic_main.html'); }
function Index() { $this->GotoLogin(); $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; if (!$page) { $page = 1; } else { if ($page == 0) { $page = 1; } } $pageSize = $this->Config['message_pagesize']; $pageStep = $this->Config['page_step_size_message']; //get inbox messages $results = $this->Message_Logic->GetMessageList($this->User['uid'], 'inbox', $page, $pageSize); $total = 0; $data = array(); if ($results) { $total = $results['total']; if ($total > 0) { $data = $results['data']; } } $url = "index.php?mod=message&action=index"; $pageHtml = PagerRecords('', $url, $pageSize, $page, $total, $pageStep, 0); $this->TemplateHandler->AssignValue('uid', $this->User['uid']); $this->TemplateHandler->AssignValue('messages', $data); $this->TemplateHandler->AssignValue('pageHtml', $pageHtml); $this->TemplateHandler->AssignValue('title', '信息中心 - ' . $this->Config['sitetitle']); $this->TemplateHandler->Display('message.html'); }
function Profile() { $vote_id = $this->QueryString("id"); if (!$vote_id || !is_numeric($vote_id)) { $this->Messager("输入参数不正确"); } $vote_id = intval($vote_id); $votes = $this->VoteLogic->SearchVote('', $vote_id, '', '', '', 1, 20); if (!$votes) { $this->Messager("此投票不存在"); } $total = $votes['total']; $vote = $votes['data'][0]; if ($total == 0) { $this->Messager("此投票不存在"); } $pstepsize = $this->Config['page_step_size']; $pageSize = $this->Config['event_list_pagesize']; $result = $this->TopicLogic->SearchTopics2('', '', '', '', '', '', 'vote', $vote_id, '', '', '', 'reply', '', '', '', $page, $pageSize, true, false, false); $total = $result['total']; $comments = $result['data']; $url = "index.php?mod=vote&action=profile&id={$vote_id}"; $pageHtml = PagerRecords('', $url, $pageSize, $page, $total, $pstepsize, 0); if ($vote['post_uid'] == $this->User['uid']) { $is_vote_owner = true; } $this->TemplateHandler->AssignValue('title', $vote['title'] . '-' . $this->Config['sitetitle']); $this->TemplateHandler->AssignValue('vote', $vote); $hasVoted = $this->VoteLogic->Is_Voted($vote_id, $this->User['uid']); $this->TemplateHandler->AssignValue('hasvoted', $hasVoted); $this->TemplateHandler->AssignValue('option', $vote['options']); $this->TemplateHandler->AssignValue('comments', $comments); $this->TemplateHandler->AssignValue('vote_owner', $is_vote_owner); //$this->TemplateHandler->AssignValue('bcid',$bcid); $this->TemplateHandler->AssignValue('comments', $comments); $this->TemplateHandler->AssignValue('pager', $pageHtml); $this->TemplateHandler->AssignValue('user', $this->User); //Get user's buddies who voted current vote. $uid = $this->User['uid']; //$uids="select buddyid from buddys where uid=$uid and buddyid in (select uid from vote_vote where vid=$vote_id)"; //$users=$this->VoteLogic->GetVote_VoteUsers($uids, 1, 40); //$this->TemplateHandler->AssignValue('itemusers',$users); $this->TemplateHandler->Display('vote_profile.html'); }
function Profile() { $id = $this->Post['id'] ? $this->Post['id'] : $this->Get['id']; if (!$id || $id <= 0) { $this->Messager("请输入正确的地址."); exit; } $topic = $this->TopicLogic->GetTopicById($id, true); if (!$topic || !is_array($topic)) { $this->Messager("此条微话不存在."); exit; } $item = $topic['item']; $itemId = $topic['item_id']; $this->TemplateHandler->AssignValue('item', $item); $this->TemplateHandler->AssignValue('itemId', $itemId); //get topic comments. $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; $pstepsize = $this->Config['page_step_size_topic']; $pageSize = $this->Config['topic_reply_pagesize']; $result = $this->TopicLogic->GetTopicComments($id, $pageSize, $page); $total = $result['total']; $records = $result['data']; $url = "index.php?mod=topic&action=profile&id={$id}"; $pageHtml = PagerRecords('', $url, $pageSize, $page, $total, $pstepsize, 0, "#topic_comments01"); $this->TemplateHandler->AssignValue('pageHtml', $pageHtml); $this->TemplateHandler->AssignValue('comments', $records); $this->TemplateHandler->AssignValue('commentstotal', $total); $this->TemplateHandler->AssignValue('title', '话题信息 - ' . $this->Config['sitetitle']); $this->TemplateHandler->AssignValue('topic', $topic); //get container information $container_ids = "SELECT container_id FROM topic t where (tid={$id} or roottid={$id}) and container<>'' and container_id>0"; $cons = $this->BuildingLogic->SearchBuildings("", "", "", $container_ids, "", "", "", "", "", 30, 1, false); $this->TemplateHandler->AssignValue('buildings', $cons); $this->TemplateHandler->Display('topic_profile.html'); }
function UserSearchPoints() { $this->GotoLogin(); $uid = $this->User['uid']; $this->User = $this->UserLogic->GetUser($uid); $provinces = ''; $cities = ''; $districts = ''; $streets = ''; //Gets form post data $province = ''; $city = ''; $district = ''; $street = ''; $type = ''; $name = ''; $address = ''; $province = $this->Post['user_province'] ? $this->Post['user_province'] : $this->Get['user_province']; $city = $this->Post['user_city'] ? $this->Post['user_city'] : $this->Get['user_city']; $district = $this->Post['user_district'] ? $this->Post['user_district'] : $this->Get['user_district']; $street = $this->Post['user_street'] ? $this->Post['user_street'] : $this->Get['user_street']; $type = $this->Post['point_type'] ? $this->Post['point_type'] : $this->Get['point_type']; $name = $this->Post['b_name'] ? $this->Post['b_name'] : $this->Get['b_name']; $address = $this->Post['b_address'] ? $this->Post['b_address'] : $this->Get['b_address']; if ($province == 1 || $province == 2 || $province == 9 || $province == 22) { $city = $province; } $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; if (!$page || $page == '') { $page = 1; } $pageSize = $this->Config['building_pagesize']; $provinces = $this->DistrictLogic->GetDistrictKeyValuePair('', 1, 0); if (trim($province) != trim($city) && $province != '') { $cities = $this->DistrictLogic->GetDistrictKeyValuePair('', 0, trim($province)); } if ($city != '') { $districts = $this->DistrictLogic->GetDistrictKeyValuePair('', 0, trim($city)); } if ($district != '') { $streets = $this->DistrictLogic->GetDistrictKeyValuePair('', 0, trim($district)); } $buildingdata = array('p' => $province, 'c' => $city, 'd' => $district, 's' => $street, 'name' => $name, 'address' => $address, 'type' => $type); $this->TemplateHandler->AssignValue('title', '搜索位置' . $this->Config['sitetitle']); $this->TemplateHandler->AssignValue('user', $this->User); $this->TemplateHandler->AssignValue('provinces', $this->FormHandler->Form_Options($provinces, "'" . $province . "'")); $this->TemplateHandler->AssignValue('bdata', $buildingdata); //$this->TemplateHandler->AssignValue('provinces', $this->FormHandler->Form_Options($provinces,'')); //if($cities=='') //{ //$this->TemplateHandler->AssignValue('cities', ''); //}else //{ $this->TemplateHandler->AssignValue('cities', $this->FormHandler->Form_Options($cities, "'" . $city . "'")); //} $this->TemplateHandler->AssignValue('districts', $this->FormHandler->Form_Options($districts, "'" . $district . "'")); //$this->TemplateHandler->AssignValue('districts',''); $this->TemplateHandler->AssignValue('streets', $this->FormHandler->Form_Options($streets, "'" . $street . "'")); //$this->TemplateHandler->AssignValue('streets', ''); $types = $this->BuildingLogic->GetBuildingType(); $buildingtypes = $this->FormHandler->Form_Options2($types, $type); $this->TemplateHandler->AssignValue('buildingtypes', $buildingtypes); $datalist = $this->BuildingLogic->SearchBuildings($name, '', $address, '', $province, $city, $district, $street, $type, $pageSize, $page, true); $this->TemplateHandler->AssignValue('dlist', $datalist['data']); $this->TemplateHandler->AssignValue('total', $datalist['total']); $total = $datalist['total']; $pstepsize = $this->Config['page_step_size']; $url = "./index.php?mod=point&action=search"; $formId = "building_search_form"; $pageHtml = PagerRecords($formId, $url, $pageSize, $page, $total, $pstepsize, true); $this->TemplateHandler->AssignValue('pageHtml', $pageHtml); $this->GetHotBuildings(); $this->TemplateHandler->Display('point_search.html'); }
function Profile() { $event_id = $this->Post['id'] ? $this->Post['id'] : $this->Get['id']; if (!$event_id || !is_numeric($event_id)) { $this->Messager('输入参数不正确.', $this->return); } $events = $this->EventLogic->SearchEvents('', $event_id, '', '', '', '', ''); $total = $events['total']; if ($total == 0) { $this->Messager('此活动不存在!', $this->return); } $page = $this->Post['page'] ? $this->Post['page'] : $this->Get['page']; if (!$page) { $page = 1; } $pstepsize = $this->Config['page_step_size']; $pageSize = $this->Config['event_list_pagesize']; $event = $events['data'][0]; if ($event['post_uid'] == $this->User['uid']) { $this->TemplateHandler->AssignValue('isowner', '1'); } else { $this->TemplateHandler->AssignValue('isowner', '0'); } $result = $this->TopicLogic->SearchTopics2('', '', '', '', '', '', 'event', $event_id, '', '', '', 'reply', '', '', '', $page, $pageSize, true, false, false); $total = $result['total']; $comments = $result['data']; $url = "index.php?mod=event&action=profile&id={$event_id}"; $pageHtml = PagerRecords('', $url, $pageSize, $page, $total, $pstepsize, 0); $itemusers = array(); $uid = 0; if ($this->IsLogin == 1) { $uid = $this->User['uid']; $apply_uids = "select buddyid from buddys where uid={$uid}"; $itemusers = $this->EventLogic->GetEventsApplications($event_id, $apply_uids, 1, 40); } $this->TemplateHandler->AssignValue('title', $event['title'] . '-活动' . $this->Config['sitetitle']); $this->TemplateHandler->AssignValue('event', $event); $this->TemplateHandler->AssignValue('itemusers', $itemusers); $this->TemplateHandler->AssignValue('comments', $comments); $this->TemplateHandler->AssignValue('pager', $pageHtml); $this->TemplateHandler->AssignValue('user', $this->User); $this->TemplateHandler->Display('event_profile.html'); }