Ejemplo n.º 1
0
 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');
 }
Ejemplo n.º 2
0
 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);
 }