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


PHP Comments::list_forums方法代码示例

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


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

示例1: listforum_pref

/**
 * listforum_pref: retrieve the list of forums for the home_forum preference
 *
 * @access public
 * @return array: forumId => name(truncated)
 */
function listforum_pref()
{
    include_once 'lib/comments/commentslib.php';
    $commentslib = new Comments();
    $allforums = $commentslib->list_forums(0, -1, 'name_desc', '');
    $listforums = array('' => 'None');
    if ($allforums['cant'] > 0) {
        foreach ($allforums['data'] as $oneforum) {
            $listforums[$oneforum['forumId']] = substr($oneforum['name'], 0, 30);
        }
    } else {
        $listforums[''] = tra('No forum available (create one first)');
    }
    return $listforums;
}
开发者ID:railfuture,项目名称:tiki-website,代码行数:21,代码来源:home.php

示例2: array

		if (count($watching_categories_temp) > 0) {
			$smarty->assign('category_watched', 'y');
			$watching_categories = array();
			foreach ($watching_categories_temp as $wct) {
				$watching_categories[] = array(
					"categId" => $wct,
					"name" => $categlib->get_category_name($wct)
				);
			}
			$smarty->assign('watching_categories', $watching_categories);
		}
	}
}

if ($tiki_p_admin_forum == 'y' || $prefs['feature_forum_quickjump'] == 'y') {
	$all_forums = $commentslib->list_forums(0, -1, 'name_asc', '');
	$temp_max = count($all_forums['data']);
	for ($i = 0; $i < $temp_max; $i++) {
		if ($userlib->object_has_one_permission($all_forums['data'][$i]['forumId'], 'forum')) {
			if ($tiki_p_admin == 'y' 
						|| $userlib->object_has_permission($user, $all_forums['data'][$i]['forumId'], 'forum', 'tiki_p_admin_forum') 
						|| $userlib->object_has_permission($user, $all_forums['data'][$i]['forumId'], 'forum', 'tiki_p_forum_read')) {
				$all_forums['data'][$i]['can_read'] = 'y';
			} else {
				$all_forums['data'][$i]['can_read'] = 'n';
			}
		} else {
			$all_forums['data'][$i]['can_read'] = 'y';
		}
	}
	$smarty->assign('all_forums', $all_forums['data']);
开发者ID:railfuture,项目名称:tiki-website,代码行数:31,代码来源:tiki-view_forum.php

示例3: Comments

if ( $prefs['feature_galleries'] == 'y' ) {
	$galleries = $tikilib->list_galleries($offset, -1, 'name_desc', 'admin', $find_objects);
}

if ( $prefs['feature_file_galleries'] == 'y' ) {
	include_once ('lib/filegals/filegallib.php');
	$file_galleries = $filegallib->list_file_galleries($offset, -1, 'name_desc', 'admin', $find_objects, $prefs['fgal_root_id']);
}

if ( $prefs['feature_forums'] == 'y' ) {
	include_once ('lib/comments/commentslib.php');
	if (!isset($commentslib)) {
		$commentslib = new Comments($dbTiki);
	}
	$forums = $commentslib->list_forums($offset, -1, 'name_asc', $find_objects);
}

if ( $prefs['feature_polls'] == 'y' ) {
	include_once ('lib/polls/polllib.php');
	$polls = $polllib->list_polls($offset, $maxRecords, 'title_asc', $find_objects);
}

if ( $prefs['feature_blogs'] == 'y' ) {
	require_once('lib/blogs/bloglib.php');
	$blogs = $bloglib->list_blogs($offset, -1, 'title_asc', $find_objects);
}

if ( $prefs['feature_wiki'] == 'y' ) {
	$pages = $tikilib->list_pageNames($offset, -1, 'pageName_asc', $find_objects);
	//TODO for all other object types
开发者ID:railfuture,项目名称:tiki-website,代码行数:30,代码来源:tiki-admin_categories.php

示例4: count

    $sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
    $offset = 0;
} else {
    $offset = $_REQUEST["offset"];
}
$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);
$channels = $commentslib->list_forums($offset, $maxRecords, $sort_mode, $find);
$temp_max = count($channels["data"]);
for ($i = 0; $i < $temp_max; $i++) {
    if ($userlib->object_has_one_permission($channels["data"][$i]["forumId"], 'forum')) {
        $channels["data"][$i]["individual"] = 'y';
        // forums that user cannot read are not displayed at all
        $channels["data"][$i]["individual_tiki_p_forum_read"] = 'y';
        if ($userlib->object_has_permission($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_forum_post')) {
            $channels["data"][$i]["individual_tiki_p_forum_post"] = 'y';
        } else {
            $channels["data"][$i]["individual_tiki_p_forum_post"] = 'n';
        }
        if ($userlib->object_has_permission($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_forum_vote')) {
            $channels["data"][$i]["individual_tiki_p_forum_vote"] = 'y';
        } else {
            $channels["data"][$i]["individual_tiki_p_forum_vote"] = 'n';
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:31,代码来源:tiki-forums.php

示例5: array

if (isset($_REQUEST["forumprefs"])) {
    check_ticket('admin-inc-forums');
    $pref_toggles = array('feature_forum_rankings', 'feature_forum_parse', 'feature_forum_topics_archiving', 'feature_forum_replyempty', 'feature_forum_quickjump', 'feature_forum_topicd', 'feature_forum_local_search', 'feature_forum_local_tiki_search', 'feature_forums_search', 'feature_forum_content_search', 'feature_forums_name_search', 'feature_forums_allow_thread_titles', 'forum_comments_no_title_prefix');
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    simple_set_value('forums_ordering');
}
if (isset($_REQUEST["forumlistprefs"])) {
    check_ticket('admin-inc-forums');
    $pref_toggles = array('forum_list_topics', 'forum_list_posts', 'forum_list_ppd', 'forum_list_lastpost', 'forum_list_visits', 'forum_list_desc');
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
}
if (isset($_REQUEST["forumthreadprefs"])) {
    check_ticket('admin-inc-forums');
    $pref_toggles = array('forum_thread_defaults_by_forum', 'forum_thread_user_settings', 'forum_thread_user_settings_keep');
    $pref_values = array('forum_comments_per_page', 'forum_thread_style', 'forum_thread_sort_mode');
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    foreach ($pref_values as $value) {
        simple_set_value($value);
    }
}
include_once "lib/commentslib.php";
$commentslib = new Comments($dbTiki);
$forums = $commentslib->list_forums(0, -1, 'name_desc', '');
$smarty->assign_by_ref('forums', $forums["data"]);
ask_ticket('admin-inc-forums');
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:31,代码来源:tiki-admin_include_forums.php

示例6: array

		case 'trackers':
			$objects = TikiLib::lib('trk')->list_trackers();
			foreach ($objects['data'] as $object) {
				$r = list_perms($object['trackerId'], $type, $object['name'], $filterGroup);
				if (count($r['special']) > 0) {
					$res[$type]['objects'][] = array('objectId' => $r['objectId'], 'special' => $r['special'], 'objectName' => $object['name'], 'objectType' => $type);
				}
				if (count($r['category']) > 0) { 
					$res[$type]['category'][] = array('objectId' => $r['objectId'], 'category' => $r['category'], 'objectName' => $object['name']);
				}
			}
    		break;

		case 'forum':
		case 'forums':
			$objects = $commentslib->list_forums();
			foreach ($objects['data'] as $object) {
				$r = list_perms($object['forumId'], $type, $object['name'], $filterGroup);
				if (count($r['special']) > 0) { 
					$res[$type]['objects'][] = array('objectId' => $r['objectId'], 'special' => $r['special'], 'objectName' => $object['name']);
				}
				if (count($r['category']) > 0) {
					$res[$type]['category'][] = array('objectId' => $r['objectId'], 'category' => $r['category'], 'objectName' => $object['name']);
				}
			}
    		break;

		case 'group':
		case 'groups':
			foreach ($all_groups as $object) {
				$r = list_perms($object, $type, '', $filterGroup);
开发者ID:railfuture,项目名称:tiki-website,代码行数:31,代码来源:tiki-list_object_permissions.php

示例7: count

    $sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
    $offset = 0;
} else {
    $offset = $_REQUEST["offset"];
}
$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);
$channels = $commentslib->list_forums($offset, $maxRecords, $sort_mode, $find);
$max = count($channels["data"]);
for ($i = 0; $i < $max; $i++) {
    if ($userlib->object_has_one_permission($channels["data"][$i]["forumId"], 'forum')) {
        $channels["data"][$i]["individual"] = 'y';
        if ($tiki_p_admin == 'y' || $userlib->object_has_permission($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_admin_forum')) {
            $channels["data"][$i]["individual_tiki_p_admin_forum"] = 'y';
        }
    } elseif ($userlib->user_has_perm_on_object($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_admin_forum')) {
        $channels["data"][$i]["individual_tiki_p_admin_forum"] = 'y';
    } else {
        $channels["data"][$i]["individual"] = 'n';
    }
}
$smarty->assign_by_ref('channels', $channels["data"]);
$smarty->assign_by_ref('cant', $channels["cant"]);
开发者ID:hurcane,项目名称:tiki-azure,代码行数:31,代码来源:tiki-admin_forums.php

示例8: Comments

     $smarty->assign_by_ref('objects', $objects["data"]);
     $objects = $objects['data'];
     correct_array($objects, 'galleryId', 'name');
     break;
 case 'file gallery':
     $objects = $filegallib->list_file_galleries(0, -1, 'name_desc', 'admin', $find_objects, $prefs['fgal_root_id']);
     $smarty->assign_by_ref('objects', $objects["data"]);
     $objects = $objects['data'];
     correct_array($objects, 'galleryId', 'name');
     break;
 case 'forum':
     require_once 'lib/comments/commentslib.php';
     if (!isset($commentslib)) {
         $commentslib = new Comments($dbTiki);
     }
     $objects = $commentslib->list_forums(0, -1, 'name_asc', $find_objects);
     $smarty->assign_by_ref('objects', $objects["data"]);
     $objects = $objects['data'];
     correct_array($objects, 'forumId', 'name');
     break;
 case 'blog':
     require_once 'lib/blogs/bloglib.php';
     $objects = $bloglib->list_blogs(0, -1, 'title_asc', $find_objects);
     $smarty->assign_by_ref('objects', $objects["data"]);
     $objects = $objects['data'];
     correct_array($objects, 'blogId', 'title');
     break;
 case 'wiki page':
     $objects = $tikilib->list_pageNames(0, -1, 'pageName_asc', $find_objects);
     $smarty->assign_by_ref('objects', $objects["data"]);
     $objects = $objects['data'];
开发者ID:hurcane,项目名称:tiki-azure,代码行数:31,代码来源:tiki-theme_control_objects.php

示例9: Comments

		if ($prefs['allowmsg_is_optional'] == 'y') {
			if ($tikilib->get_user_preference($user, 'allowMsgs', 'y') != 'y') {
				$send_msg = false;
			}
		}
		$smarty->assign('send_msg', $send_msg);	
	} else {
		$smarty->assign('send_msg', false);
	}
	$smarty->assign('messageto', (isset($_REQUEST['messageto'])?$_REQUEST['messageto']:''));

	if (isset($prefs['feature_forums']) and $prefs['feature_forums'] == 'y') {
		include_once ('lib/comments/commentslib.php');
		$commentslib = new Comments($dbTiki); // not done in commentslib
		$sort_mode = $prefs['forums_ordering'];
		$channels = $commentslib->list_forums(0, -1, $sort_mode, '');
		Perms::bulk(array( 'type' => 'forum' ), 'object', $channels['data'], 'forumId');
		$forums = array();
		$temp_max = count($channels['data']);
		for ($i = 0; $i < $temp_max; $i++) {
			$forumperms = Perms::get(array( 'type' => 'forum', 'object' => $channels['data'][$i]['forumId'] ));
			if (($forumperms->forum_post and $forumperms->forum_post_topic) or $forumperms->admin_forum) {
				$forums[] = $channels['data'][$i];
			}
		}
		$smarty->assign('forumId', (isset($_REQUEST['forumId']) ? $_REQUEST['forumId'] : 0));
	} else {
		$forums = array();
	}
	$smarty->assign('forums', $forums);
	$report='n';
开发者ID:railfuture,项目名称:tiki-website,代码行数:31,代码来源:tiki-share.php

示例10: Comments

 /**
  * @param $limit
  * @return mixed
  */
 function forums_ranking_most_commented_forum($limit)
 {
     global $commentslib;
     if (!$commentslib) {
         require_once 'lib/comments/commentslib.php';
         $commentslib = new Comments();
     }
     $result = $commentslib->list_forums(0, $limit, 'comments_desc');
     $ret = array();
     $count = 0;
     foreach ($result['data'] as $res) {
         $aux['name'] = $res['name'];
         $aux['hits'] = $res['hits'];
         $aux['href'] = 'tiki-view_forum.php?forumId=' . $res['forumId'];
         $ret[] = $aux;
     }
     $retval["data"] = $ret;
     $retval["title"] = tra("Forums with most posts");
     $retval["y"] = tra("Posts");
     $retval["type"] = "nb";
     return $retval;
 }
开发者ID:hurcane,项目名称:tiki-azure,代码行数:26,代码来源:ranklib.php


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