Beispiel #1
0
 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');
     //数据写入粉丝模板
 }