本文整理汇总了PHP中mark_forum_read函数的典型用法代码示例。如果您正苦于以下问题:PHP mark_forum_read函数的具体用法?PHP mark_forum_read怎么用?PHP mark_forum_read使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mark_forum_read函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mark_thread_read
/**
* Mark a particular thread as read for the current user.
*
* @param int The thread ID
* @param int The forum ID of the thread
*/
function mark_thread_read($tid, $fid)
{
global $mybb, $db;
// Can only do "true" tracking for registered users
if ($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) {
// For registered users, store the information in the database.
switch ($db->type) {
case "pgsql":
case "sqlite2":
case "sqlite3":
$db->shutdown_query($db->build_replace_query("threadsread", array('tid' => $tid, 'uid' => $mybb->user['uid'], 'dateline' => TIME_NOW), "tid"));
break;
default:
$db->write_query("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "threadsread (tid, uid, dateline)\n\t\t\t\t\tVALUES('{$tid}', '{$mybb->user['uid']}', '" . TIME_NOW . "')\n\t\t\t\t");
}
// Fetch ALL of the child forums of this forum
$forums = get_child_list($fid);
$forums[] = $fid;
$forums = implode(",", $forums);
$unread_count = fetch_unread_count($forums);
if ($unread_count == 0) {
mark_forum_read($fid);
}
} else {
my_set_array_cookie("threadread", $tid, TIME_NOW);
}
}
示例2: mark_thread_read
/**
* Mark a particular thread as read for the current user.
*
* @param int The thread ID
* @param int The forum ID of the thread
*/
function mark_thread_read($tid, $fid, $mark_time = 0)
{
global $mybb, $db;
// START - Unread posts MOD
// Disable mark read if not needed
if (function_exists("unreadPosts_is_installed") && unreadPosts_is_installed()) {
// For idiots who can't use hooks
if (THIS_SCRIPT != 'newreply.php' && THIS_SCRIPT != 'newthread.php' && THIS_SCRIPT != 'showthread.php') {
$mark_time = TIME_NOW;
}
if (!$mark_time || !$mybb->user['uid'] || !$mybb->settings['threadreadcut']) {
return;
}
switch ($db->type) {
case "pgsql":
case "sqlite":
$db->replace_query("threadsread", array('tid' => $tid, 'uid' => $mybb->user['uid'], 'dateline' => $mark_time), array("tid", "uid"));
break;
default:
$db->write_query("\n REPLACE INTO " . TABLE_PREFIX . "threadsread (tid, uid, dateline)\n VALUES('{$tid}', '{$mybb->user['uid']}', '{$mark_time}')\n ");
}
$unread_count = fetch_unread_count($fid);
if ($unread_count == 0) {
mark_forum_read($fid);
}
return;
}
// END - Unread posts MOD
// Can only do "true" tracking for registered users
if ($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) {
// For registered users, store the information in the database.
switch ($db->type) {
case "pgsql":
case "sqlite":
$db->replace_query("threadsread", array('tid' => $tid, 'uid' => $mybb->user['uid'], 'dateline' => TIME_NOW), array("tid", "uid"));
break;
default:
$db->write_query("\n REPLACE INTO " . TABLE_PREFIX . "threadsread (tid, uid, dateline)\n VALUES('{$tid}', '{$mybb->user['uid']}', '" . TIME_NOW . "')\n ");
}
} else {
my_set_array_cookie("threadread", $tid, TIME_NOW, -1);
}
$unread_count = fetch_unread_count($fid);
if ($unread_count == 0) {
mark_forum_read($fid);
}
}
示例3: mark_all_as_read_func
function mark_all_as_read_func($xmlrpc_params)
{
global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups, $forum_cache;
$input = Tapatalk_Input::filterXmlInput(array('forum_id' => Tapatalk_Input::INT), $xmlrpc_params);
if (!empty($input['forum_id'])) {
$validforum = get_forum($input['forum_id']);
if (!$validforum) {
return xmlrespfalse('Invalid forum');
}
require_once MYBB_ROOT . "/inc/functions_indicators.php";
mark_forum_read($input['forum_id']);
} else {
require_once MYBB_ROOT . "/inc/functions_indicators.php";
mark_all_forums_read();
}
return xmlresptrue();
}
示例4: mark_thread_read
/**
* Marks a thread as read using the appropriate method.
*
* @param array Array of data for the thread being marked
* @param array Array of data for the forum the thread is in
* @param integer User ID this thread is being marked read for
* @param integer Unix timestamp that the thread is being marked read
*/
function mark_thread_read(&$threadinfo, &$foruminfo, $userid, $time)
{
global $vbulletin, $db;
$userid = intval($userid);
$time = intval($time);
if ($vbulletin->options['threadmarking'] AND $userid)
{
// can't be shutdown as we do a read query below on this table
$db->query_write("
REPLACE INTO " . TABLE_PREFIX . "threadread
(threadid, userid, readtime)
VALUES
($threadinfo[threadid], $userid, $time)
");
}
else
{
set_bbarray_cookie('thread_lastview', $threadinfo['threadid'], $time);
}
// now if applicable search to see if this was the last thread requiring marking in this forum
if ($vbulletin->options['threadmarking'] == 2 AND $userid)
{
// forum can only be marked as read if all the children are read as well,
// so determine which children "count"
if ($foruminfo['childlist'] AND $userid == $vbulletin->userinfo['userid'])
{
$children = '-1';
foreach (explode(',', $foruminfo['childlist']) AS $child_forum)
{
$child_forum = intval($child_forum);
$forumperms = $vbulletin->userinfo['forumpermissions']["$child_forum"];
if (empty($forumperms) OR
!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR
!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR
!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']))
{
// invalid forum, can't be viewed, can't view threads, can't view others threads
// means we can't include this when trying to mark a thread as read
continue;
}
$children .= ',' . $child_forum;
}
}
else
{
$children = $threadinfo['forumid'];
}
$cutoff = TIMENOW - ($vbulletin->options['markinglimit'] * 86400);
$unread = $db->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = $userid)
LEFT JOIN " . TABLE_PREFIX . "forumread AS forumread ON (forumread.forumid = thread.forumid AND forumread.userid = $userid)
WHERE thread.forumid IN ($children)
AND thread.visible = 1
AND thread.sticky IN (0,1)
AND thread.lastpost > IF(threadread.readtime IS NULL, $cutoff, threadread.readtime)
AND thread.lastpost > IF(forumread.readtime IS NULL, $cutoff, forumread.readtime)
AND thread.lastpost > $cutoff
AND thread.open <> 10
");
if ($unread['count'] == 0)
{
mark_forum_read($foruminfo, $userid, TIMENOW);
}
}
}
示例5:
$foruminfo['bottomcolspan']++;
}
$show['threadslist'] = true;
/////////////////////////////////
} // end forum can contain threads
else
{
$show['threadslist'] = false;
}
/////////////////////////////////
if (!$vbulletin->GPC['prefixid'] AND $newthreads < 1 AND $unreadchildforums < 1)
{
mark_forum_read($foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
}
$forumhome_markread_script = vB_Template::create('forumhome_markread_script')->render();
construct_forum_rules($foruminfo, $forumperms);
// Revisit this at a later date as it can be made to work with each SEO option
$show['displayoptions'] = (!$vbulletin->options['friendlyurl']);
$show['forumsearch'] = (!$show['search_engine'] AND $forumperms & $vbulletin->bf_ugp_forumpermissions['cansearch'] AND $vbulletin->options['enablesearches']);
$show['forumslist'] = $forumshown ? true : false;
$show['stickies'] = ($threadbits_sticky != '');
$show['optionbox'] = ($show['moderators'] OR $show['activeusers'] OR $show['displayoptions']);
$ad_location['forum_below_threadlist'] = vB_Template::create('ad_forum_below_threadlist')->render();
示例6: mark_forums_read
/**
* Marks a forum, its child forums and all contained posts as read
*
* @param integer Forum ID to be marked as read - leave blank to mark all forums as read
*
* @return array Array of affected forum IDs
*/
function mark_forums_read($forumid = false)
{
global $vbulletin;
$db =& $vbulletin->db;
$return_url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'];
$return_phrase = 'markread';
$return_forumids = array();
if (!$forumid) {
if ($vbulletin->userinfo['userid']) {
// init user data manager
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($vbulletin->userinfo);
$userdata->set('lastactivity', TIMENOW);
$userdata->set('lastvisit', TIMENOW - 1);
$userdata->save();
if ($vbulletin->options['threadmarking']) {
$query = '';
foreach ($vbulletin->forumcache as $fid => $finfo) {
// mark the forum and all child forums read
$query .= ", ({$fid}, " . $vbulletin->userinfo['userid'] . ", " . TIMENOW . ")";
}
if ($query) {
$query = substr($query, 2);
$db->query_write("\n\t\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "forumread\n\t\t\t\t\t\t\t(forumid, userid, readtime)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t{$query}\n\t\t\t\t\t");
}
}
} else {
vbsetcookie('lastvisit', TIMENOW);
}
$return_forumids = array_keys($vbulletin->forumcache);
} else {
// temp work around code, I need to find another way to mass set some values to the cookie
$vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'forum_view', TYPE_STR);
global $bb_cache_forum_view;
$bb_cache_forum_view = @unserialize(convert_bbarray_cookie($vbulletin->GPC[COOKIE_PREFIX . 'forum_view']));
require_once DIR . '/includes/functions_misc.php';
$childforums = fetch_child_forums($forumid, 'ARRAY');
$return_forumids = $childforums;
$return_forumids[] = $forumid;
if ($vbulletin->options['threadmarking'] and $vbulletin->userinfo['userid']) {
$query = "({$forumid}, " . $vbulletin->userinfo['userid'] . ", " . TIMENOW . ")";
foreach ($childforums as $child_forumid) {
// mark the forum and all child forums read
$query .= ", ({$child_forumid}, " . $vbulletin->userinfo['userid'] . ", " . TIMENOW . ")";
}
$db->query_write("\n\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "forumread\n\t\t\t\t\t(forumid, userid, readtime)\n\t\t\t\tVALUES\n\t\t\t\t\t{$query}\n\t\t\t");
require_once DIR . '/includes/functions_bigthree.php';
$foruminfo = fetch_foruminfo($forumid);
$parent_marks = mark_forum_read($foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
if (is_array($parent_marks)) {
$return_forumids = array_unique(array_merge($return_forumids, $parent_marks));
}
} else {
foreach ($childforums as $child_forumid) {
// mark the forum and all child forums read
$bb_cache_forum_view["{$child_forumid}"] = TIMENOW;
}
set_bbarray_cookie('forum_view', $forumid, TIMENOW);
}
if ($vbulletin->forumcache["{$forumid}"]['parentid'] == -1) {
$return_url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'];
} else {
$return_url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . 'f=' . $vbulletin->forumcache["{$forumid}"]['parentid'];
}
$return_phrase = 'markread_single';
}
return array('url' => $return_url, 'phrase' => $return_phrase, 'forumids' => $return_forumids);
}
示例7: error
if ($mybb->user['uid'] && verify_post_check($mybb->get_input('my_post_key'), true) !== true) {
// Protect our user's unread forums from CSRF
error($lang->invalid_post_code);
}
if (isset($mybb->input['fid'])) {
$validforum = get_forum($mybb->input['fid']);
if (!$validforum) {
if (!isset($mybb->input['ajax'])) {
error($lang->error_invalidforum);
} else {
echo 0;
exit;
}
}
require_once MYBB_ROOT . "/inc/functions_indicators.php";
mark_forum_read($mybb->input['fid']);
$plugins->run_hooks("misc_markread_forum");
if (!isset($mybb->input['ajax'])) {
redirect(get_forum_link($mybb->input['fid']), $lang->redirect_markforumread);
} else {
echo 1;
exit;
}
} else {
$plugins->run_hooks("misc_markread_end");
require_once MYBB_ROOT . "/inc/functions_indicators.php";
mark_all_forums_read();
redirect("index.php", $lang->redirect_markforumsread);
}
} elseif ($mybb->input['action'] == "clearpass") {
$plugins->run_hooks("misc_clearpass");
示例8: get_topic_func
//.........这里部分代码省略.........
}
$new_topic = array('forum_id' => new xmlrpcval($thread['fid'], 'string'), 'topic_id' => new xmlrpcval($thread['tid'], 'string'), 'topic_title' => new xmlrpcval(basic_clean($thread['subject']), 'base64'), 'prefix' => new xmlrpcval(basic_clean($thread['displayprefix']), 'base64'), 'topic_author_id' => new xmlrpcval($thread['uid'], 'string'), 'topic_author_name' => new xmlrpcval(basic_clean($thread['username']), 'base64'), 'icon_url' => new xmlrpcval(absolute_url($thread['avatar']), 'string'), 'last_reply_time' => new xmlrpcval(mobiquo_iso8601_encode($thread['lastpost']), 'dateTime.iso8601'), 'timestamp' => new xmlrpcval($thread['lastpost'], 'string'), 'short_content' => new xmlrpcval(process_short_content($thread['message'], $parser), 'base64'), 'reply_number' => new xmlrpcval(intval($thread['replies']), 'int'), 'view_number' => new xmlrpcval(intval($thread['views']), 'int'), 'is_approved' => new xmlrpcval($thread['visible'], 'boolean'), 'is_moved' => new xmlrpcval(isset($moved[0]) && $moved[0] == "moved" ? true : false, 'boolean'), 'real_topic_id' => new xmlrpcval(isset($moved[1]) ? $moved[1] : $thread['tid']));
$forumpermissions = forum_permissions($thread['fid']);
if ($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) {
$new_topic['can_subscribe'] = new xmlrpcval(false, 'boolean');
} else {
$new_topic['can_subscribe'] = new xmlrpcval(true, 'boolean');
}
//can_rename topic
$can_rename = (is_moderator($fid, "caneditposts") || $forumpermissions['caneditposts'] == 1 && $mybb->user['uid'] == $thread['uid']) && $mybb->user['uid'] != 0;
if ($unreadpost) {
$new_topic['new_post'] = new xmlrpcval(true, 'boolean');
}
if ($thread['sticky']) {
$new_topic['is_sticky'] = new xmlrpcval(true, 'boolean');
}
if (!empty($thread['subscribed'])) {
$new_topic['is_subscribed'] = new xmlrpcval(true, 'boolean');
} else {
$new_topic['is_subscribed'] = new xmlrpcval(false, 'boolean');
}
if ($thread['closed']) {
$new_topic['is_closed'] = new xmlrpcval(true, 'boolean');
}
if ($thread['isbanned']) {
$new_topic['is_ban'] = new xmlrpcval(true, 'boolean');
}
if ($mybb->usergroup['canmodcp'] == 1) {
$new_topic['can_ban'] = new xmlrpcval(true, 'boolean');
}
if (is_moderator($fid, "canmanagethreads")) {
$new_topic['can_move'] = new xmlrpcval(true, 'boolean');
$new_topic['can_merge'] = new xmlrpcval(true, 'boolean');
$new_topic['can_merge_post'] = new xmlrpcval(true, 'boolean');
}
if (is_moderator($fid, "canopenclosethreads")) {
$new_topic['can_close'] = new xmlrpcval(true, 'boolean');
}
if (is_moderator($fid, "candeleteposts")) {
$new_topic['can_delete'] = new xmlrpcval(true, 'boolean');
}
if (is_moderator($fid, "canmanagethreads")) {
$new_topic['can_stick'] = new xmlrpcval(true, 'boolean');
}
if (is_moderator($fid, "canopenclosethreads")) {
$new_topic['can_approve'] = new xmlrpcval(true, 'boolean');
}
if ($can_rename) {
$new_topic['can_rename'] = new xmlrpcval(true, 'boolean');
}
$topic_list[] = new xmlrpcval($new_topic, 'struct');
}
$customthreadtools = '';
}
// If there are no unread threads in this forum and no unread child forums - mark it as read
require_once MYBB_ROOT . "inc/functions_indicators.php";
if (fetch_unread_count($fid) == 0 && $unread_forums == 0) {
mark_forum_read($fid);
}
$prefix_list = array();
// Does this user have additional groups?
if ($mybb->user['additionalgroups']) {
$exp = explode(",", $mybb->user['additionalgroups']);
// Because we like apostrophes...
$imps = array();
foreach ($exp as $group) {
$imps[] = "'{$group}'";
}
$additional_groups = implode(",", $imps);
$extra_sql = "groups IN ({$additional_groups}) OR ";
} else {
$extra_sql = '';
}
if ($mybb->version_code >= 1600 && $mybb->user['uid']) {
$prefixes = get_prefix_list($fid);
foreach ($prefixes as $prefix) {
$prefix_list[] = new xmlrpcval(array('prefix_id' => new xmlrpcval($prefix['pid'], "string"), 'prefix_display_name' => new xmlrpcval(basic_clean($prefix['prefix']), "base64")), "struct");
}
}
$read_only_forums = explode(",", $settings['tapatalk_forum_read_only']);
$can_post = true;
if (empty($read_only_forums) || !is_array($read_only_forums)) {
$read_only_forums = array();
}
if (!($foruminfo['type'] == "f" && $foruminfo['open'] != 0 && $mybb->user['uid'] > 0 && $mybb->usergroup['canpostthreads']) || in_array($fid, $read_only_forums)) {
$can_post = false;
}
$result = array('total_topic_num' => new xmlrpcval($threadcount, 'int'), 'forum_id' => new xmlrpcval($fid, 'string'), 'forum_name' => new xmlrpcval(basic_clean($foruminfo['name']), 'base64'), 'can_post' => new xmlrpcval($can_post, 'boolean'), 'prefixes' => new xmlrpcval($prefix_list, 'array'), 'can_upload' => new xmlrpcval($fpermissions['canpostattachments'], 'boolean'));
if ($unreadStickyCount) {
$result['unread_sticky_count'] = new xmlrpcval($unreadStickyCount, 'int');
}
if ($mybb->user['uid']) {
$query = $db->simple_select("forumsubscriptions", "fid", "fid='" . $fid . "' AND uid='{$mybb->user['uid']}'", array('limit' => 1));
if ($db->fetch_field($query, 'fid')) {
$result['is_subscribed'] = new xmlrpcval(true, 'boolean');
}
}
$result['topics'] = new xmlrpcval($topic_list, 'array');
return new xmlrpcresp(new xmlrpcval($result, 'struct'));
}
示例9: eval
eval("\$inlinemodapproveunapprove = \"" . $templates->get("forumdisplay_inlinemoderation_approveunapprove") . "\";");
}
if (!empty($inlinemodopenclose) || !empty($inlinemodstickunstick) || !empty($inlinemodsoftdelete) || !empty($inlinemodrestore) || !empty($inlinemoddelete) || !empty($inlinemodmanage) || !empty($inlinemodapproveunapprove)) {
eval("\$standardthreadtools = \"" . $templates->get("forumdisplay_inlinemoderation_standard") . "\";");
}
// Only show inline mod menu if there's options to show
if (!empty($standardthreadtools) || !empty($customthreadtools)) {
eval("\$inlinemod = \"" . $templates->get("forumdisplay_inlinemoderation") . "\";");
}
}
}
// If there are no unread threads in this forum and no unread child forums - mark it as read
require_once MYBB_ROOT . "inc/functions_indicators.php";
$unread_threads = fetch_unread_count($fid);
if ($unread_threads !== false && $unread_threads == 0 && empty($unread_forums)) {
mark_forum_read($fid);
}
// Subscription status
$add_remove_subscription = 'add';
$add_remove_subscription_text = $lang->subscribe_forum;
if ($mybb->user['uid']) {
$query = $db->simple_select("forumsubscriptions", "fid", "fid='" . $fid . "' AND uid='{$mybb->user['uid']}'", array('limit' => 1));
if ($db->fetch_field($query, 'fid')) {
$add_remove_subscription = 'remove';
$add_remove_subscription_text = $lang->unsubscribe_forum;
}
}
$inline_edit_js = $clearstoredpass = '';
// Is this a real forum with threads?
if ($foruminfo['type'] != "c") {
if (!$threadcount) {
示例10: do_get_forum
//.........这里部分代码省略.........
// Special case for redirect threads
$tmp = array_merge($tmp, array('post_userid' => $thread['postuserid'], 'post_username' => prepare_utf8_string(strip_tags($thread['postusername'])), 'poll' => false));
}
if ($thread['sticky']) {
$thread_data_sticky[] = $tmp;
} else {
$thread_data[] = $tmp;
}
// FRNR Stop
}
$db->free_result($threads);
unset($thread, $counter);
$pageinfo_pagenav = array();
if (!empty($vbulletin->GPC['perpage'])) {
$pageinfo_pagenav['pp'] = $perpage;
}
if (!empty($vbulletin->GPC['prefixid'])) {
$pageinfo_pagenav['prefixid'] = $vbulletin->GPC['prefixid'];
}
if (!empty($vbulletin->GPC['sortfield'])) {
$pageinfo_pagenav['sort'] = $sortfield;
}
if (!empty($vbulletin->GPC['sortorder'])) {
$pageinfo_pagenav['order'] = $vbulletin->GPC['sortorder'];
}
if (!empty($vbulletin->GPC['daysprune'])) {
$pageinfo_pagenav['daysprune'] = $daysprune;
}
$pagenav = construct_page_nav($pagenumber, $perpage, $totalthreads, 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$foruminfo['forumid']}", '', '', 'forum', $foruminfo, $pageinfo_pagenav);
}
unset($threads, $dotthreads);
// get colspan for bottom bar
$foruminfo['bottomcolspan'] = 5;
if ($foruminfo['allowicons']) {
$foruminfo['bottomcolspan']++;
}
if ($show['inlinemod']) {
$foruminfo['bottomcolspan']++;
}
$show['threadslist'] = true;
/////////////////////////////////
} else {
$show['threadslist'] = false;
$canpost = false;
// FRNR
}
/////////////////////////////////
if (!$vbulletin->GPC['prefixid'] and $newthreads < 1 and $unreadchildforums < 1) {
mark_forum_read($foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
}
// FNRN Below
$out = array();
if (is_array($thread_data) && count($thread_data) > 0) {
$out['threads'] = $thread_data;
} else {
$out['threads'] = array();
}
if (is_array($thread_data_sticky) && count($thread_data_sticky) > 0) {
$out['threads_sticky'] = $thread_data_sticky;
$out['total_sticky_threads'] = count($thread_data_sticky);
} else {
$out['threads_sticky'] = array();
$out['total_sticky_threads'] = 0;
}
// Announcements become #1 on the threads
if (is_array($announcements_out) && count($announcements_out) == 1) {
array_unshift($out['threads'], $announcements_out[0]);
$totalthreads++;
}
$out['total_threads'] = $totalthreads ? $totalthreads : 0;
if ($forumbits) {
$out['forums'] = $forumbits;
} else {
$out['forums'] = array();
}
$out['canpost'] = $canpost ? 1 : 0;
$out['canattach'] = ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid']);
// Get thread prefixes for this forum (if any)
$prefix_out = array();
if ($prefixsets = fetch_prefix_array($forumid)) {
foreach ($prefixsets as $prefixsetid => $prefixes) {
$optgroup_options = '';
foreach ($prefixes as $prefixid => $prefix) {
if ($permcheck and !can_use_prefix($prefixid, $prefix['restrictions'])) {
continue;
}
$optionvalue = $prefixid;
$optiontitle = htmlspecialchars_uni($vbphrase["prefix_{$prefixid}_title_plain"]);
$prefix_out[] = array('prefixid' => $prefixid, 'prefixcaption' => prepare_utf8_string($optiontitle));
}
}
}
if ($foruminfo['options'] & $vbulletin->bf_misc_forumoptions['prefixrequired']) {
$out['prefixrequired'] = true;
} else {
$out['prefixrequired'] = false;
}
$out['prefixes'] = $prefix_out;
return $out;
}
示例11: MarkForumRead
function MarkForumRead($who, $forumid)
{
global $db, $vbulletin, $server, $structtypes, $lastpostarray;
$result = RegisterService($who);
if ($result['Code'] != 0) {
$retval['Result'] = $result;
return $retval;
}
$foruminfo = fetch_foruminfo($forumid);
mark_forum_read($foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
$result['RemoteUser'] = ConsumeArray($vbulletin->userinfo, $structtypes['RemoteUser']);
$retval['Result'] = $result;
return $retval;
}