Example #1
0
 /**
  * Generate box output
  *
  * @param array $params Parameters
  */
 function generate_output($params)
 {
     $this->set_template($params);
     $params += array('pg' => 1, 'fields' => '');
     // defaults
     require_once VIVVO_FS_INSTALL_ROOT . 'lib/vivvo/core/Comments.class.php';
     $comments = new Comments_list(null, $params['fields']);
     $search_params = Comments_list::get_search_params(null, $params);
     if (isset($search_params['search_options']['search_article_id'])) {
         $this->_template->assign('article_id', $search_params['search_options']['search_article_id']);
     }
     $comments->search($search_params['search_options'], $search_params['search_sort_by'], $search_params['search_order'], $search_params['search_limit'], $search_params['offset']);
     if (!empty($comments->list)) {
         $comments->set_pagination($params['pg']);
         $this->_template->assign('comment_list', $comments->list);
     }
     $sm = vivvo_lite_site::get_instance();
     if (!$sm->user && $sm->guest_group) {
         $this->_template->assign('guest_group_wait_comment_for_approval', $sm->guest_group->group_privileges['ARTICLE_COMMENT']);
     }
     $this->_template->assign('comment_list_object', $comments);
 }
Example #2
0
 function get_search_params_from_url(&$sm)
 {
     $um =& $sm->get_url_manager();
     $params = Comments_list::get_search_params($sm, $um->list);
     return $params;
 }