本文整理汇总了PHP中Comments::get_all_comments方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::get_all_comments方法的具体用法?PHP Comments::get_all_comments怎么用?PHP Comments::get_all_comments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Comments
的用法示例。
在下文中一共展示了Comments::get_all_comments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$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");
示例2: array
$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');
示例3: Comments
/**
* @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;
}