$ch .= '&sort_mode=' . $_REQUEST['sort_mode']; } key_get($area, '', "tiki-list_comments.php?remove=y&{$ch}"); } else { key_get($area); } } if (!isset($_REQUEST["sort_mode"])) { $sort_mode = 'commentDate_desc'; } else { $sort_mode = $_REQUEST["sort_mode"]; } $smarty->assign_by_ref('sort_mode', $sort_mode); if (isset($_REQUEST["offset"])) { $offset = $_REQUEST["offset"]; } else { $offset = 0; } $smarty->assign_by_ref('offset', $offset); if (isset($_REQUEST["find"])) { $find = strip_tags($_REQUEST["find"]); } else { $find = ''; } $smarty->assign('find', $find); $comments = $commentslib->get_all_comments($_REQUEST['types'], $offset, $maxRecords, $sort_mode, $find, 'y'); $smarty->assign_by_ref('comments', $comments['data']); $smarty->assign_by_ref('cant', $comments['cant']); ask_ticket('list_comments'); $smarty->assign('mid', 'tiki-list_comments.tpl'); $smarty->display("tiki.tpl");
$smarty->assign_by_ref('find', $find); if (!isset($_REQUEST['findfilter_approved'])) { $_REQUEST['findfilter_approved'] = ''; } if ($prefs['feature_comments_moderation'] == 'y') { $filter_values = array('approved' => $_REQUEST['findfilter_approved']); $filter_names = array('approved' => tra('Approved Status')); $filters = array('approved' => array('n' => tra('Queued'), 'y' => tra('Approved'), 'r' => tra('Rejected'))); asort($filters['approved']); } else { $filters = $filter_names = $filter_values = array(); } $objectsIds = ''; if (isset($blogId)) { $objectsIds = $bloglib->get_blog_posts_ids($blogId); if (empty($objectsIds)) { $smarty->assign('msg', tra('This blog has no posts.')); $smarty->display('error.tpl'); die; } $smarty->assign('blogId', $blogId); } $comments = $commentslib->get_all_comments($selected_types, $offset, $maxRecords, $sort_mode, $find, 'y', $_REQUEST['findfilter_approved'], false, $objectsIds); $smarty->assign_by_ref('comments', $comments['data']); $smarty->assign_by_ref('filters', $filters); $smarty->assign_by_ref('filter_names', $filter_names); $smarty->assign_by_ref('filter_values', $filter_values); $smarty->assign_by_ref('cant', $comments['cant']); ask_ticket('list_comments'); $smarty->assign('mid', 'tiki-list_comments.tpl'); $smarty->display('tiki.tpl');
/** * @param $limit * @param string $forumId * @return mixed */ function forums_ranking_most_read_topics($limit, $forumId = '') { global $commentslib; if (!$commentslib) { require_once 'lib/comments/commentslib.php'; $commentslib = new Comments(); } $result = $commentslib->get_all_comments('forum', 0, $limit, 'hits_desc', '', '', '', true, $forumId); $ret = array(); foreach ($result['data'] as $res) { $aux['name'] = $forumId ? $res['title'] : $res['parentTitle'] . ': ' . $res['title']; $aux['title'] = $res['title']; $aux['hits'] = $res['hits']; $aux['href'] = 'tiki-view_forum_thread.php?forumId=' . $res['object'] . '&comments_parentId=' . $res['threadId']; $ret[] = $aux; } $retval["data"] = $ret; $retval["title"] = tra("Forums most read topics"); $retval["y"] = tra("Reads"); $retval["type"] = "nb"; return $retval; }