本文整理汇总了PHP中fetch_foruminfo函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_foruminfo函数的具体用法?PHP fetch_foruminfo怎么用?PHP fetch_foruminfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_foruminfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newThread
function newThread($newpost, $posterid = '')
{
global $vbulletin;
if ($posterid == '') {
$posterid = $vbulletin->userinfo['userid'];
}
$threadman =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$foruminfo = fetch_foruminfo($newpost['forumid']);
$threadinfo = array();
$threadman->set_info('forum', $foruminfo);
$threadman->set_info('thread', $threadinfo);
$threadman->setr('forumid', $newpost['forumid']);
$threadman->setr('userid', $posterid);
$threadman->setr('pagetext', $newpost['pagetext']);
$threadman->setr('title', $newpost['title']);
$threadman->setr('showsignature', $signature);
$threadman->set('allowsmilie', $newpost['allowsmilie']);
$threadman->set('visible', $newpost['visible']);
$threadman->set_info('parseurl', $newpost['parseurl']);
$threadman->set('prefixid', $newpost['prefixid']);
$idpack['threadid'] = $threadman->save();
$result = $vbulletin->db->query_read("SELECT `firstpostid` FROM `" . TABLE_PREFIX . "thread` WHERE `threadid`='{$idpack['threadid']}'");
$row = $vbulletin->db->fetch_row($result);
$idpack['postid'] = $row[0];
return $idpack;
}
示例2: create_from_id
/**
* Load object from an id
*
* @param int $id
* @return vB_Legacy_Forum
*/
public static function create_from_id($id)
{
$foruminfo = fetch_foruminfo($id);
//try to work with bad data integrity. There are dbs out there
//with threads that belong to a nonexistant forum.
if ($foruminfo) {
return self::create_from_record($foruminfo);
} else {
return null;
}
}
示例3: fetch_forum
function fetch_forum($forumid)
{
global $vbulletin;
if ($forumid == -1) {
return array('title' => str($vbulletin->options['bbtitle']), 'threadcount' => 0);
}
// Don't use cache as it doesn't include threadcount by default
$foruminfo = fetch_foruminfo($forumid, false);
if (!$foruminfo) {
return false;
}
return array('id' => intval($foruminfo['forumid']), 'title' => str($foruminfo['title'], true), 'description' => str($foruminfo['description'], true), 'threadcount' => intval($foruminfo['threadcount']), 'replycount' => intval($foruminfo['replycount']));
}
示例4: create_from_id
/**
* Load object from an id
*
* @param int $id
* @return vB_Legacy_Forum
*/
public static function create_from_id($id)
{
//the cache get prefilled with abbreviated data that is *different* from what
//the query in fetch_foruminfo provides. We can skip the cache, but that means
//we never cache, even if we want to.
//this is going to prove to be a problem.
//There is an incomplete copy stored in cache. Not sure why,
// but it consistently doesn't give me the lastthreadid unless I pass "false"
// to prevent reading from cache
$foruminfo = fetch_foruminfo($id, false);
//try to work with bad data integrity. There are dbs out there
//with threads that belong to a nonexistant forum.
if ($foruminfo) {
return self::create_from_record($foruminfo);
} else {
return null;
}
}
示例5: verify_forum_password
/**
* Returns whether or not the visiting user can view the specified password-protected forum
*
* @param integer Forum ID
* @param string Provided password
* @param boolean If true, show error when access is denied
*
* @return boolean
*/
function verify_forum_password($forumid, $password, $showerror = true)
{
global $vbulletin;
if (!$password OR ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) OR ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator']) OR can_moderate($forumid))
{
return true;
}
$foruminfo = fetch_foruminfo($forumid);
$parents = explode(',', $foruminfo['parentlist']);
foreach ($parents AS $fid)
{ // get the pwd from any parent forums -- allows pwd cookies to cascade down
if ($temp = fetch_bbarray_cookie('forumpwd', $fid) AND $temp === md5($vbulletin->userinfo['userid'] . $password))
{
return true;
}
}
// didn't match the password in any cookie
if ($showerror)
{
require_once(DIR . '/includes/functions_misc.php');
$security_token_html = '<input type="hidden" name="securitytoken" value="' . $vbulletin->userinfo['securitytoken'] . '" />';
// forum password is bad - show error
// TODO convert the 'forumpasswordmissoing' phrase to vB4
eval(standard_error(fetch_error('forumpasswordmissing',
$vbulletin->session->vars['sessionhash'],
$vbulletin->scriptpath,
$forumid,
construct_post_vars_html() . $security_token_html,
10,
1
)));
}
else
{
// forum password is bad - return false
return false;
}
}
示例6: print_table_header
print_table_header($vbphrase['forum_based_permission_duplicator']);
print_forum_chooser($vbphrase['copy_permissions_from_forum'], 'forumid_from', -1);
print_label_row($vbphrase['copy_permissions_to_forums'], "<span class=\"smallfont\">{$forumlist}</span>", '', 'top', 'forumlist');
//print_chooser_row($vbphrase['only_copy_permissions_from_group'], 'limitugid', 'usergroup', -1, $vbphrase['all_usergroups']);
print_yes_no_row($vbphrase['overwrite_duplicate_entries'], 'overwritedupes_forum', 0);
print_yes_no_row($vbphrase['overwrite_inherited_entries'], 'overwriteinherited_forum', 0);
print_submit_row($vbphrase['go']);
}
// ###################### Start do duplicate (group-based) #######################
if ($_POST['do'] == 'doduplicate_group') {
$vbulletin->input->clean_array_gpc('p', array('ugid_from' => TYPE_INT, 'limitforumid' => TYPE_INT, 'overwritedupes_group' => TYPE_INT, 'overwriteinherited_group' => TYPE_INT, 'usergrouplist' => TYPE_ARRAY));
if (sizeof($vbulletin->GPC['usergrouplist']) == 0) {
print_stop_message('invalid_usergroup_specified');
}
if ($vbulletin->GPC['limitforumid'] > 0) {
$foruminfo = fetch_foruminfo($vbulletin->GPC['limitforumid']);
$forumsql = "AND forumpermission.forumid IN ({$foruminfo['parentlist']})";
$childforum = "AND forumpermission.forumid IN ({$foruminfo['childlist']})";
} else {
$childforum = '';
$forumsql = '';
}
foreach ($vbulletin->GPC['usergrouplist'] as $ugid_to => $confirm) {
$ugid_to = intval($ugid_to);
if ($vbulletin->GPC['ugid_from'] == $ugid_to or $confirm != 1) {
continue;
}
$forumsql_local = '';
$existing = $db->query_read("\n\t\t\tSELECT forumpermission.forumid, forum.parentlist\n\t\t\tFROM " . TABLE_PREFIX . "forumpermission AS forumpermission, " . TABLE_PREFIX . "forum AS forum\n\t\t\tWHERE forumpermission.forumid = forum.forumid\n\t\t\t\tAND usergroupid = {$ugid_to}\n\t\t\t\t{$forumsql}\n\t\t\t\t{$forumsql_local}\n\t\t");
$perm_set = array();
while ($thisperm = $db->fetch_array($existing)) {
示例7: explode
$highlight = explode(' ', $highlight);
$highlight = str_replace($regexfind, $regexreplace, $highlight);
foreach ($highlight as $val) {
if ($val = trim($val)) {
$replacewords[] = htmlspecialchars_uni($val);
}
}
}
}
// *********************************************************************************
// make the forum jump in order to fill the forum caches
$navpopup = array('id' => 'showthread_navpopup', 'title' => $foruminfo['title_clean'], 'link' => fetch_seo_url('thread', $threadinfo));
construct_quick_nav($navpopup);
// *********************************************************************************
// get forum info
$forum = fetch_foruminfo($thread['forumid']);
$foruminfo =& $forum;
// *********************************************************************************
// check forum permissions
$forumperms = fetch_permissions($thread['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) {
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) and ($thread['postuserid'] != $vbulletin->userinfo['userid'] or $vbulletin->userinfo['userid'] == 0)) {
print_no_permission();
}
// *********************************************************************************
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
// *********************************************************************************
// jump page if thread is actually a redirect
示例8: do_report
/**
* Does the report
*
* @param string The Reason for the report
* @param array Information regarding the item being reported
*
*/
function do_report($reason, &$iteminfo)
{
global $vbphrase;
$this->iteminfo =& $iteminfo;
$reportinfo = array('rusername' => unhtmlspecialchars($this->registry->userinfo['username']), 'ruserid' => $this->registry->userinfo['userid'], 'remail' => $this->registry->userinfo['email']);
if ($this->registry->options['postmaxchars'] > 0) {
$reportinfo['reason'] = substr($reason, 0, $this->registry->options['postmaxchars']);
} else {
$reportinfo['reason'] = $reason;
}
$reportthread = ($rpforumid = $this->registry->options['rpforumid'] and $rpforuminfo = fetch_foruminfo($rpforumid));
$reportemail = ($this->registry->options['enableemail'] and $this->registry->options['rpemail']);
$mods = array();
$reportinfo['modlist'] = '';
$moderators = $this->fetch_affected_moderators();
if ($moderators) {
while ($moderator = $this->registry->db->fetch_array($moderators)) {
$mods["{$moderator['userid']}"] = $moderator;
$reportinfo['modlist'] .= (!empty($reportinfo['modlist']) ? ', ' : '') . unhtmlspecialchars($moderator['username']);
}
}
if (empty($reportinfo['modlist'])) {
$reportinfo['modlist'] = $vbphrase['n_a'];
}
$this->set_reportinfo($reportinfo);
if ($reportthread) {
// Determine if we need to create a thread or a post
if (!$this->iteminfo['reportthreadid'] or !($rpthreadinfo = fetch_threadinfo($this->iteminfo['reportthreadid'])) or $rpthreadinfo and ($rpthreadinfo['isdeleted'] or !$rpthreadinfo['visible'] or $rpthreadinfo['forumid'] != $rpforuminfo['forumid'])) {
eval(fetch_email_phrases('report' . $this->phrasekey . '_newthread', 0));
if (!$this->registry->options['rpuserid'] or !($userinfo = fetch_userinfo($this->registry->options['rpuserid']))) {
$userinfo =& $this->registry->userinfo;
}
$threadman =& datamanager_init('Thread_FirstPost', $this->registry, ERRTYPE_SILENT, 'threadpost');
$threadman->set_info('forum', $rpforuminfo);
$threadman->set_info('is_automated', true);
$threadman->set_info('skip_moderator_email', true);
$threadman->set_info('mark_thread_read', true);
$threadman->set_info('parseurl', true);
$threadman->set('allowsmilie', true);
$threadman->set('userid', $userinfo['userid']);
$threadman->setr_info('user', $userinfo);
$threadman->set('title', $subject);
$threadman->set('pagetext', $message);
$threadman->set('forumid', $rpforuminfo['forumid']);
$threadman->set('visible', 1);
if ($userinfo['userid'] != $this->registry->userinfo['userid']) {
// not posting as the current user, IP won't make sense
$threadman->set('ipaddress', '');
}
$rpthreadid = $threadman->save();
if ($this->update_item_reportid($rpthreadid)) {
$threadman->set_info('skip_moderator_email', false);
$threadman->email_moderators(array('newthreademail', 'newpostemail'));
$this->iteminfo['reportthreadid'] = 0;
$rpthreadinfo = array('threadid' => $rpthreadid, 'forumid' => $rpforuminfo['forumid'], 'postuserid' => $userinfo['userid']);
// check the permission of the other user
$userperms = fetch_permissions($rpthreadinfo['forumid'], $userinfo['userid'], $userinfo);
if ($userperms & $this->registry->bf_ugp_forumpermissions['canview'] and $userperms & $this->registry->bf_ugp_forumpermissions['canviewthreads'] and $userinfo['autosubscribe'] != -1) {
$this->registry->db->query_write("\n\t\t\t\t\t\t\tINSERT IGNORE INTO " . TABLE_PREFIX . "subscribethread\n\t\t\t\t\t\t\t\t(userid, threadid, emailupdate, folderid, canview)\n\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t(" . $userinfo['userid'] . ", {$rpthreadinfo['threadid']}, {$userinfo['autosubscribe']}, 0, 1)\n\t\t\t\t\t\t");
}
} else {
// Delete the thread we just created
if ($delthread = fetch_threadinfo($rpthreadid)) {
$threadman =& datamanager_init('Thread', $this->registry, ERRTYPE_SILENT, 'threadpost');
$threadman->set_existing($delthread);
$threadman->delete($rpforuminfo['countposts'], true, NULL, false);
unset($threadman);
}
$this->refetch_iteminfo();
}
}
if ($this->iteminfo['reportthreadid'] and $rpthreadinfo = fetch_threadinfo($this->iteminfo['reportthreadid']) and !$rpthreadinfo['isdeleted'] and $rpthreadinfo['visible'] == 1 and $rpthreadinfo['forumid'] == $rpforuminfo['forumid']) {
eval(fetch_email_phrases('reportitem_newpost', 0));
// Already reported, thread still exists/visible, and thread is in the right forum.
// Technically, if the thread exists but is in the wrong forum, we should create the
// thread, but that should only occur in a race condition.
if (!$this->registry->options['rpuserid'] or !$userinfo and !($userinfo = fetch_userinfo($this->registry->options['rpuserid']))) {
$userinfo =& $this->registry->userinfo;
}
$postman =& datamanager_init('Post', $this->registry, ERRTYPE_STANDARD, 'threadpost');
$postman->set_info('thread', $rpthreadinfo);
$postman->set_info('forum', $rpforuminfo);
$postman->set_info('is_automated', true);
$postman->set_info('parseurl', true);
$postman->set('threadid', $rpthreadinfo['threadid']);
$postman->set('userid', $userinfo['userid']);
$postman->set('allowsmilie', true);
$postman->set('visible', true);
$postman->set('title', $subject);
$postman->set('pagetext', $message);
if ($userinfo['userid'] != $this->registry->userinfo['userid']) {
// not posting as the current user, IP won't make sense
$postman->set('ipaddress', '');
//.........这里部分代码省略.........
示例9: datamanager_init
$itemtype = 'announcement';
$threadactiontime = 0;
if (defined('IN_CONTROL_PANEL')) {
echo "<li><a href=\"{$itemlink}\" target=\"feed\">{$itemtitle}</a></li>";
}
$rsslog_insert_sql[] = "({$item['rssfeedid']}, {$itemid}, '{$itemtype}', '" . $vbulletin->db->escape_string($uniquehash) . "', '" . $vbulletin->db->escape_string($item['contenthash']) . "', " . TIMENOW . ", {$threadactiontime})";
$cronlog_items["{$item['rssfeedid']}"][] = "\t<li>{$vbphrase[$itemtype]} <a href=\"{$itemlink}\" target=\"logview\"><em>{$itemtitle}</em></a></li>";
}
break;
// insert item as thread
// insert item as thread
case 'thread':
default:
// init thread/firstpost datamanager
$itemdata =& datamanager_init('Thread_FirstPost', $vbulletin, $error_type, 'threadpost');
$itemdata->set_info('forum', fetch_foruminfo($feed['forumid']));
$itemdata->set_info('user', $feed);
$itemdata->set_info('is_automated', 'rss');
$itemdata->set_info('chop_title', true);
$itemdata->set('iconid', $feed['iconid']);
$itemdata->set('sticky', $feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['stickthread'] ? 1 : 0);
$itemdata->set('forumid', $feed['forumid']);
$itemdata->set('prefixid', $feed['prefixid']);
$itemdata->set('userid', $feed['userid']);
$itemdata->set('title', strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item))));
$itemdata->set('pagetext', $pagetext);
$itemdata->set('visible', $feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['moderatethread'] ? 0 : 1);
$itemdata->set('allowsmilie', $feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['allowsmilies'] ? 1 : 0);
$itemdata->set('showsignature', $feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['showsignature'] ? 1 : 0);
$itemdata->set('ipaddress', '');
$threadactiontime = $feed['threadactiondelay'] > 0 ? TIMENOW + $feed['threadactiondelay'] * 3600 : 0;
示例10: print_form_header
print_form_header('thread', 'dothreads');
construct_hidden_code('type', 'move');
print_table_header($vbphrase['move_threads']);
print_moderator_forum_chooser('destforumid', -1, '', $vbphrase['destination_forum'], false, false, true, 'none');
print_move_prune_rows('canmassmove');
print_submit_row($vbphrase['move_threads']);
}
// ###################### Start thread move/prune by options #######################
if ($_POST['do'] == 'dothreads') {
$vbulletin->input->clean_array_gpc('p', array('thread' => TYPE_ARRAY, 'destforumid' => TYPE_INT));
if ($vbulletin->GPC['thread']['forumid'] == 0) {
print_stop_message('please_complete_required_fields');
}
$whereclause = fetch_thread_move_prune_sql($vbulletin->GPC['thread'], $forumids, $vbulletin->GPC['type']);
if ($vbulletin->GPC['type'] == 'move') {
$foruminfo = fetch_foruminfo($vbulletin->GPC['destforumid']);
if (!$foruminfo) {
print_stop_message('invalid_destination_forum_specified');
}
if (!$foruminfo['cancontainthreads'] or $foruminfo['link']) {
print_stop_message('destination_forum_cant_contain_threads');
}
}
$fullquery = "\n\t\tSELECT COUNT(*) AS count\n\t\tFROM " . TABLE_PREFIX . "thread AS thread\n\t\tLEFT JOIN " . TABLE_PREFIX . "forum AS forum ON(forum.forumid = thread.forumid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND deletionlog.type = 'thread')\n\t\tWHERE {$whereclause}\n\t";
$count = $db->query_first($fullquery);
if (!$count['count']) {
print_stop_message('no_threads_matched_your_query');
}
print_form_header('thread', 'dothreadsall');
construct_hidden_code('type', $vbulletin->GPC['type']);
construct_hidden_code('criteria', sign_client_string(serialize($vbulletin->GPC['thread'])));
示例11: array
}
$templater = vB_Template::create('postrelease_vb4_postbits');
$postbits = $templater->render();
}
} else {
if (isset($pr_data)) {
vB_Template::preRegister('postrelease_vb4_postbits_mobile', array('prx_author' => $prx_author));
vB_Template::preRegister('postrelease_vb4_postbits_mobile', array('prx_author_url' => $prx_author_url));
vB_Template::preRegister('postrelease_vb4_postbits_mobile', array('prx_author_img' => $prx_author_img));
vB_Template::preRegister('postrelease_vb4_postbits_mobile', array('prx_title' => $prx_title));
vB_Template::preRegister('postrelease_vb4_postbits_mobile', array('prx_body' => $prx_body));
}
$templater = vB_Template::create('postrelease_vb4_postbits_mobile');
$postbits = $templater->render();
}
$foruminfo = fetch_foruminfo($prx_forum_id);
$navbits = array();
if (SIMPLE_VERSION > 410) {
$navbits[fetch_seo_url('forumhome', array())] = $vbphrase['forum'];
} else {
$navbits[$vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q']] = $vbphrase['forum'];
}
$parentlist = array_reverse(explode(',', substr($foruminfo['parentlist'], 0, -3)));
foreach ($parentlist as $forumID) {
$forumTitle = $vbulletin->forumcache["{$forumID}"]['title'];
$navbits[fetch_seo_url('forum', array('forumid' => $forumID, 'title' => $forumTitle))] = $forumTitle;
}
$navbits[''] = $prx_title;
$navbits = construct_navbits($navbits);
$navbar = render_navbar_template($navbits);
if ($mobile == 0) {
示例12: create_associated_thread
function create_associated_thread($article)
{
$foruminfo = fetch_foruminfo(vB::$vbulletin->options['vbcmsforumid']);
if (!$foruminfo) {
return false;
}
$dataman =& datamanager_init('Thread_FirstPost', vB::$vbulletin, ERRTYPE_ARRAY, 'threadpost');
//$dataman->set('prefixid', $post['prefixid']);
// set info
$dataman->set_info('preview', '');
$dataman->set_info('parseurl', true);
$dataman->set_info('posthash', '');
$dataman->set_info('forum', $foruminfo);
$dataman->set_info('thread', array());
$dataman->set_info('show_title_error', false);
// set options
$dataman->set('showsignature', true);
$dataman->set('allowsmilie', false);
// set data
//title and message are needed for dupcheck later
$title = new vB_Phrase('vbcms', 'comment_thread_title', htmlspecialchars_decode($article->getTitle()));
$message = new vB_Phrase('vbcms', 'comment_thread_firstpost', vBCms_Route_Content::getURL(array('node' => $article->getUrlSegment())));
$dataman->set('userid', $article->getUserId());
$dataman->set('title', $title);
$dataman->set('pagetext', $message);
$dataman->set('iconid', '');
$dataman->set('visible', 1);
$dataman->setr('forumid', $foruminfo['forumid']);
$errors = array();
$dataman->pre_save();
$errors = array_merge($errors, $dataman->errors);
vB_Cache::instance()->event($article->getCacheEvents());
if (sizeof($errors) > 0) {
return false;
}
if (!($id = $dataman->save())) {
throw new vB_Exception_Content('Could not create comments thread for content');
}
return $id;
}
示例13: build_forum_counters
function build_forum_counters($forumid, $censor = false)
{
global $vbulletin;
$forumid = intval($forumid);
$foruminfo = fetch_foruminfo($forumid);
if (!$foruminfo)
{
// prevent fatal errors when a forum doesn't exist
return;
}
require_once(DIR . '/includes/functions_bigthree.php');
$coventry = fetch_coventry('string', true);
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "tachyforumcounter WHERE forumid = $forumid");
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "tachyforumpost WHERE forumid = $forumid");
if ($coventry)
{
// Thread count
$tachy_db = $vbulletin->db->query_read("
SELECT thread.postuserid, COUNT(*) AS threadcount
FROM " . TABLE_PREFIX . "thread AS thread
WHERE thread.postuserid IN ($coventry)
AND thread.visible = 1
AND thread.open <> 10
AND thread.forumid = $forumid
GROUP BY thread.postuserid
");
$tachystats = array();
while ($tachycounter = $vbulletin->db->fetch_array($tachy_db))
{
$tachystats["$tachycounter[postuserid]"]['threads'] = $tachycounter['threadcount'];
}
$tachy_db = $vbulletin->db->query_read("
SELECT post.userid, COUNT(*) AS replycount
FROM " . TABLE_PREFIX . "post AS post
INNER JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
WHERE post.userid IN ($coventry)
AND post.visible = 1
AND thread.forumid = $forumid
GROUP BY post.userid
");
while ($tachycounter = $vbulletin->db->fetch_array($tachy_db))
{
if (!isset($tachystats["$tachycounter[userid]"]))
{
$tachystats["$tachycounter[userid]"]['threads'] = 0;
}
$tachystats["$tachycounter[userid]"]['replies'] = $tachycounter['replycount'];
}
foreach ($tachystats AS $user => $stats)
{
$vbulletin->db->query_write("
REPLACE INTO " . TABLE_PREFIX . "tachyforumcounter
(userid, forumid, threadcount, replycount)
VALUES
(" . intval($user) . ",
" . intval($forumid) . ",
" . intval($stats['threads']) . ",
" . intval($stats['replies']) . ")
");
}
}
$totals = $vbulletin->db->query_first("
SELECT
COUNT(*) AS threads,
SUM(thread.replycount) AS replies
FROM " . TABLE_PREFIX . "thread AS thread
WHERE thread.forumid = $forumid
AND visible = 1
AND open <> 10
" . ($coventry ? " AND thread.postuserid NOT IN ($coventry)" : '')
);
$totals['replies'] += $totals['threads'];
$lastthread = $vbulletin->db->query_first("
SELECT thread.*
FROM " . TABLE_PREFIX . "thread AS thread
WHERE forumid = $forumid
AND visible = 1
AND open <> 10
" . ($coventry ? "AND thread.postuserid NOT IN ($coventry)" : '') ."
ORDER BY lastpost DESC
LIMIT 1
");
if ($coventry)
{
$tachy_posts = array();
//.........这里部分代码省略.........
示例14: createAssociatedThread
/**
* Creates a new thread to use for comments
*
* @param int $forumid - The forum to create the thread in
* @param int $node - The node to associate with the thread
* @return int - The id of the new thread
*/
protected function createAssociatedThread($forumid, $node)
{
$foruminfo = fetch_foruminfo($forumid);
if (!$foruminfo)
{
return false;
}
$dataman =& datamanager_init('Thread_FirstPost', vB::$vbulletin, ERRTYPE_ARRAY, 'threadpost');
//$dataman->set('prefixid', $post['prefixid']);
// set info
$dataman->set_info('preview', '');
$dataman->set_info('parseurl', true);
$dataman->set_info('posthash', '');
$dataman->set_info('forum', $foruminfo);
$dataman->set_info('thread', array());
$dataman->set_info('show_title_error', false);
// set options
$dataman->set('showsignature', true);
$dataman->set('allowsmilie', false);
// set data
//title and message are needed for dupcheck later
$title = new vB_Phrase('vbcms', 'comment_thread_title', htmlspecialchars_decode($node->getTitle()));
$message = new vB_Phrase('vbcms', 'comment_thread_firstpost', $this->getPageURL());
$dataman->set('userid', $node->getUserId());
$dataman->set('title', $title);
$dataman->set('pagetext', $message);
$dataman->set('iconid', '');
$dataman->set('visible', 1);
$dataman->setr('forumid', $foruminfo['forumid']);
$errors = array();
// done!
//($hook = vBulletinHook::fetch_hook('newpost_process')) ? eval($hook) : false;
$dataman->pre_save();
$errors = array_merge($errors, $dataman->errors);
vB_Cache::instance()->event($this->content->getCacheEvents());
if (sizeof($errors) > 0)
{
return false;
}
if (!($id = $dataman->save()))
{
throw (new vB_Exception_Content('Could not create comments thread for content'));
}
return $id;
}
示例15: print_yes_no_row
print_yes_no_row($vbphrase['enabled'], 'enabled', $podcast['enabled']);
print_podcast_chooser($vbphrase['category'], 'categoryid', $podcast['categoryid']);
print_input_row($vbphrase['media_author'] . '<dfn>' . construct_phrase($vbphrase['maximum_chars_x'], 255) . '</dfn>', 'author', $podcast['author']);
print_input_row($vbphrase['owner_name'] . '<dfn>' . construct_phrase($vbphrase['maximum_chars_x'], 255), 'ownername', $podcast['ownername']);
print_input_row($vbphrase['owner_email'] . '<dfn>' . construct_phrase($vbphrase['maximum_chars_x'], 255), 'owneremail', $podcast['owneremail']);
print_input_row($vbphrase['image_url'], 'image', $podcast['image']);
print_input_row($vbphrase['subtitle'] . '<dfn>' . construct_phrase($vbphrase['maximum_chars_x'], 255) . '</dfn>', 'subtitle', $podcast['subtitle']);
print_textarea_row($vbphrase['keywords'] . '<dfn>' . construct_phrase($vbphrase['maximum_chars_x'], 255) . '</dfn>', 'keywords', $podcast['keywords'], 2, 40);
print_textarea_row($vbphrase['summary'] . '<dfn>' . construct_phrase($vbphrase['maximum_chars_x'], 4000) . '</dfn>', 'summary', $podcast['summary'], 4, 40);
print_yes_no_row($vbphrase['explicit'], 'explicit', $podcast['explicit']);
print_submit_row($vbphrase['save']);
}
// ###################### Start add podcast #######################
if ($_POST['do'] == 'updatepodcast') {
$vbulletin->input->clean_array_gpc('p', array('categoryid' => TYPE_UINT, 'explicit' => TYPE_BOOL, 'enabled' => TYPE_BOOL, 'author' => TYPE_STR, 'owneremail' => TYPE_STR, 'ownername' => TYPE_STR, 'image' => TYPE_STR, 'subtitle' => TYPE_STR, 'keywords' => TYPE_STR, 'summary' => TYPE_STR));
if (!($forum = fetch_foruminfo($vbulletin->GPC['forumid'], false))) {
print_stop_message('invalid_forum_specified');
}
require_once DIR . '/includes/adminfunctions_misc.php';
$category = fetch_podcast_categoryarray($vbulletin->GPC['categoryid']);
$db->query_write("\r\n\t\tREPLACE INTO " . TABLE_PREFIX . "podcast (forumid, enabled, categoryid, category, author, image, explicit, keywords, owneremail, ownername, subtitle, summary)\r\n\t\tVALUES (\r\n\t\t\t{$forum['forumid']},\r\n\t\t\t" . intval($vbulletin->GPC['enabled']) . ",\r\n\t\t\t" . $vbulletin->GPC['categoryid'] . ",\r\n\t\t\t'" . $db->escape_string(serialize($category)) . "',\r\n\t\t\t'" . $db->escape_string($vbulletin->GPC['author']) . "',\r\n\t\t\t'" . $db->escape_string($vbulletin->GPC['image']) . "',\r\n\t\t\t" . intval($vbulletin->GPC['explicit']) . ",\r\n\t\t\t'" . $db->escape_string($vbulletin->GPC['keywords']) . "',\r\n\t\t\t'" . $db->escape_string($vbulletin->GPC['owneremail']) . "',\r\n\t\t\t'" . $db->escape_string($vbulletin->GPC['ownername']) . "',\r\n\t\t\t'" . $db->escape_string($vbulletin->GPC['subtitle']) . "',\r\n\t\t\t'" . $db->escape_string($vbulletin->GPC['summary']) . "'\r\n\t\t)\r\n\t");
build_forum_permissions();
define('CP_REDIRECT', 'forum.php?do=modify');
print_stop_message('updated_podcast_settings_successfully');
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 23:48, Wed Mar 24th 2010
|| # CVS: $RCSfile$ - $Revision: 35469 $
|| ####################################################################