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'); } }
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 = '******';\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'); }
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'); }
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'); }
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'); }
/** * 显示搜索结果 */ 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'); }
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 = '******';\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'); }
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 = '******';\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'); //数据写入粉丝模板 }
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']; $is_details = true; $user_param = array('user_id' => $user_info['id']); if ($this->input['ajax']) { $this->tpl->addVar('status_id', $status_id); $this->tpl->addVar('comments_arr', $comments_arr); $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 = $user_info['username']; hg_add_head_element("js", RESOURCE_DIR . 'scripts/dispose.js'); hg_add_head_element("js", RESOURCE_DIR . 'scripts/rotate.js'); hg_add_head_element('js-c', "\r\n\t\t\tvar re_back = 'index.php';\r\n\t\t\tvar re_back_login = "******"'login.php';\r\n\t\t"); $user_param = array('user_id' => $userid); $this->tpl->addVar('status', $status); $this->tpl->addVar('userid', $userid); $this->tpl->addVar('status_id', $status_id); $this->tpl->addVar('statusline', $statusline); $this->tpl->addVar('comments_arr', $comments_arr); $this->tpl->addVar('user_info', $user_info); $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('user_param', $user_param); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('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'); }
/** * 显示搜索结果 */ 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'); //数据写入粉丝模板 }
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'); }
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'); //数据写入粉丝模板 }
/** * 获取快捷菜单信息 */ 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'); }
/** * * 显示用户粉丝界面 */ 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'); /** * 页面中的参数定义 */ $user_param = array('user_id' => $user_info['id']); $user_param = array('is_my_page' => $is_my_page); $id = $user_info['id']; $this->tpl->addVar('user_param', $user_param); $this->tpl->addVar('user_fans', $user_fans); $this->tpl->addVar('user_friends', $user_friends); $this->tpl->addVar('user_info', $user_info); $this->tpl->addVar('id', $id); $this->tpl->addVar('concern', $concern); $this->tpl->addVar('relation', $relation); $this->tpl->addVar('followers', $followers); $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('is_my_page', $is_my_page); $this->tpl->addVar('group', $group); $this->tpl->addVar('have_followers', $have_followers); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('fans'); //数据写入粉丝模板 }
/** * 获取用户帖子信息 */ 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; } }
public function show() { if ($this->user['id'] > 0) { $user_info = $this->info->getUserById($this->user['id']); $user_info = $user_info[0]; $count = 50; $total = 'gettotal'; $page = intval($this->input['pp']) / $count; $statusline = $this->status->friends_timeline($this->user['id'], $total, $page, $count); 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); if (!$page) { $onload = 'setTimeout("get_new_status(' . $statusline[1]["id"] . ')",3000);'; hg_set_cookie('since_id', $statusline[1]["id"], time() + 31536000); } else { $onload = 'setTimeout("get_new_status(' . hg_get_cookie('since_id') . ')",3000);'; } } $topic_follow = $this->status->getTopicFollow(); /** * 添加登录积分 */ $this->info->add_credit_log(LOGIN); /** * 取出会员 */ $vipUser = $this->info->getVip(0, 8); if (is_array($vipUser)) { $vip_nums = $vipUser[count($vipUser) - 1]; $total = ceil($vip_nums / 8); unset($vipUser[count($vipUser) - 1]); } $search_friend_ids = array(); foreach ($vipUser as $k => $v) { $search_friend_ids[] = $v['id']; } $ids = implode(',', $search_friend_ids); $relation = $this->relation->get_relation($this->user['id'], $ids); $len = count($vipUser); for ($i = 0; $i < $len; $i++) { $vipUser[$i]['is_friend'] = $relation[$i]; } //print_r($vipUser); } else { $statusline = $this->status->public_timeline($page); } $topic = $this->status->getTopic(); $this->page_title = $this->lang['pageTitle']; $gScriptName = SCRIPTNAME; hg_add_foot_element("js-c", "\r\t\n" . 'window.onload=function(){' . $onload . ' if(parseInt(now_uid,10)>0){setTimeout("check_new_msg()",5000);setTimeout("getnotify()",3000);}}'); hg_add_head_element('js-c', "\r\n\t\t\tvar re_back = 'index.php';\r\n\t\t\tvar re_back_login = '******';\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/' . 'index.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'jquery.form.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('user_info', $user_info); $this->tpl->addVar('statusline', $statusline); $this->tpl->addVar('relation', $relation); $this->tpl->addVar('topic', $topic); $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('vipUser', $vipUser); $this->tpl->addVar('topic_follow', $topic_follow); $this->tpl->addVar('total', $total); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('index'); }
public function search_video() { $id = $this->user['id']; if (!$id) { $this->check_login(); } $station = $this->mVideo->get_user_station($id); $sta_id = $this->input['sta_id'] ? $this->input['sta_id'] : ($station['id'] ? $station['id'] : 0); $count = 15; $page = (intval($this->input['pp']) ? intval($this->input['pp']) : 0) / $count; $type = $this->input['type'] ? $this->input['type'] : 1; $html = '<ul class="video_title">'; $error = ""; $title = $this->input['title'] ? $this->input['title'] : ""; $video_info = $this->mVideo->video_search($title, $page, $count); if (!$video_info) { $error = '<li><img align="absmiddle" src="' . RESOURCE_DIR . 'img/error.gif" alt="" title="">关键字不为空</li>'; } if (count($video_info) == 1) { $error = '<li><img align="absmiddle" src="' . RESOURCE_DIR . 'img/error.gif" alt="" title="">关键字“<b style="color:red;">' . $title . '</b>”没有相关视频</li>'; } $html .= '<li><a href="javascript:void(0);" onclick="tab_video(1);">我的视频</a></li> <li><a href="javascript:void(0);" onclick="tab_video(2);">我的收藏</a></li> <li class="video_title_now"><a href="javascript:void(0);">搜索</a></li> <li style="width: auto; margin: 0pt; padding-top: 6px;"><input type="text" id="video_search" style="width: 110px; float: left;" value="' . $title . '"/> <input type="button" value="GO" id="bt_0" style="float: left;" onclick="search_video(this);"/></li>'; $video_info['total'] = $video_info[count($video_info) - 1]; $html .= '</ul> <ul class="video-list">' . $error; $li = ""; if ($video_info) { $data['totalpages'] = $video_info['total']; unset($video_info['total']); unset($video_info[count($video_info) - 1]); $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['pagelink'] = hg_build_link('', array('sta_id' => $sta_id)); $data['onclick'] = 'onclick="page_show(this,3);"'; $showpages = hg_build_pagelinks($data); foreach ($video_info as $key => $value) { $li .= '<li><span>·</span> <a href="javascript:void(0);" onclick="add_program(' . $value['id'] . ',' . $sta_id . ',' . $value['toff'] . ')">' . hg_cutchars($value['title'], 10, "..") . '</a><span id="v_' . $value['id'] . '" style="display:none;">' . $value['title'] . '</span><img src="' . RESOURCE_DIR . 'img/play_bt.jpg"/> </li>'; } } $html .= $li . "</ul>" . $showpages; echo $html; exit; }
/** * * 显示用户关注界面 * * */ 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; } if ($this->input['search'] || $this->input['flag'] == 1) { $screen_name = trim($this->input['screen_name']); $friends = $this->get_search_result($screen_name); if (empty($friends)) { $search_result = 1; } else { $total_nums = $friends[count($friends) - 1]; //搜索出关注用户的数据记录总数 unset($friends[count($friends) - 1]); $data['pagelink'] = hg_build_link('', array('flag' => 1, 'screen_name' => $this->input['screen_name'])); } } else { $total_nums = $user_info['attention_count']; //关注用户的数据记录总数 $friends = $this->get_friends($user_id); //获取该用户的关注对象 } if (empty($friends)) { if ($search_result == 1) { $no_result = true; } else { $have_friends = false; } } else { $data['totalpages'] = $total_nums; $data['perpage'] = 50; $data['curpage'] = $this->input['pp']; $showpages = hg_build_pagelinks($data); $friends_ids = array(); foreach ($friends as $k => $v) { $friends_ids[] = $v['id']; } $ids = implode(',', $friends_ids); if ($user_info['id'] == $this->user['id']) { $is_my_page = true; $relation = $this->get_relation_friend($this->user['id'], $ids); //获取取得用户IDS与当前用户的关系(这批用户是否关注了我) } else { $is_my_page = false; $relation = $this->get_relation($this->user['id'], $ids); //获取当前用户与取得用户的IDS的关系(当前用户是否关注了这批用户) } $len = count($friends); for ($i = 0; $i < $len; $i++) { $friends[$i]['is_mutual'] = $relation[$i]; } } $gScriptName = SCRIPTNAME; /** * 页面中的参数定义 */ $user_param = array('user_id' => $user_info['id']); $this->page_title = $this->lang['pageTitle']; $topic = $this->status->getTopic(); $topic_follow = $this->status->getTopicFollow(); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'topicfollow.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'follow.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js'); $this->tpl->addVar("user_info", $user_info); $this->tpl->addVar('is_my_page', $is_my_page); $this->tpl->addVar('screen_name', $screen_name); $this->tpl->addVar('friends', $friends); $this->tpl->addVar('no_result', $no_result); $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('relation', $relation); $this->tpl->addVar('gScriptName', $gScriptName); $this->tpl->addVar('topic', $topic); $this->tpl->addVar('user_param', $user_param); $this->tpl->addVar('topic_follow', $topic_follow); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('follow'); }
public function show_notice() { $user_info = $this->check('all'); $gScriptName = SCRIPTNAME; $n = intval($this->input['n']); $count = 50; $pp = intval($this->input['pp']) / $count; $user_id = $this->user['id']; hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js'); switch ($n) { case 0: $this->page_title = '消息'; include_once ROOT_PATH . 'lib/messages/messages.class.php'; $mMessages = new messages(); $msg_members = array(); $from_who = $mMessages->get_members($user_id, '', $pp, $count); $total = @array_shift($from_who); //分页 $data['totalpages'] = $total; $data['perpage'] = $count; $data['curpage'] = $pp; $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=0\';$(this).addClass(\'pages_current\');" '; $showpages = hg_build_pagelinks($data, 1); $this->tpl->addVar('msg_members', $msg_members); $this->tpl->addVar('mMessages', $mMessages); $this->tpl->addVar('from_who', $from_who); $this->tpl->addVar('total', $total); break; case 1: $this->page_title = '通知'; include_once ROOT_PATH . 'lib/class/notify.class.php'; $mNotify = new notify(); $un_notice = $notice = array(); $un_notice = $mNotify->notify_get_unread($user_id, -1, $pp, $count); $notice = $mNotify->notify_get_read($user_id, -1, $pp, $count); /*if(is_array($un_notice)) { $nids = $space = ""; foreach($un_notice as $key => $value) { $mNotify->notify_send_read($value['id'] , $user_id, $value['type']); } }*/ $total_count = $mNotify->notify_count($user_id, -1); if (is_array($un_notice)) { $data['totalpages'] = $total_count[0]; $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['pagelink'] = '?a=show_notice&n=1'; $showpages = hg_build_pagelinks($data); } //$a = $mNotify->notify_send_read($key,$user_id,$n['type']);//将本页未读通知插入到已读表中 $this->tpl->addVar('un_notice', $un_notice); $this->tpl->addVar('notice', $notice); break; } $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('n', $n); $this->tpl->addVar('gScriptName', $gScriptName); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->lang['pageTitle']); $this->tpl->outTemplate('user_show_n'); }
/** * 评论分页ajax * @param $pp 评论ID * @param $cid 评论对象ID * @param $user_id 评论对象的user_id * @param $type (0视频、1网台、2用户) * @param $count 每页显示条数 * @return $ret 评论信息 */ function comment_list() { $state = 1; //评论状态,0-待审核,1-已审核通过 $cid = $this->input['cid'] ? $this->input['cid'] : 0; $user_id = $this->input['user_id'] ? $this->input['user_id'] : 0; $type = $this->input['type'] ? $this->input['type'] : 0; $count = $this->input['count'] ? $this->input['count'] : 0; $page = intval($this->input['pp']) / $count; $html = ""; if ($cid && $user_id && count) { $comment_list = $this->mVideo->get_comment_list($user_id, $cid, $type, $state, $page, $count); if (is_array($comment_list)) { $total_nums = $comment_list['total']; unset($comment_list['total']); $data['totalpages'] = $total_nums; $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['onclick'] = ' onclick="comment_page(this,' . $cid . ',' . $user_id . ',' . $type . ',' . $count . ');"'; $data['pagelink'] = $this->input['user_id'] ? hg_build_link('', array('user_id' => $this->input['user_id'])) : ""; $showpages = hg_build_pagelinks($data); $html = '<ul class="comment_list" id="comment_list">'; $li = ""; foreach ($comment_list as $key => $value) { if (!$value['reply_id']) { $li .= '<li id="com_' . $value['id'] . '" class="clear"> <div class="comment-img"><a target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $value['user']['id'])) . '"><img src="' . $value['user']['middle_avatar'] . '"/></a></div> <div class="comment-bar"> <a class="bar-left" target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $value['user']['id'])) . '">' . $value['user']['username'] . '</a> <div class="bar-right"> <span>' . hg_get_date($value['create_time']) . '</span> <a href="javascript:void(0);" onclick="reply_comment(' . $value['cid'] . ',' . $value['id'] . ',' . $value['user']['id'] . ');">回复</a>'; if ($value['relation']) { $li .= '<a href="javascript:void(0);" onclick="del_comment(' . $value['id'] . ',' . $value['cid'] . ',' . $type . ');">删除</a>'; } $li .= '</div></div><div class="comment-con">' . hg_show_face($value['content']) . '</div>'; if (is_array($value['reply'])) { $li .= '<ul class="reply_list" id="rep_' . $value['id'] . '">'; $uli = ''; foreach ($value['reply'] as $k => $v) { $uli .= '<li id="com_' . $v['id'] . '" class="clear"> <div class="comment-img"><a target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $v['user']['id'])) . '"><img src="' . $v['user']['middle_avatar'] . '"/></a></div> <div class="comment-bar"> <a class="bar-left" target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $v['user']['id'])) . '">' . $v['user']['username'] . '</a> <div class="bar-right"> <span>' . hg_get_date($v['create_time']) . '</span> <a href="javascript:void(0);" onclick="reply_comment(' . $value['cid'] . ',' . $value['id'] . ',' . $value['user']['id'] . ');">回复</a>'; if ($v['relation']) { $uli .= '<a href="javascript:void(0);" onclick="del_comment(' . $v['id'] . ',' . $v['cid'] . ',' . $type . ');">删除</a>'; } $uli .= '</div></div><div class="comment-con">' . hg_show_face($value['content']) . '</div></li>'; } $li .= $uli . '</ul>'; } $li .= '</li>'; } } $html .= $li . '</ul>' . $showpages; } } ob_end_clean(); echo $html; exit; }
public function show() { //导航设置 $this->append_nav(array('name' => '权限控制', 'link' => '###')); //查找应用下面模块 $curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir']); $curl->setSubmitType('get'); $curl->initPostData(); $curl->addRequestData('a', 'get_mod_info'); //$this->input['app_un_id'] = 'liv_mms'; if ($this->input['app_un_id']) { $curl->addRequestData('app_en', $this->input['app_un_id']); } $return = $curl->request('get_app_info.php'); //file_put_contents('1.txt',var_export($return,1)); $return = $return[0]; $applications = array(); //默认模块id $DefaultMid = urldecode($return[0]['module_en']); $mod = urldecode($this->input['_type']); if (is_array($return) && count($return) > 0) { foreach ($return as $key => $val) { foreach ($val as $k => $v) { if ($k == 'module_en') { $module[$v] = $val['module_name']; if ($mod == $v) { $this->append_nav(array('name' => $val['module_name'], 'link' => '?_type=' . $v)); } } if ($k == 'app_en') { $applications[] = $val['app_name']; } } } } $server_cluster = $module; $show_server_node = array(); if ($server_cluster) { foreach ($server_cluster as $k => $v) { $show_server_node[] = array('id' => $k, "name" => $v, "fid" => 0, "depth" => 0, 'input_k' => '_type', 'attr' => 'attr', 'is_last' => 1); } } $modules = array(); $kind = $this->input['kind']; if ($mod) { if (!$kind || $kind == 'group') { $template = 'privilege_admin_group'; $this->append_nav(array('name' => '用户组', 'link' => '#')); } else { if ($kind == 'user') { $template = 'privilege_admin_group'; $this->append_nav(array('name' => '用户', 'link' => '#')); } } } else { if (!$mod && $this->input['infrm']) { $template = 'privilege_admin_group'; } else { $template = 'privilege'; } } $this->tpl->addVar('_nav', $this->nav); //用户组列表 if ($kind == 'group' || !$kind) { //查询用户组信息 if ($this->user['group_type'] != 1) { $condition = ' WHERE group_type != 1'; } $sql = 'SELECT * FROM ' . DB_PREFIX . 'admin_group ' . $condition . ' ORDER BY id ASC'; $q = $this->db->query($sql); $admin_group = array(); while ($row = $this->db->fetch_array($q)) { $row['create_time'] = hg_get_date($row['create_time']); $row['group_type'] = $this->settings['group_types'][$row['group_type']]; $admin_group[$row['id']] = $row; } $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'name' => array('title' => '用户组名称', 'exper' => '$v[name]'), 'brief' => array('title' => '描述', 'exper' => '$v[brief]'), 'group_type' => array('title' => '组类型', 'exper' => '$v[group_type]'), 'create_time' => array('title' => '创建时间', 'exper' => '$v[create_time]')); $op = array('authorize' => array('name' => '功能授权', 'brief' => '权限管理', 'link' => '?a=sys_authorize&mod=' . $mod), 'authorize_node' => array('name' => '节点授权', 'brief' => '权限管理', 'link' => '?a=accredit_node&mod=' . $mod)); //print_r($this->nav);exit; $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';'; hg_add_head_element('js-c', $str); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->addVar('list_fields', $list_fields); $this->tpl->addVar('op', $op); $this->tpl->addVar('batch_op', $batch_op); $this->tpl->addVar('close_search', true); $this->tpl->addVar('primary_key', 'id'); $this->tpl->addVar('defaultmid', $DefaultMid); $this->tpl->addVar('list', $admin_group); $this->tpl->addVar('_selfurl', 'privilege.php?infrm=1'); $this->tpl->addVar('show_server_node', $show_server_node); $this->tpl->outTemplate($template); } else { $count = intval($this->input['count']); $count = $count ? $count : 20; $extralink = ''; if ($this->input['count']) { $extralink .= '&count=' . $this->input['count']; } if ($this->input['hgorder']) { $extralink .= '&hgorder=' . $this->input['hgorder']; } if ($this->input['hgupdn']) { $extralink .= '&hgupdn=' . $this->input['hgupdn']; } $condition = array(); if ($this->user['group_type'] != 1) { $condition[] = ' t2.group_type != 1'; } if ($this->input['admin_group_id']) { $condition[] = ' t1.admin_group_id = ' . $this->input['admin_group_id']; $extralink .= '&admin_group_id=' . $this->input['admin_group_id']; } if ($condition) { $conditions = ' WHERE ' . implode(',', $condition); } $page = intval($this->input['pp']); $sql = 'SELECT count(*) AS total FROM ' . DB_PREFIX . 'admin t1 left join ' . DB_PREFIX . 'admin_group t2 on t1.admin_group_id=t2.id' . $conditions; $total = $this->db->query_first($sql); $total = intval($total['total']); $data = array(); $data['totalpages'] = $total; $data['perpage'] = $count; $data['curpage'] = $page; $data['pagelink'] = '?' . $extralink; $pagelink = hg_build_pagelinks($data); $sql = 'SELECT t1.*,t2.name FROM ' . DB_PREFIX . 'admin t1 left join ' . DB_PREFIX . 'admin_group t2 on t1.admin_group_id=t2.id' . $conditions . " LIMIT {$page},{$count}"; $q = $this->db->query($sql); $admin = array(); while ($row = $this->db->fetch_array($q)) { $row['create_time'] = hg_get_date($row['create_time']); $row['cardid'] = $row['cardid'] ? '已绑定' : '未绑定'; $admin[$row['id']] = $row; } $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'user_name' => array('title' => '用户名', 'exper' => '$v[user_name]'), 'group_name' => array('title' => '用户组', 'exper' => '$v[name]'), 'cardid' => array('title' => '是否绑定密保', 'exper' => '$v[cardid]'), 'create_time' => array('title' => '创建时间', 'exper' => '$v[create_time]')); /* 'authorize' => array( 'name' =>'授权', 'brief' =>'权限管理', 'link' => '?a=sys_authorize'), */ $op = array('authorize' => array('name' => '功能授权', 'brief' => '权限管理', 'link' => '?a=sys_authorize&type=user&mod=' . $mod), 'authorize_node' => array('name' => '节点授权', 'brief' => '权限管理', 'link' => '?a=accredit_node&type=user&mod=' . $mod)); $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';'; hg_add_head_element('js-c', $str); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->addVar('list_fields', $list_fields); $this->tpl->addVar('pagelink', $pagelink); $this->tpl->addVar('op', $op); $this->tpl->addVar('batch_op', $batch_op); $this->tpl->addVar('close_search', true); $this->tpl->addVar('primary_key', 'id'); $this->tpl->addVar('_selfurl', 'privilege.php'); $this->tpl->addVar('show_server_node', $show_server_node); $this->tpl->addVar('list', $admin); $this->tpl->outTemplate($template); } }
$total = intval($total['total']); $data = array(); $data['totalpages'] = $total; $data['perpage'] = $count; $data['curpage'] = $_page; $extralink = ''; foreach ($this->input as $k => $v) { if ($k != 'mid' && $k != 'hg_search') { if ($k == 'referto' && $v) { $v = urlencode($v); } $extralink .= '&' . $k . '=' . $v; } } $data['pagelink'] = '?mid=609' . $extralink; $pagelink = hg_build_pagelinks($data); $this->tpl->addVar('pagelink', $pagelink); $this->tpl->addVar('total', $total); $op = array(); $batch_op = array(); $this->tpl->addVar('op', $op); $this->tpl->addVar('batch_op', $batch_op); $this->curl->setReturnFormat('json'); $this->curl->initPostData(); $this->curl->addRequestData('trigger_action', 'show'); $this->curl->addRequestData('trigger_mod_uniqueid', 'program_library'); $this->curl->addRequestData('offset', $page); $this->curl->addRequestData('count', $count); if (isset($this->input["_colid"])) { if ($conids) { $this->curl->addRequestData('id', implode(",", $conids["conid"]));
public function show() { $sta_id = intval(trim($this->input['sta_id'])); $n_user_id = intval(trim($this->user['id'])); $n_station = $this->mVideo->get_user_station($n_user_id); $n_sta_id = intval(trim($n_station['id'])); $station = $this->mVideo->get_station($sta_id); $station = $station[0]; $user_id = intval(trim($station['user_id'])); $username = $station['user']['username']; $vip_url = $station['user']['vip_url'] ? $station['user']['vip_url'] : ''; if ($sta_id && $user_id) { $program = $this->mVideo->get_station_programe($sta_id, $user_id); // hg_pre($program); $info_id = array(); $info = array(); $js = 'var gProgramIds = new Array(); var gIndexs = new Array(); var gVideoIds = new Array(); var gTitles = new Array(); var gMedias = new Array(); var gSchematic = new Array(); var gToffs = new Array(); var gBriefs = new Array(); var gRelations = new Array(); var user_id = ' . $this->user['id'] . '; var sta_id = ' . $n_sta_id . '; var gLastProgram = 0; '; if ($program && is_array($program)) { $skey = 0; foreach ($program as $key => $value) { if (!$key) { $js .= "var gFirstProgram = " . $value['id'] . ";"; } $js .= 'gIndexs[' . $value['id'] . '] = ' . $key . ';'; $js .= 'gProgramIds[' . $key . '] = ' . $value['id'] . ';'; $js .= "gVideoIds[{$value['id']}] = '{$value['video']['id']}';"; $js .= "gTitles[{$value['id']}] = \"" . addslashes($value['video']['title']) . "\";"; $js .= "gMedias[{$value['id']}] = '{$value['video']['streaming_media']}';"; $js .= "gSchematic[{$value['id']}] = '{$value['video']['schematic']}';"; $js .= "gToffs[{$value['id']}] = '{$value['video']['toff']}';"; //$js .= "gBriefs[{$value['id']}] = '{$value['video']['brief']}';"; $js .= "gRelations[{$value['id']}] = '{$value['video']['relation']}';"; $skey = $key; } $js .= "gLastProgram = " . $skey . ";"; } /*include_once(ROOT_PATH . 'lib/class/groups.class.php'); $this->group = new Group(); $group = $this->group->get_my_groups($user_id);*/ if ($this->user['id'] == $user_id) { $is_my_page = 1; } else { $is_my_page = 0; } $this->mVideo->update_click_count($sta_id); if (!$is_my_page && $this->user['id']) { $this->mVideo->create_visit_history($user_id, $sta_id, 2); } $visit = $this->mVideo->get_visit_history($sta_id, $type = 2, $page = 0, $count = 10); $type = 1; $state = 1; //评论状态,0-待审核,1-已审核通过 $cid = $sta_id; $user_id = $user_id; $count = 10; $page = intval($this->input['pp']) / $count; $comment_list = $this->mVideo->get_comment_list($user_id, $cid, $type, $state, $page, $count); if (is_array($comment_list)) { $total_nums = $comment_list['total']; unset($comment_list['total']); $data['totalpages'] = $total_nums; $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['onclick'] = ' onclick="comment_page(this,' . $cid . ',' . $user_id . ',' . $type . ',' . $count . ');"'; $data['pagelink'] = hg_build_link('', array('user_id' => $this->input['user_id'], 'sta_id' => $this->input['sta_id'])); $showpages = hg_build_pagelinks($data); } $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; include_once ROOT_PATH . 'lib/class/shorturl.class.php'; $shorturl = new shorturl($url); $url = $shorturl->shorturl($url); $url = urldecode($url); $this->page_title = $station['web_station_name'] . '视频_原创视频'; $this->keywords = $station['web_station_name']; $this->description = $station['web_station_name']; hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'comment.js'); // hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'tvieplayer_new.js'); // hg_add_head_element('js', 'http://liveapi.hcrt.cn/flash-player_r9510/swfobject.js'); // hg_add_head_element('js', 'http://liveapi.hcrt.cn/flash-player_r9510/tvieplayer.js'); hg_add_head_element('js', 'http://video.hcrt.cn/flash-player/swfobject.js'); hg_add_head_element('js', 'http://video.hcrt.cn/flash-player/tvieplayer.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'share.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'station.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js'); hg_add_head_element('css', RESOURCE_DIR . 'css/' . 'color_open.css', 'id="lamp" '); hg_add_head_element('js-c', "{$js}"); hg_add_head_element('js-c', 'var video_address="";video_title="";'); /*start---视频广告*/ if (defined('ADVERT_XML')) { $xml = simplexml_load_file(ADVERT_XML, null, LIBXML_NOCDATA); $prePlayAd = $xml->item->prePlayAd; $prePlayAd_url = $xml->item->prePlayAd_url; $onPauseAd = $xml->item->onPauseAd; $onPauseAd_url = $xml->item->onPauseAd_url; $onEndAd = $xml->item->onEndAd; $onEndAd_url = $xml->item->onEndAd_url; } /*end-----视频广告*/ hg_add_head_element('js-c', ' REQUEST_URI = "' . $_SERVER['REQUEST_URI'] . '"; REQUEST_URL = "' . $url . '"; U_REQUEST_URI = "' . urlencode($_SERVER['REQUEST_URI']) . '"; WB_AKEY = "' . WB_AKEY . '"; WEB_SITE_NAME = "' . WEB_SITE_NAME . '"; var prePlayAd = "' . $prePlayAd . '"; var prePlayAd_url = "' . $prePlayAd_url . '"; var onPauseAd = "' . $onPauseAd . '"; var onPauseAd_url = "' . $onPauseAd_url . '"; var onEndAd = "' . $onEndAd . '"; var onEndAd_url = "' . $onEndAd_url . '"; '); $_mBodyCode = ' onload="timing();"'; $gScriptName = SCRIPTNAME; $this->tpl->addVar('head_line', 0); $this->tpl->addVar('_mBodyCode', $_mBodyCode); $this->tpl->addVar('station', $station); $this->tpl->addVar('n_sta_id', $n_sta_id); $this->tpl->addVar('n_station', $n_station); $this->tpl->addVar('n_user_id', $n_user_id); $this->tpl->addVar('sta_id', $sta_id); $this->tpl->addVar('username', $username); $this->tpl->addVar('vip_url', $vip_url); $this->tpl->addVar('program', $program); $this->tpl->addVar('is_my_page', $is_my_page); $this->tpl->addVar('visit', $visit); $this->tpl->addVar('user_id', $user_id); $this->tpl->addVar('comment_list', $comment_list); $this->tpl->addVar('total_nums', $total_nums); $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('url', $url); $this->tpl->addVar('gScriptName', $gScriptName); $this->tpl->addVar('cid', $cid); $this->tpl->addVar('video_id', 0); $this->tpl->addVar('toff', 0); $this->tpl->addVar('type', $type); $this->tpl->addVar('play', 1); $this->tpl->addVar('gKeywords', $this->keywords); $this->tpl->addVar('gDescription', $this->description); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('station_play'); } else { header("Location:index.php"); } }
/** * 获得专辑中的视频 * @param $album_id * @param $page * @param $count * @return $ret 专辑信息 */ public function get_album_video() { $count = $this->count; $page = $this->page; $album_id = $this->input['album_id'] ? $this->input['album_id'] : 0; $disabled = $this->input['album_video'] ? '' : 'disabled'; $html = ''; if (!$album_id) { $html = ''; } else { $album_video = $this->mVideo->get_album_video($album_id, $page, $count); $html = '<h3> <a href="javascript:void(0);" onclick="edit_album_info(' . $album_video['id'] . ');">修改专辑信息</a> <a target="_blank" href="user_album_video.php?id=' . $album_video['id'] . '&user_id=' . $album_video['user_id'] . '">播放专辑</a> <input type="hidden" id="album_id" value="' . $album_video['id'] . '"/> <input type="hidden" id="album_name" value="' . $album_video['name'] . '"/> <input type="hidden" id="album_brief" value="' . $album_video['brief'] . '"/> <input type="hidden" id="album_sort" value="' . $album_video['sort_id'] . '"/> <input type="hidden" id="album_total" value="' . $album_video['video']['total'] . '"/> <span class="blod">专辑:<a title="' . $album_video['name'] . '" style="color: #000000; cursor: pointer; float: none; padding: 0; text-decoration: none;">' . hg_cutchars($album_video['name'], 8, " ") . '</a></span> <span style="margin-left:30px;">共' . ($album_video['video']['total'] ? $album_video['video']['total'] : 0) . '个视频</span> </h3><div class="show_info_tips show_info">'; if ($album_video) { $data['totalpages'] = $album_video['video']['total']; unset($album_video['video']['total']); $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['onclick'] = 'onclick="album_page_show(this,4);"'; $showpages = hg_build_pagelinks($data); } $html .= '<div class="video_cp clear"><input type="button" value="添加视频" onclick="add_album_video(' . $album_id . ');"/><input name="get" type="button" onclick="del_album_video();" value="删除视频" ' . $disabled . '/><input name="get" onclick="move_album_show(' . $album_id . ');" type="button" value="移动到专辑" ' . $disabled . '/> ' . $showpages . '</div> <div class="video_list" id="video_list clear"> <table width="100%" cellspacing=0 cellpadding=0> <tr><th width="100px">序号</th><th>视频名称</th><th>添加时间</th><th>会员</th><th>播放次数</th><th>管理</th></tr> '; if ($album_video['video'] && is_array($album_video['video'])) { $i = 1; foreach ($album_video['video'] as $key => $value) { $tr .= '<tr> <td width="100px"><input name="vch" type="checkbox" value="' . $value['id'] . '" onclick="check_list(this,4);"/>' . $i . '</td> <td><a target="_blank" title="' . $value['title'] . '" href="' . hg_build_link('video_play.php', array('id' => $value['id'])) . '"><img src="' . $value['schematic'] . '"/></a> <a target="_blank" title="' . $value['title'] . '" href="' . hg_build_link('video_play.php', array('id' => $value['id'])) . '">' . hg_cutchars($value['title'], 6, " ") . '</a> </td> <td>' . $value['create_time'] . '</td> <td><a target="_blank" title="' . $value['user']['username'] . '" href="' . hg_build_link('user.php', array('id' => $value['user']['id'])) . '">' . hg_cutchars($value['user']['username'], 5, " ") . '</a></td> <td>' . $value['play_count'] . '</td> <td> <a href="javascript:void(0);" onclick="edit_album_cover(' . $value['id'] . ',' . $album_video['id'] . ');">设为封面</a>|<a href="javascript:void(0);" onclick="del_album_video(' . $value['id'] . ');">移除</a> </td> </tr>'; $i++; } } $html .= $tr . '</table> </div> <div><a class="f_r" onclick="return_album();" href="javascript:void(0);">返回列表</a></div> <div class="video_cp clear"><input type="button" value="添加视频" onclick="add_album_video(' . $album_id . ');"/><input name="get" type="button" onclick="del_album_video();" value="删除视频" ' . $disabled . '/><input name="get" type="button" onclick="move_album_show(' . $album_id . ');" value="移动到专辑" ' . $disabled . '/>' . $showpages . '</div> </div>'; } echo $html; exit; }
$total = $DB->query_first('select found_rows() as total'); //此句要用在query之后 $perpage = 30; } else { $tmp = explode(',', $str); $perpage = intval(trim($tmp[1])); $qid = $DB->query($db_sql); $total = $DB->query_first('select found_rows() as total'); if ($total['total'] > $perpage) { $total['total'] = $perpage; } } $total = $total['total']; //计算分页 $page_link = array('totalpages' => $total, 'curpage' => intval($pp), 'perpage' => $perpage, 'pagelink' => '?sql=' . urlencode($_REQUEST['sql']) . '&server=' . $db_choice); $p_links = hg_build_pagelinks($page_link); $results = array(); $result_tbl = '<table>'; while (false != ($r = $DB->fetch_array($qid))) { $results = array_keys($r); $result_tbl1 .= '<tr onmouseover="javascript:this.style.background=\'#D3DFEB\';" onmouseout="this.style.background=\'#fff\';">'; foreach ($r as $k => $v) { $result_tbl1 .= '<td>' . $v . '</td>'; } $result_tbl1 .= '</tr>'; } $result_tbl_th = '<tr class="result_title">'; foreach ($results as $vv) { $result_tbl_th .= '<th>' . $vv . '</th>'; } $result_tbl_th .= '</tr>';
public function show() { $user_id = $this->user['id'] ? $this->user['id'] : 0; $type = $this->input['type'] ? $this->input['type'] : 0; $state = $this->input['state'] ? $this->input['state'] : 0; if (!$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]); } $hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2); $list = array(array('name' => '已收到的', 'url' => hg_build_link('my_comments.php')), array('name' => '已发表的', 'url' => hg_build_link('my_comments.php', array('state' => 1)))); $menu = array(array('name' => '视频评论', 'url' => hg_build_link('my_comments.php', array('state' => $state))), array('name' => '频道留言', 'url' => hg_build_link('my_comments.php', array('state' => $state, 'type' => 1)))); switch ($type) { case 0: $video = $this->mVideo->get_video_info($user_id); $cid = ""; $space = " "; if (count($video) > 1) { foreach ($video as $key => $value) { $cid .= $space . $value['id']; $space = ","; } } break; case 1: $station = $this->mVideo->get_station(0, $user_id); $cid = ""; $space = " "; if (is_array($station)) { foreach ($station as $key => $value) { $cid .= $space . $value['id']; $space = ","; } } break; case 2: $cid = $user_id; break; default: break; } $count = 8; $this->pagelink = hg_build_link('', array('type' => $type, 'state' => $state)); $page = (intval($this->input['pp']) ? intval($this->input['pp']) : 0) / $count; switch ($state) { case 0: //我收到的 $stationInfo = $this->mVideo->get_comment_list($user_id, $cid, $type, 1, $page, $count); break; case 1: //我发的 $stationInfo = $this->mVideo->get_user_comments($user_id, $type, 1, $page, $count); break; case 2: //已删除的 $stationInfo = array(); $stationInfo_1 = $this->mVideo->get_comment_list($user_id, $cid, $type, 0, $page, $count); $stationInfo_2 = $this->mVideo->get_user_comments($user_id, $type, 0, $page, $count); $total = $stationInfo_1['total'] + $stationInfo_2['total']; unset($stationInfo_1['total'], $stationInfo_2['total']); $stationInfo = array_intersect($stationInfo_1, $stationInfo_2); $stationInfo_1 = array_diff($stationInfo_1, $stationInfo); $stationInfo = array_merge($stationInfo_1, $stationInfo_2); $stationInfo['total'] = count($stationInfo); // arsort($stationInfo); break; default: break; } 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); } $album_info = $this->mVideo->get_album_info($id, $page, $count); $album_total = $album_info['total']; hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'comment.js'); $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('list', $list); $this->tpl->addVar('menu', $menu); $this->tpl->addVar('cid', $cid); $this->tpl->addVar('state', $state); $this->tpl->addVar('type', $type); $this->tpl->addVar('stationInfo', $stationInfo); $this->tpl->addVar('showpages', $showpages); $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('album_total', $album_total); $this->tpl->addVar('gScriptName', $gScriptName); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('my_comments'); }
public function show() { $user_id = $this->input['user_id'] ? $this->input['user_id'] : ($this->user['id'] ? $this->user['id'] : 0); 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; $name = $this->input['k'] ? $this->input['k'] : ''; /* if ($this->input['k']) { if(preg_match("/^[".chr(0xa1)."-".chr(0xff)."a-za-z0-9_]+$/",$this->input['k'])) { $this->input['k'] = iconv('GBK', 'UTF-8', $this->input['k']); } $name = $this->input['k']; }*/ $station_info = array(); if (!empty($name)) { $station_info = $this->mVideo->station_search($name, $page, $count); } if (!empty($station_info)) { $data['totalpages'] = $station_info[count($station_info) - 1]; unset($station_info[count($station_info) - 1]); $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['pagelink'] = hg_build_link('', array('k' => $name)); $showpages = hg_build_pagelinks($data); } // hg_pre($station_info); $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('album_info', $album_info); $this->tpl->addVar('station', $station); $this->tpl->addVar('album_total', $album_total); $this->tpl->addVar('name', $name); $this->tpl->addVar('station_info', $station_info); $this->tpl->addVar('showpages', $showpages); $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('station_search'); }
public function show_notice() { $gScriptName = SCRIPTNAME; $n = intval($this->input['n']); $pp = intval($this->input['pp']) ? intval($this->input['pp']) : 0; $count = 50; switch ($n) { case 0: $this->page_title = '消息'; include_once ROOT_PATH . 'lib/messages/messages.class.php'; $mMessages = new messages(); $msg_members = array(); $from_who = $mMessages->get_members($this->user['id'], '', $pp, $count); $total = @array_shift($from_who); //分页 $data['totalpages'] = $total; $data['perpage'] = $count; $data['curpage'] = $pp; $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=0\';$(this).addClass(\'pages_current\');" '; $showpages = hg_build_pagelinks($data); ob_start(); include hg_load_template("user_msgs"); $html = ob_get_contents(); ob_end_clean(); break; case 1: $this->page_title = '通知'; include_once ROOT_PATH . 'lib/class/notify.class.php'; $mNotify = new notify(); $notice_arr = $un_notice = $notice = array(); $notice_arr = $mNotify->notify_get($this->user['id'], -1, $pp, $count); //分页,这个通知要区分一下,已读的通知和未知的通知要分开 $notice_count = $mNotify->notify_count($this->user['id'], -1); $total_count = $notice_count[0]; $total1 = array_sum($total_count); $data['totalpages'] = $total1; $data['perpage'] = $count; $data['curpage'] = $pp; $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=1\';$(this).addClass(\'pages_current\');" '; $showpages = hg_build_pagelinks($data); if ($notice_arr) { $sp = ''; foreach ($notice_arr as $key => $n) { if ($n['is_read'] == 0) { if (in_array($n['type'], array(0, 1, 2, 3))) { $un_notice[$n['type']]['idstr'] .= $sp . $n['id']; $un_notice[$n['type']]['content'] = unserialize($n['content']); } else { $un_notice[$n['type']][$n['id']]['content'] = unserialize($n['content']); $un_notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']); } $a = $mNotify->notify_send_read($key, $this->user['id'], $n['type']); //将本页未读通知插入到已读表中 $sp = ','; } else { if ($n['type'] > 3) { $notice[$n['type']][$n['id']]['content'] = unserialize($n['content']); $notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']); } } } } ob_start(); include hg_load_template("user_notices"); $html = ob_get_contents(); ob_end_clean(); break; } hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js'); include hg_load_template("user_show_n"); }
public function show() { $count = intval($this->input['count']); $count = $count ? $count : 20; $extralink = ''; if ($this->input['count']) { $extralink .= '&count=' . $this->input['count']; } if ($this->input['hgorder']) { $extralink .= '&hgorder=' . $this->input['hgorder']; } if ($this->input['hgupdn']) { $extralink .= '&hgupdn=' . $this->input['hgupdn']; } $condition = array(); if ($this->input['type']) { $condition[] = ' type = ' . $this->input['type']; $extralink .= '&type=' . $this->input['type']; } if ($this->user['group_type'] != 1) { $condition[] = ' group_type != 1'; } if ($condition) { $conditions = ' WHERE ' . implode(',', $condition); } $page = intval($this->input['pp']); $sql = 'SELECT count(*) AS total FROM ' . DB_PREFIX . 'log' . $conditions; $total = $this->db->query_first($sql); $total = intval($total['total']); $data = array(); $data['totalpages'] = $total; $data['perpage'] = $count; $data['curpage'] = $page; $data['pagelink'] = '?' . $extralink; $pagelink = hg_build_pagelinks($data); $sql = 'SELECT * FROM ' . DB_PREFIX . 'log' . $conditions . " ORDER BY id DESC LIMIT {$page},{$count}"; $q = $this->db->query($sql); $admin = array(); while ($row = $this->db->fetch_array($q)) { $row['create_time'] = hg_get_date($row['create_time']); $admin[$row['id']] = $row; } $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'content' => array('title' => '日志', 'exper' => '$v[content]<br />$v[script_name]'), 'user_name' => array('title' => '操作人', 'exper' => '$v[user_name]'), 'ip' => array('title' => '操作IP', 'exper' => '$v[ip]'), 'create_time' => array('title' => '操作时间', 'exper' => '$v[create_time]')); /* 'authorize' => array( 'name' =>'授权', 'brief' =>'权限管理', 'link' => '?a=sys_authorize'), */ $op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_post(this, \'删除\', 1);"', 'link' => '?a=delete')); $batch_op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_batchpost(this, \'delete\', \'删除\', 1,\'\',\'\',\'ajax\');"')); $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';'; hg_add_head_element('js-c', $str); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->addVar('list_fields', $list_fields); $this->tpl->addVar('pagelink', $pagelink); $this->tpl->addVar('op', $op); $this->tpl->addVar('batch_op', $batch_op); $this->tpl->addVar('close_search', true); $this->tpl->addVar('primary_key', 'id'); $this->tpl->addVar('list', $admin); $this->tpl->outTemplate('log'); }