コード例 #1
0
ファイル: Discuss.php プロジェクト: creat2012/hustoj_official
 public function action_list()
 {
     $page = $this->get_query('page', 1);
     $filter = array('pid' => $this->get_query('pid'), 'author_id' => $this->get_query('uid'));
     $filter = Model_Base::clean_data($filter);
     $topic_list = Model_Topic::page($filter, $page, OJ::per_page);
     $total = Model_Topic::count($filter);
     $this->template_data['topic_list'] = $topic_list;
     $this->template_data['total'] = ceil($total / OJ::per_page);
     $this->template_data['title'] = __('discuss.list.discuss');
 }
コード例 #2
0
ファイル: Contest.php プロジェクト: creat2012/hustoj_official
 public function action_talk()
 {
     $cid = $this->get_query('cid');
     $contest = Model_Contest::find_by_id($cid);
     $this->check_permission($contest);
     $page = $this->get_query('page', 1);
     $filter = array('cid' => $cid);
     $filter = Model_Base::clean_data($filter);
     $topic_list = Model_Topic::page($filter, $page, OJ::per_page);
     $total = Model_Topic::count($filter);
     $this->view = 'discuss/list';
     $this->template_data['contest'] = $contest;
     $this->template_data['cid'] = $cid;
     $this->template_data['topic_list'] = $topic_list;
     $this->template_data['total'] = ceil($total / OJ::per_page);
     $this->template_data['title'] = sprintf('%s - Discuss', $contest->title);
 }