public function replyAction() { $page = intval($this->getInput('page')); list($author, $fid, $createdTimeStart, $createdTimeEnd) = $this->getInput(array('author', 'fid', 'created_time_start', 'created_time_end')); $page < 1 && ($page = 1); $perpage = 20; list($start, $limit) = Pw::page2limit($page, $perpage); Wind::import('SRV:forum.vo.PwPostSo'); $so = new PwPostSo(); $so->setDisabled(1)->orderbyCreatedTime(0); $url = array(); if ($author) { $so->setAuthor($author); $url['author'] = $author; } if ($fid) { $so->setFid($fid); $url['fid'] = $fid; } if ($createdTimeStart) { $so->setCreateTimeStart(Pw::str2time($createdTimeStart)); $url['created_time_start'] = $createdTimeStart; } if ($createdTimeEnd) { $so->setCreateTimeEnd(Pw::str2time($createdTimeEnd)); $url['created_time_end'] = $createdTimeEnd; } $count = Wekit::load('forum.PwThread')->countSearchPost($so); $postdb = Wekit::load('forum.PwThread')->searchPost($so, $limit, $start); $this->setOutput($postdb, 'postdb'); $this->setOutput(Wekit::load('forum.srv.PwForumService')->getForumOption($fid), 'option_html'); $this->setOutput($page, 'page'); $this->setOutput($perpage, 'perpage'); $this->setOutput($count, 'count'); $this->setOutput($url, 'url'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $lang = Wind::getComponent('i18n'); PwSeoBo::setCustomSeo($lang->getMessage('SEO:manage.content.reply.title'), '', ''); }
public function replyAction() { $page = intval($this->getInput('page')); list($author, $fid, $createdTimeStart, $createdTimeEnd) = $this->getInput(array('author', 'fid', 'created_time_start', 'created_time_end')); $page < 1 && ($page = 1); $perpage = 20; list($start, $limit) = Pw::page2limit($page, $perpage); Wind::import('SRV:forum.vo.PwPostSo'); $so = new PwPostSo(); $so->setDisabled(1)->orderbyCreatedTime(0); $args = array(); if ($author) { $so->setAuthor($author); $args['author'] = $author; } if ($fid) { $forum = Wekit::load('forum.PwForum')->getForum($fid); if ($forum['type'] != 'category') { $so->setFid($fid); } else { $srv = Wekit::load('forum.srv.PwForumService'); $fids = array(0); $forums = $srv->getForumsByLevel($fid, $srv->getForumMap()); foreach ($forums as $value) { $fids[] = $value['fid']; } $so->setFid($fids); } } if ($createdTimeStart) { $so->setCreateTimeStart(Pw::str2time($createdTimeStart)); $args['created_time_start'] = $createdTimeStart; } if ($createdTimeEnd) { $so->setCreateTimeEnd(Pw::str2time($createdTimeEnd)); $args['created_time_end'] = $createdTimeEnd; } $count = Wekit::load('forum.PwThread')->countSearchPost($so); $postdb = Wekit::load('forum.PwThread')->searchPost($so, $limit, $start); $this->setOutput($postdb, 'postdb'); $this->setOutput(Wekit::load('forum.srv.PwForumService')->getForumList($fid), 'forumlist'); $this->setOutput(Wekit::load('forum.srv.PwForumService')->getForumOption($fid), 'option_html'); $this->setOutput($page, 'page'); $this->setOutput($perpage, 'perpage'); $this->setOutput($count, 'count'); $this->setOutput($args, 'args'); }