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() { $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'); } }
function onrec_info() { if ($this->user['admin'] == 1) { include ROOT_PATH . 'lib/class/status.class.php'; include ROOT_PATH . 'lib/user/user.class.php'; include_once ROOT_PATH . 'lib/func/functions.php'; $id = getgpc('id', 'P'); $r = getgpc('r', 'P'); if ($r == 0) { //如果为再次请求cms,不要获取 ini_set("soap.wsdl_cache_enabled", "0"); $objSoapClient = new SoapClient($this->gSoapConfig['wsdl_url']); $columns = $objSoapClient->fetch_column_data($this->gSoapConfig['u'], $this->gSoapConfig['p']); //取栏目 $xml = simplexml_load_string($columns, 'SimpleXMLElement', LIBXML_NOCDATA); //print_r($xml); $arr = $xml->node; $xmlArr = array(); $str = ''; $j = 0; foreach ($arr as $key => $value) { $find[intval($value->columnid)] = $j++; if ($value->fatherid == -1) { $xmlArr[0][(string) $value->columnid] = (string) $value->columnname; } else { $pre = ''; for ($i = 0; $i < intval($value->depth); $i++) { $pre .= ' -'; } if ($pre) { $pre .= ' '; } $ffs = explode(',', (string) $value->colparents); if (count($ffs) == 2) { $ffid = $value->fatherid; } else { $combination = array((string) $value->columnid, (string) $value->fatherid); $diff = array_diff($ffs, $combination); $ffid = $diff[2]; } $xmlArr[1][(string) $ffid]['a' . (string) $value->columnid] = $pre . (string) $value->columnname; } } $return['soap'] = $xmlArr; } //获得用户信息 $user = new user(); $userInfo = $user->getUserById($id); $userInfo = $userInfo[0]; $return['username'] = $userInfo['username']; $return['id'] = $userInfo['id']; $return['avatar'] = $userInfo['middle_avatar']; $return['img'] = $userInfo['larger_avatar']; $status = new status(); //获得用户最后一条微博的信息 $blog = $status->show($userInfo['last_status_id']); $blog = $blog[0]; $return['blog'] = $blog['text']; echo json_encode($return); } else { echo "没有权限"; } }