当前位置: 首页>>代码示例>>PHP>>正文


PHP Comments::get_forum_topics方法代码示例

本文整理汇总了PHP中Comments::get_forum_topics方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::get_forum_topics方法的具体用法?PHP Comments::get_forum_topics怎么用?PHP Comments::get_forum_topics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comments的用法示例。


在下文中一共展示了Comments::get_forum_topics方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

if (!isset($_REQUEST['filter_type']))
	$type_param = '';
else
	$type_param = $_REQUEST['filter_type'];

if (!isset($_REQUEST['reply_state']))
	$reply_state = '';
else
	$reply_state = $_REQUEST['reply_state'];

$comments_coms = $commentslib->get_forum_topics(
				$_REQUEST['forumId'], 
				$comments_offset, 
				$_REQUEST['comments_per_page'], 
				$_REQUEST['thread_sort_mode'], 
				$view_archived_topics, 
				$user_param, 
				$type_param, 
				$reply_state, 
				$forum_info
);

$comments_cant = $commentslib->count_forum_topics(
				$_REQUEST['forumId'], 
				$comments_offset, 
				$_REQUEST['comments_per_page'], 
				$_REQUEST['thread_sort_mode'], 
				$view_archived_topics, 
				$user_param, 
				$type_param, 
				$reply_state
开发者ID:railfuture,项目名称:tiki-website,代码行数:31,代码来源:tiki-view_forum.php

示例2: array

// Display the Index Template
$pageRenderer->runSetups();
//TRANSLATING HTML
$page_content = (string) $smarty->getTemplateVars('parsed');
// convert from Tiki_Render_Lazy to string here
if (!empty($_REQUEST['machine_translate_to_lang'])) {
    $page_content = generate_machine_translated_content($page_content, $info, $_REQUEST['machine_translate_to_lang']);
    $smarty->assign('parsed', $page_content);
}
TikiLib::events()->trigger('tiki.wiki.view', array_merge(is_array($info) ? $info : array(), array('type' => 'wiki page', 'object' => $page, 'user' => $GLOBALS['user'])));
if ($prefs['feature_forums'] && $prefs['feature_wiki_discuss'] == 'y' && $prefs['wiki_discuss_visibility'] == 'above') {
    include_once 'lib/comments/commentslib.php';
    $commentslib = new Comments($dbTiki);
    $comments_data = tra('Use this thread to discuss the page:') . " [tiki-index.php?page=" . rawurlencode($page) . "|{$page}]";
    $threadId = $commentslib->check_for_topic($page, $comments_data);
    $comments_coms = $commentslib->get_forum_topics($prefs['wiki_forum_id'], 0, -1);
    $discuss_replies_cant = 0;
    foreach ($comments_coms as $topic) {
        if ($topic['threadId'] == $threadId) {
            $discuss_replies_cant = $topic['replies'];
            break;
        }
    }
    $smarty->assign('discuss_replies_cant', $discuss_replies_cant);
}
$smarty->assign('info', $info);
$smarty->assign('mid', 'tiki-show_page.tpl');
$smarty->display('tiki-show_page.tpl');
// xdebug_dump_function_profile(XDEBUG_PROFILER_CPU);
// debug: print all objects
/**
开发者ID:rjsmelo,项目名称:tiki,代码行数:31,代码来源:tiki-index.php

示例3: ceil

$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
    $find = $_REQUEST["find"];
} else {
    $find = '';
}
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$items = $commentslib->list_reported($_REQUEST['forumId'], $offset, $maxRecords, $sort_mode, $find);
$smarty->assign('cant', $items['cant']);
$cant_pages = ceil($items["cant"] / $maxRecords);
$smarty->assign_by_ref('cant_pages', $cant_pages);
$smarty->assign('actual_page', 1 + $offset / $maxRecords);
if ($items["cant"] > $offset + $maxRecords) {
    $smarty->assign('next_offset', $offset + $maxRecords);
} else {
    $smarty->assign('next_offset', -1);
}
if ($offset > 0) {
    $smarty->assign('prev_offset', $offset - $maxRecords);
} else {
    $smarty->assign('prev_offset', -1);
}
$smarty->assign_by_ref('items', $items["data"]);
$topics = $commentslib->get_forum_topics($_REQUEST['forumId']);
$smarty->assign_by_ref('topics', $topics);
ask_ticket('forum-reported');
include_once 'tiki-section_options.php';
// Display the template
$smarty->assign('mid', 'tiki-forums_reported.tpl');
$smarty->display("tiki.tpl");
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:31,代码来源:tiki-forums_reported.php

示例4: tra

    $tiki_p_forum_vote = 'y';
    $smarty->assign('tiki_p_forum_vote', 'y');
    $tiki_p_forum_post_topic = 'y';
    $smarty->assign('tiki_p_forum_post_topic', 'y');
}
if ($tiki_p_admin_forum != 'y' && $tiki_p_forum_read != 'y') {
    $smarty->assign('errortype', 401);
    $smarty->assign('msg', tra("You do not have permission to use this feature"));
    $smarty->display("error.tpl");
    die;
}
$smarty->assign('topics_next_offset', $_REQUEST['topics_offset'] + 1);
$smarty->assign('topics_prev_offset', $_REQUEST['topics_offset'] - 1);
//$end_time = microtime(true);
//print "TIME2: ".($end_time - $start_time)."\n";
$threads = $commentslib->get_forum_topics($_REQUEST['forumId'], $_REQUEST['topics_offset'] - 1, 3, $_REQUEST["topics_sort_mode"]);
if (count($threads) == 3) {
    $next_thread = $threads[2];
    $smarty->assign('next_topic', $next_thread['threadId']);
} else {
    $smarty->assign('next_topic', false);
}
if (count($threads)) {
    $prev_thread = $threads[0];
    $smarty->assign('prev_topic', $prev_thread['threadId']);
} else {
    $smarty->assign('prev_topic', false);
}
//$end_time = microtime(true);
//print "TIME3: ".($end_time - $start_time)."\n";
if ($tiki_p_admin_forum == 'y') {
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:31,代码来源:tiki-view_forum_thread.php

示例5: Comments

 /**
  * @param $limit
  * @return mixed
  */
 function forums_ranking_top_topics($limit)
 {
     global $commentslib;
     if (!$commentslib) {
         require_once 'lib/comments/commentslib.php';
         $commentslib = new Comments();
     }
     $ret = array();
     $comments = $commentslib->get_forum_topics(null, 0, $limit, 'average_desc');
     foreach ($comments as $res) {
         $aux = array();
         $aux['name'] = $res['name'] . ': ' . $res['title'];
         $aux['title'] = $res['title'];
         $aux['hits'] = $res['average'];
         $aux['href'] = 'tiki-view_forum_thread.php?forumId=' . $res['forumId'] . '&comments_parentId=' . $res['threadId'];
         $ret[] = $aux;
     }
     $retval["data"] = $ret;
     $retval["title"] = tra("Forums best topics");
     $retval["y"] = tra("Score");
     $retval["type"] = "nb";
     return $retval;
 }
开发者ID:hurcane,项目名称:tiki-azure,代码行数:27,代码来源:ranklib.php

示例6: ceil

if (!isset($_REQUEST["comments_offset"])) {
    $comments_offset = 0;
} else {
    $comments_offset = $_REQUEST["comments_offset"];
}
$smarty->assign('comments_offset', $comments_offset);
// Now check if we are displaying top-level comments or a specific comment
if (!isset($_REQUEST["comments_parentId"])) {
    $_REQUEST["comments_parentId"] = 0;
}
$smarty->assign('comments_parentId', $_REQUEST["comments_parentId"]);
if (!isset($_REQUEST['time_control'])) {
    $_REQUEST['time_control'] = 0;
}
$commentslib->set_time_control($_REQUEST['time_control']);
$comments_coms = $commentslib->get_forum_topics($_REQUEST['forumId'], $comments_offset, $_REQUEST['comments_maxComments'], $_REQUEST['comments_sort_mode']);
// Get the last "n" comments to this forum
$last_comments = $commentslib->get_last_forum_posts($_REQUEST['forumId'], $forum_info['forum_last_n']);
$smarty->assign_by_ref('last_comments', $last_comments);
$comments_cant = $commentslib->count_comments_threads($comments_objectId);
$smarty->assign('comments_cant', $comments_cant);
$comments_maxRecords = $_REQUEST["comments_maxComments"];
$comments_cant_pages = ceil($comments_cant / $comments_maxRecords);
$smarty->assign('comments_cant_pages', $comments_cant_pages);
$smarty->assign('comments_actual_page', 1 + $comments_offset / $comments_maxRecords);
if ($comments_cant > $comments_offset + $comments_maxRecords) {
    $smarty->assign('comments_next_offset', $comments_offset + $comments_maxRecords);
} else {
    $smarty->assign('comments_next_offset', -1);
}
// If offset is > 0 then prev_offset
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:tiki-view_forum.php

示例7: tra

if ($tiki_p_admin_forum == 'y') {
    $tiki_p_forum_post = 'y';
    $smarty->assign('tiki_p_forum_post', 'y');
    $tiki_p_forum_read = 'y';
    $smarty->assign('tiki_p_forum_read', 'y');
    $tiki_p_forum_vote = 'y';
    $smarty->assign('tiki_p_forum_vote', 'y');
    $tiki_p_forum_post_topic = 'y';
    $smarty->assign('tiki_p_forum_post_topic', 'y');
}
if ($tiki_p_admin_forum != 'y' && $tiki_p_forum_read != 'y') {
    $smarty->assign('msg', tra("You do not have permission to use this feature"));
    $smarty->display("error.tpl");
    die;
}
$next_thread = $commentslib->get_forum_topics($_REQUEST['forumId'], $_REQUEST['topics_offset'] + 1, 1, $_REQUEST["topics_sort_mode"]);
if (count($next_thread)) {
    $smarty->assign('next_topic', $next_thread[0]['threadId']);
} else {
    $smarty->assign('next_topic', false);
}
$smarty->assign('topics_next_offset', $_REQUEST['topics_offset'] + 1);
$smarty->assign('topics_prev_offset', $_REQUEST['topics_offset'] - 1);
// Use topics_offset, topics_find, topics_sort_mode to get the next and previous topics!
$prev_thread = $commentslib->get_forum_topics($_REQUEST['forumId'], $_REQUEST['topics_offset'] - 1, 1, $_REQUEST["topics_sort_mode"]);
if (count($prev_thread)) {
    $smarty->assign('prev_topic', $prev_thread[0]['threadId']);
} else {
    $smarty->assign('prev_topic', false);
}
if ($tiki_p_admin_forum == 'y') {
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:tiki-view_forum_thread.php

示例8: isset

    $comments_offset = $_REQUEST["comments_offset"];
}
$smarty->assign('comments_offset', $comments_offset);
// Now check if we are displaying top-level comments or a specific comment
if (!isset($_REQUEST["comments_parentId"])) {
    $_REQUEST["comments_parentId"] = 0;
}
$smarty->assign('comments_parentId', $_REQUEST["comments_parentId"]);
if (!isset($_REQUEST['time_control'])) {
    $_REQUEST['time_control'] = 0;
}
$commentslib->set_time_control($_REQUEST['time_control']);
$show_archived = isset($_REQUEST['show_archived']);
$smarty->assign('show_archived', $show_archived);
$view_archived_topics = $show_archived == 'y' && ($tiki_p_admin_forum == 'y' || $prefs['feature_forum_topics_archiving'] == 'n');
$comments_coms = $commentslib->get_forum_topics($_REQUEST['forumId'], $comments_offset, $_REQUEST['comments_per_page'], $_REQUEST['thread_sort_mode'], $view_archived_topics);
// Get the last "n" comments to this forum
$last_comments = $commentslib->get_last_forum_posts($_REQUEST['forumId'], $forum_info['forum_last_n']);
$smarty->assign_by_ref('last_comments', $last_comments);
$comments_cant = $commentslib->count_comments_threads($comments_objectId);
$smarty->assign('comments_cant', $comments_cant);
$comments_maxRecords = $_REQUEST["comments_per_page"];
$smarty->assign_by_ref('comments_coms', $comments_coms);
$cat_type = 'forum';
$cat_objid = $_REQUEST["forumId"];
include_once 'tiki-section_options.php';
if ($prefs['feature_user_watches'] == 'y') {
    if ($user && isset($_REQUEST['watch_event'])) {
        check_ticket('view-forum');
        if ($_REQUEST['watch_action'] == 'add') {
            $tikilib->add_user_watch($user, $_REQUEST['watch_event'], $_REQUEST['watch_object'], 'forum', $forum_info['name'], "tiki-view_forum.php?forumId=" . $_REQUEST['forumId']);
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:31,代码来源:tiki-view_forum.php


注:本文中的Comments::get_forum_topics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。