本文整理汇总了PHP中hg_build_pagelinks函数的典型用法代码示例。如果您正苦于以下问题:PHP hg_build_pagelinks函数的具体用法?PHP hg_build_pagelinks怎么用?PHP hg_build_pagelinks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hg_build_pagelinks函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show()
{
$info = new user();
$status = new status();
$userid = $this->user['id'];
$status_id = intval($this->input['id']);
//要评论的点滴id
$statusline = $status->show($status_id);
$statusline = $statusline[0];
$count = !RESULT_MAX_NUM ? 50 : intval(RESULT_MAX_NUM);
//每页返回的结果条数
$page = ceil(intval($this->input['pp']) / $count);
$comments_arr = array();
$comments_arr = $this->mComment->get_comment_list($status_id, $count, $page);
$user_info = $statusline['user'];
if ($this->input['ajax']) {
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('comments_arr', $comments_arr);
$this->tpl->addVar('status_id', $status_id);
$this->tpl->addVar('$userid', $userid);
$this->tpl->outTemplate('comment_list', 'hg_getCommentList,' . $status_id);
} else {
$pagelink = '?id=' . $this->input['id'];
$data = array('totalpages' => $comments_arr[0], 'perpage' => $count, 'curpage' => $page, 'pagelink' => $pagelink);
$showpages = hg_build_pagelinks($data);
$this->page_title = $this->lang['pageTitle'];
hg_add_head_element("js", RESOURCE_DIR . 'scripts/dispose.js');
hg_add_head_element("js", RESOURCE_DIR . 'scripts/rotate.js');
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('show');
}
}
示例2: show
public function show()
{
global $gScriptName, $gScriptNameArray;
$is_my_page = false;
$user_info = $this->check('all');
if (empty($user_info)) {
$this->ReportError('用户不存在!');
}
$user_info = $user_info[0];
//权限
$authority = $user_info['privacy'];
$this->user_info = $user_info;
if ($user_info['id'] == $this->user['id']) {
$is_my_page = true;
} else {
if ($this->user['id']) {
$relation = $this->get_relation($this->user['id'], $user_info['id']);
} else {
$is_my_page = false;
}
}
$id = $user_info['id'];
$count = 50;
$total = 'gettotal';
$page = intval($this->input['pp']) / $count;
$statusline = $this->status->user_timeline($user_info['id'], $total, $page, $count);
if (is_array($statusline)) {
$data['totalpages'] = $statusline[0]['total'];
unset($statusline[0]);
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = $this->pagelink;
$showpages = hg_build_pagelinks($data);
}
$topic = $this->status->getTopic();
$topic_follow = $this->status->getTopicFollow();
/**
* 页面中的参数定义
*/
$user_param = array('user_id' => $user_info['id']);
$this->page_title = $user_info['username'] . $this->lang['pageTitle'];
$gScriptName = SCRIPTNAME;
hg_add_head_element('js-c', "\r\n\t\t\tvar re_back = 'user.php';\r\n\t\t\tvar re_back_login = 'login.php';\r\n\t\t");
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'rotate.js');
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addVar('is_my_page', $is_my_page);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('relation', $relation);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('statusline', $statusline);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('topic', $topic);
$this->tpl->addVar('user_param', $user_param);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('user');
}
示例3: show
public function show()
{
$is_my_page = false;
$user_id = $this->user['id'];
if (empty($user_id)) {
$this->check_login();
}
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$station = $this->mVideo->get_station(0, $id);
if (is_array($station)) {
$sta_id = $station[0]['id'];
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$album_info = $this->mVideo->get_album_info($id, 0, 6);
if (is_array($album_info)) {
$album_total = $album_info['total'];
unset($album_info['total']);
}
$count = 20;
$page = intval($this->input['pp']) / $count;
$con_station = $this->mVideo->get_station_history($sta_id, $page, $count);
if (is_array($con_station)) {
$total_nums = $con_station['total'];
unset($con_station['total']);
$data['totalpages'] = $total_nums;
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
// $data['pagelink'] = $this->input['user_id']?hg_build_link('' , array('user_id' => $this->input['user_id'])):"";
$showpages = hg_build_pagelinks($data);
}
$this->settings['nav_menu'][3] = array("name" => "频道首页", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'rotate.js');
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('sta_id', $sta_id);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('album_info', $album_info);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('con_station', $con_station);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->lang['pageTitle']);
$this->tpl->outTemplate('show');
}
示例4: show
public function show()
{
$id = $this->user['id'] ? $this->user['id'] : 0;
$type = $this->input['type'] ? $this->input['type'] : 0;
if (!$id) {
$this->check_login();
}
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$this->pagelink = hg_build_link('', array('type' => $type));
$count = 9;
$page = (intval($this->input['pp']) ? intval($this->input['pp']) : 0) / $count;
$stationInfo = $this->mVideo->get_user_collect($id, $type, $page, $count);
if (is_array($stationInfo)) {
$data['totalpages'] = $stationInfo['total'];
unset($stationInfo['total']);
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = $this->pagelink;
$showpages = hg_build_pagelinks($data);
}
$list = array(array('name' => '视频收藏', 'url' => hg_build_link('my_favorites.php')));
$album_info = $this->mVideo->get_album_info($id, $page, $count);
$album_total = $album_info['total'];
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "我的收藏", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('type', $type);
$this->tpl->addVar('list', $list);
$this->tpl->addVar('stationInfo', $stationInfo);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_favorites');
}
示例5: show
public function show()
{
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
/**
* 获取用户的所有视频信息
*/
$count = 15;
$page = intval($this->input['pp']) / $count;
$video_info = $this->mVideo->get_all_video_info($page, $count);
if (is_array($video_info)) {
$total_nums = $video_info[count($video_info) - 1];
unset($video_info[count($video_info) - 1]);
$data['totalpages'] = $total_nums;
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$showpages = hg_build_pagelinks($data);
}
$album_info = $this->mVideo->get_album_info($id, $page, $count);
$album_total = $album_info['total'];
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "我的视频", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
hg_add_head_element('js-c', "\r\n\t\t\tvar PUBLISH_TO_MULTI_GROUPS = " . PUBLISH_TO_MULTI_GROUPS . ";\r\n\t\t");
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'tvieplayer_new.js');
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('video_info', $video_info);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_video');
}
示例6: show
/**
* 显示搜索结果
*/
public function show()
{
$user_info = $this->info->getUserById($this->user['id']);
$user_info = $user_info[0];
$have_result = true;
$this->input['search_name'] = trim($this->input['search_name']);
/*if(preg_match("/^[".chr(0xa1)."-".chr(0xff)."a-za-z0-9_]+$/",$this->input['search_name']))
{
$this->input['search_name'] = iconv('GBK', 'UTF-8', $this->input['search_name']);
}
*/
$screen_name = $this->input['search_name'];
$search_friend = $this->get_friend_info($screen_name);
if (empty($search_friend)) {
$have_result = false;
} else {
$total_nums = $search_friend[count($search_friend) - 1];
unset($search_friend[count($search_friend) - 1]);
$data['totalpages'] = $total_nums;
$data['perpage'] = 50;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = '?search_name=' . urlencode($this->input['search_name']);
$showpages = hg_build_pagelinks($data);
$search_friend_ids = array();
foreach ($search_friend as $k => $v) {
$search_friend_ids[] = $v['id'];
}
$ids = implode(',', $search_friend_ids);
$relation = $this->get_relation($this->user['id'], $ids);
$len = count($search_friend);
for ($i = 0; $i < $len; $i++) {
$search_friend[$i]['is_friend'] = $relation[$i];
}
}
$this->page_title = $this->lang['pageTitle'];
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'n.js');
//include hg_load_template('n'); //数据写入粉丝模板
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('have_result', $have_result);
$this->tpl->addVar('screen_name', $screen_name);
$this->tpl->addVar('search_friend', $search_friend);
$this->tpl->addVar('total_nums', $total_nums);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('relation', $relation);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('n');
}
示例7: show
public function show()
{
if ($this->user['id'] > 0) {
$id = $this->user['id'];
if ($this->input['q']) {
/*if(preg_match("/^[".chr(0xa1)."-".chr(0xff)."a-za-z0-9_]+$/",$this->input['q']))
{
$this->input['q'] = iconv('GBK', 'UTF-8', $this->input['q']);
} */
$result_count = 0;
$keywords = trim($this->input['q']);
$count = 50;
$page = intval($this->input['pp']) / $count;
$statusline = $this->status->search($keywords, $page, $count);
if (is_array($statusline)) {
$data['totalpages'] = $statusline[0]['total'];
$result_count = $statusline[0]['total'];
unset($statusline[0]);
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = '?q=' . $keywords;
$showpages = hg_build_pagelinks($data);
}
$info = $this->status->getTopicFollow($keywords);
$this->status->addKeywords($keywords, $result_count);
}
$topic = $this->status->getTopic();
$topic_follow = $this->status->getTopicFollow();
hg_add_head_element('js-c', "\r\n\t\t\t\tvar re_back = 'k.php?q=" . $this->input['q'] . "';\r\n\t\t\t\tvar re_back_login = 'login.php';\r\n\t\t\t\t");
}
$this->page_title = $this->lang['pageTitle'];
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'k.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'rotate.js');
$this->tpl->addVar('keywords', $keywords);
$this->tpl->addVar('statusline', $statusline);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('info', $info);
$this->tpl->addVar('topic', $topic);
$this->tpl->addVar('topic_follow', $topic_follow);
$this->tpl->addVar('data', $data);
$this->tpl->addVar('_input', $this->input);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('k');
}
示例8: show
public function show()
{
global $gScriptName, $gScriptNameArray;
if ($this->user['id'] > 0) {
$info = new user();
$user_info = $info->getUserById($this->user['id']);
$user_info = $user_info[0];
$favorites = new favorites();
//传递参数
$u_id = $this->input['user_id'];
$status_id = $this->input['statusid'];
$count = 50;
$total = 'gettotal';
$page = intval($this->input['pp']) / $count;
$statusline = $favorites->favorites($total, $page, $count, $u_id);
if (is_array($statusline)) {
$data['totalpages'] = $statusline[0]['total'];
unset($statusline[0]);
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$showpages = hg_build_pagelinks($data);
}
$topic_follow = $this->status->getTopicFollow();
}
$topic = $this->status->getTopic();
$this->page_title = $this->lang['pageTitle'];
$gScriptName = SCRIPTNAME;
hg_add_head_element('js-c', "\r\n\t\t\tvar re_back = 'favorites.php';\r\n\t\t\tvar re_back_login = 'login.php';\r\n\t\t");
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'favorites.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'rotate.js');
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('status_id', $status_id);
$this->tpl->addVar('statusline', $statusline);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('no_result', $no_result);
$this->tpl->addVar('have_followers', $have_followers);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('topic_follow', $topic_follow);
$this->tpl->addVar('topic', $topic);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('favorites');
//数据写入粉丝模板
}
示例9: show
public function show()
{
$user_info = array();
$user_info = $this->user;
$status = new status();
$topic = $status->getTopic();
$sendCommArr = array();
$since_id = intval($this->input['since_id']);
$max_id = intval($this->input['max_id']);
$count = RESULT_MAX_NUM;
$page = ceil(intval($this->input['pp'] / $count));
$tag = isset($this->input['t']) ? $this->input['t'] : 0;
if ($tag) {
$sendCommArr = $this->mComment->get_my_comments($since_id, $max_id, $page, $count);
$pagelink = '?t=1';
$cnt = $sendCommArr[0]['total'];
} else {
$sendCommArr = $this->mComment->get_resived_comments($since_id, $max_id, $page, $count);
$pagelink = '?';
$cnt = $sendCommArr[0];
}
if ($cnt && is_array($sendCommArr)) {
array_shift($sendCommArr);
}
$data = array('totalpages' => $cnt, 'perpage' => $count, 'curpage' => $page, 'pagelink' => $pagelink);
$showpages = hg_build_pagelinks($data);
hg_add_head_element('js', RESOURCE_DIR . 'scripts/comment.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/dialog.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/dispose.js');
$this->page_title = $tag == 0 ? $this->lang['resivedTitle'] : $this->lang['sendTitle'];
//设定title
$gScriptName = SCRIPTNAME;
$this->tpl->addVar('tag', $tag);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('sendCommArr', $sendCommArr);
$this->tpl->addVar('cnt', $cnt);
$this->tpl->addVar('topic', $topic);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_comments');
}
示例10: show
/**
* 显示搜索结果
*/
public function show()
{
$have_result = true;
$screen_name = trim($this->input['screen_name']);
$search_friend = $this->get_friend_info($screen_name);
if (empty($search_friend)) {
$have_result = false;
} else {
$total_nums = $search_friend[count($search_friend) - 1];
unset($search_friend[count($search_friend) - 1]);
$data['totalpages'] = $total_nums;
$data['perpage'] = 50;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = '?screen_name=' . trim($this->input['screen_name']);
$showpages = hg_build_pagelinks($data);
$search_friend_ids = array();
foreach ($search_friend as $k => $v) {
$search_friend_ids[] = $v['id'];
}
$ids = implode(',', $search_friend_ids);
$relation = $this->get_relation($this->user['id'], $ids);
$len = count($search_friend);
for ($i = 0; $i < $len; $i++) {
$search_friend[$i]['is_friend'] = $relation[$i];
}
}
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'search.js');
//include hg_load_template('search');
$this->tpl->addVar('have_result', $have_result);
$this->tpl->addVar('screen_name', $screen_name);
$this->tpl->addVar('search_friend', $search_friend);
$this->tpl->addVar('total_nums', $total_nums);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('search');
//数据写入粉丝模板
}
示例11: show
public function show()
{
$user_id = $this->input['user_id'] ? $this->input['user_id'] : ($this->user['id'] ? $this->user['id'] : 0);
$id = $this->input['id'] ? $this->input['id'] : 0;
/**
* 获取用户的专辑
*/
$is_my_page = false;
if (empty($user_id)) {
$this->check_login();
}
if (empty($id)) {
header("Location:" . SNS_VIDEO);
}
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('is_my_page', $is_my_page);
$count = 20;
$page = intval($this->input['pp']) / $count;
$album_video = $this->mVideo->get_album_video($id, $page, $count);
if (is_array($album_video['video'])) {
$total_nums = $album_video['video']['total'];
unset($album_video['video']['total']);
$data['totalpages'] = $total_nums;
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = $this->input['user_id'] ? hg_build_link('', array('id' => $this->input['id'], 'user_id' => $this->input['user_id'])) : "";
$showpages = hg_build_pagelinks($data);
}
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$station = $this->mVideo->get_station(0, $id);
if (is_array($station)) {
$sta_id = $station[0]['id'];
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$album_info = $this->mVideo->get_album_info($id, 0, 6);
if (is_array($album_info)) {
$album_total = $album_info['total'];
unset($album_info['total']);
}
// hg_pre($album_video);
$this->page_title = $this->lang['pageTitle'];
$gScriptName = SCRIPTNAME;
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('is_my_page', $is_my_page);
$this->tpl->addVar('album_video', $album_video);
$this->tpl->addVar('total_nums', $total_nums);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('station', $station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('sta_id', $sta_id);
$this->tpl->addVar('album_info', $album_info);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->lang['pageTitle']);
$this->tpl->outTemplate('user_album_video');
}
示例12: show
public function show()
{
$this->input['name'] = trim($this->input['name']);
$get_userinfo_func = 'getUserById';
if (!$this->input['user_id'] && !$this->input['name']) {
if (!$this->user['id']) {
$this->check_login();
} else {
$user_id = intval($this->user['id']);
}
} elseif ($this->input['user_id']) {
$user_id = intval($this->input['user_id']);
} else {
$user_id = $this->input['name'];
$get_userinfo_func = 'getUserByName';
}
$user_info = $this->{$get_userinfo_func}($user_id, 'all');
if (empty($user_info)) {
$this->ReportError('用户不存在!');
}
if ($user_info['id'] == $this->user['id']) {
$is_my_page = true;
} else {
if ($this->user['id']) {
$relation = $this->get_user_relation($this->user['id'], $user_info['id']);
} else {
$is_my_page = true;
}
}
$last_status = $this->status->show($user_info['last_status_id']);
if (is_array($last_status)) {
$last_status = $last_status[0];
}
include_once ROOT_PATH . 'lib/class/groups.class.php';
$this->group = new Group();
$group = $this->group->get_my_groups($user_info['id']);
// $group_nums = array_pop($group);
if (empty($group) || !is_array($group)) {
$have_group = false;
} else {
$total_nums = array_pop($group);
$data['totalpages'] = $total_nums;
$data['perpage'] = 50;
$data['curpage'] = $this->input['pp'];
$showpages = hg_build_pagelinks($data, 1);
$have_group = true;
}
include_once ROOT_PATH . 'lib/video/video.class.php';
$this->mVideo = new video();
$concern = $this->mVideo->get_user_station_concern($user_id);
include_once ROOT_PATH . 'lib/class/relation.class.php';
$this->relation = new Relation();
$user_fans = $this->relation->get_fans($user_id, 0, 9);
$user_friends = $this->relation->get_friends($user_id, 0, 9);
$this->page_title = $user_info['username'] . '关注的地盘';
$gScriptName = SCRIPTNAME;
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'fans.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js');
/**
* 页面中的参数定义
*/
$user_param = array('user_id' => $user_info['id']);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('id', $user_info['id']);
$this->tpl->addVar('user_friends', $user_friends);
$this->tpl->addVar('user_fans', $user_fans);
$this->tpl->addVar('group', $group);
$this->tpl->addVar('concern', $concern);
$this->tpl->addVar('relation', $relation);
$this->tpl->addVar('user_param', $user_param);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('is_my_page', $is_my_page);
$this->tpl->addVar('have_group', $have_group);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('group');
//数据写入粉丝模板
}
示例13: get_shortcut_menus
/**
* 获取快捷菜单信息
*/
public function get_shortcut_menus()
{
$page = isset($this->input['pp']) ? intval($this->input['pp']) : 0;
$count = isset($this->input['count']) ? intval($this->input['count']) : 5;
$menu_info = $this->status->get_shortcut_menus($page, $count);
$total = $this->status->get_shortcut_menus_count();
$extralink = '';
foreach ($this->input as $k => $v) {
if ($k != 'mid' && $k != 'pp' && $k != 'referto') {
$extralink .= '&' . $k . '=' . $v;
}
}
$data = array('totalpages' => intval($total['total']), 'perpage' => $count, 'curpage' => $page, 'pagelink' => '?' . $extralink);
$showpages = hg_build_pagelinks($data);
$this->tpl->addVar('menus', $menu_info);
$this->tpl->addVar('pagelink', $showpages);
$this->tpl->outTemplate('shortcut_menus');
}
示例14: show
/**
*
* 显示用户粉丝界面
*/
public function show()
{
$this->input['name'] = trim($this->input['name']);
$get_userinfo_func = 'getUserById';
if (!$this->input['user_id'] && !$this->input['name']) {
if (!$this->user['id']) {
$this->check_login();
} else {
$user_id = intval($this->user['id']);
}
} elseif ($this->input['user_id']) {
$user_id = intval($this->input['user_id']);
} else {
$user_id = $this->input['name'];
$get_userinfo_func = 'getUserByName';
}
$user_info = $this->{$get_userinfo_func}($user_id, 'all');
if (empty($user_info)) {
$this->ReportError('用户不存在!');
}
if ($user_info['id'] == $this->user['id']) {
$is_my_page = true;
} else {
if ($this->user['id']) {
$user_relation = $this->get_user_relation($this->user['id'], $user_info['id']);
} else {
$is_my_page = true;
}
}
if ($this->input['search'] || $this->input['flag'] == 1) {
$screen_name = trim($this->input['screen_name']);
$followers = $this->get_search_result($screen_name);
if (empty($followers)) {
$search_result = 1;
} else {
$total_nums = $followers[count($followers) - 1];
//搜索出关注用户的数据记录总数
unset($followers[count($followers) - 1]);
$paras = array('flag' => 1, 'screen_name' => $this->input['screen_name']);
}
} else {
$total_nums = $user_info['followers_count'];
//粉丝的数据记录总数
$followers = $this->getFans($user_info['id'], $total_nums);
//获取该用户的粉丝对象
}
$paras['user_id'] = $user_info['id'];
$data['pagelink'] = hg_build_link('', $paras);
if (empty($followers)) {
if ($search_result == 1) {
$no_result = true;
} else {
$have_followers = false;
}
} else {
$data['totalpages'] = $total_nums;
$data['perpage'] = 20;
$data['curpage'] = $this->input['pp'];
$showpages = hg_build_pagelinks($data, 1);
$have_followers = true;
$followers_ids = array();
foreach ($followers as $k => $v) {
$followers_ids[] = $v['id'];
}
$ids = implode(',', $followers_ids);
$relation = $this->get_relation($this->user['id'], $ids);
//获取当前用户与取得用户的IDS的关系
$len = count($followers);
for ($i = 0; $i < $len; $i++) {
$followers[$i]['is_mutual'] = $relation[$i];
}
}
$last_status = $this->status->show($user_info['last_status_id']);
if (is_array($last_status)) {
$last_status = $last_status[0];
}
include_once ROOT_PATH . 'lib/class/groups.class.php';
$this->group = new Group();
$group = $this->group->get_my_groups($user_info['id']);
if (is_array($group) && $group) {
$group_nums = array_pop($group);
}
include_once ROOT_PATH . 'lib/video/video.class.php';
$this->mVideo = new video();
$concern = $this->mVideo->get_user_station_concern($user_id);
include_once ROOT_PATH . 'lib/class/relation.class.php';
$this->relation = new Relation();
$user_fans = $this->relation->get_fans($user_id, 0, 9);
$user_friends = $this->relation->get_friends($user_id, 0, 9);
$this->page_title = $user_info['username'] . '的粉丝';
//$this->page_title = $this->lang['pageTitle'];
$gScriptName = SCRIPTNAME;
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'fans.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js');
/**
//.........这里部分代码省略.........
示例15: topic
/**
* 获取用户帖子信息
*/
public function topic($pp = 0)
{
$user_id = $this->input['user_id'];
include_once ROOT_PATH . 'lib/class/groups.class.php';
$this->group = new Group();
$count = 50;
$page = intval($pp) / $count;
$topic_list = $this->group->get_user_threads($user_id, $page, $count);
if (is_array($topic_list)) {
$data['totalpages'] = $topic_list['total'];
unset($topic_list['total']);
$data['perpage'] = $count;
$data['curpage'] = $pp;
$data['onclick'] = ' onclick="page_user_show(this,4,' . $user_id . ');" ';
$showpages = hg_build_pagelinks($data);
}
ob_start();
include './tpl/thread_cell.tpl.php';
$html = ob_get_contents();
ob_end_clean();
if ($pp) {
return $html;
} else {
echo $html;
}
}