Пример #1
0
 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');
 }