예제 #1
0
 /**
  * 我的版块
  */
 public function myAction()
 {
     if (!$this->loginUser->isExists()) {
         $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('bbs/forum/my')));
     }
     $order = $this->getInput('order', 'get');
     $page = intval($this->getInput('page', 'get'));
     $threadList = new PwThreadList();
     // $this->runHook('c_thread_run', $forumDisplay);
     $threadList->setPage($page)->setPerpage(Wekit::C('bbs', 'thread.perpage'));
     Wind::import('SRV:forum.srv.threadList.PwMyForumThread');
     $dataSource = new PwMyForumThread($this->loginUser);
     if ($order == 'postdate') {
         $dataSource->setOrderBy($order);
     } else {
         $dataSource->setOrderBy('lastpost');
     }
     $threadList->execute($dataSource);
     $threaddb = $threadList->getList();
     $fids = array();
     foreach ($threaddb as $key => $value) {
         $fids[] = $value['fid'];
     }
     $forums = Wekit::load('forum.PwForum')->fetchForum($fids);
     $this->setOutput($threaddb, 'threadList');
     $this->setOutput($forums, 'forums');
     $this->setOutput($threadList->icon, 'icon');
     $this->setOutput($threadList->uploadIcon, 'uploadIcon');
     $this->setOutput($order, 'order');
     $this->setOutput($threadList->page, 'page');
     $this->setOutput($threadList->perpage, 'perpage');
     $this->setOutput($threadList->total, 'count');
     $this->setOutput($threadList->maxPage, 'totalpage');
     $this->setOutput($threadList->getUrlArgs(), 'urlargs');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:bbs.forum.my.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }