function get_links()
 {
     $question = new Question();
     $param = array('cnt' => TRUE);
     $this->Paging["count"] = $question->load_many($param);
     $params = array('cnt' => FALSE, 'show' => $this->Paging["show"], 'page' => $this->Paging["page"], 'sort_by' => 'changed', 'direction' => 'DESC');
     $data = $question->load_many($params);
     $links = objtoarray($data);
     $params = array('cnt' => FALSE, 'show' => 1, 'page' => 1, 'is_active' => 1, 'sort_by' => 'changed', 'direction' => 'DESC');
     $data = $question->load_many($params);
     $this->selected = @$data[0]->content_id;
     return $links;
 }
예제 #2
0
 function render()
 {
     $this->title = __('Answers the Question of the Day');
     $question = new Question();
     $params = array('cnt' => FALSE, 'show' => 1, 'page' => 1, 'is_active' => 1, 'sort_by' => 'changed', 'direction' => 'DESC');
     $data = $question->load_many($params);
     $this->links = objtoarray($data);
     $this->inner_HTML = $this->generate_inner_html();
     $network_stats = parent::render();
     return $network_stats;
 }
 function render()
 {
     $this->title = __("Question of the Day");
     $question = new Question();
     //-- fix by Z.Hron - show Question module only if $questions_total > 0
     $chk_cnt_params = array('cnt' => TRUE, 'is_active' => 1, 'show' => 1);
     $questions_total = $question->load_many($chk_cnt_params);
     if ($questions_total > 0) {
         //--
         $params = array('cnt' => FALSE, 'show' => 1, 'page' => 1, 'is_active' => 1, 'sort_by' => 'changed', 'direction' => 'DESC');
         $data = $question->load_many($params);
         $this->links = objtoarray($data);
         $this->inner_HTML = $this->generate_inner_html();
         $network_stats = parent::render();
         return $network_stats;
         //--
     } else {
         return null;
     }
     //--
 }
예제 #4
0
 function get_links()
 {
     $question = new Question();
     $params = array('cnt' => FALSE, 'show' => 1, 'page' => 1, 'sort_by' => 'changed', 'direction' => 'DESC');
     $data = $question->load_many($params);
     $links = objtoarray($data);
     $this->title = $links[0]['body'];
     $this->question_id = $links[0]['content_id'];
     $comment = new Comment();
     $comment->parent_id = $this->question_id;
     $comment->parent_type = TYPE_ANSWER;
     $this->Paging["count"] = $comment->get_multiples_comment($cnt = TRUE);
     $links = $comment->get_multiples_comment($cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
     return $links;
 }
 function get_links()
 {
     $question = new Question();
     $params = array('cnt' => FALSE, 'show' => 1, 'page' => 1, 'sort_by' => 'changed', 'direction' => 'DESC');
     $data = $question->load_many($params);
     $links = NULL;
     if (!empty($data)) {
         $links = objtoarray($data);
         $links = current($links);
         $this->title = $links['body'];
         $this->question_id = $links['content_id'];
         $comment = new Comment();
         $comment->parent_id = $this->question_id;
         $comment->parent_type = TYPE_ANSWER;
         $this->Paging['count'] = $comment->get_multiples_comment(TRUE);
         $links = $comment->get_multiples_comment(FALSE, $this->Paging['show'], $this->Paging['page']);
     }
     return $links;
 }