本文整理汇总了PHP中construct_folder_jump函数的典型用法代码示例。如果您正苦于以下问题:PHP construct_folder_jump函数的具体用法?PHP construct_folder_jump怎么用?PHP construct_folder_jump使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了construct_folder_jump函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: implode
$bccrecipients = implode(', ', $bcclist);
}
}
$show['recipients'] = true;
}
// generate navbar
$navbits['private.php?' . $vbulletin->session->vars['sessionurl'] . "folderid={$pm['folderid']}"] = $foldernames["{$pm['folderid']}"];
$navbits[''] = $pm['title'];
$templatename = 'pm_showpm';
}
// ############################### start pm folder view ###############################
if ($_REQUEST['do'] == 'messagelist') {
$vbulletin->input->clean_array_gpc('r', array('folderid' => TYPE_INT, 'perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT));
($hook = vBulletinHook::fetch_hook('private_messagelist_start')) ? eval($hook) : false;
$folderid = $vbulletin->GPC['folderid'];
$folderjump = construct_folder_jump(0, $vbulletin->GPC['folderid']);
$foldername = $foldernames["{$vbulletin->GPC['folderid']}"];
// count receipts
$receipts = $db->query_first_slave("\n\t\tSELECT\n\t\t\tSUM(IF(readtime <> 0, 1, 0)) AS confirmed,\n\t\t\tSUM(IF(readtime = 0, 1, 0)) AS unconfirmed\n\t\tFROM " . TABLE_PREFIX . "pmreceipt\n\t\tWHERE userid = " . $vbulletin->userinfo['userid']);
// get ignored users
$ignoreusers = preg_split('#\\s+#s', $vbulletin->userinfo['ignorelist'], -1, PREG_SPLIT_NO_EMPTY);
$totalmessages = intval($messagecounters["{$vbulletin->GPC['folderid']}"]);
// build pm counters bar, folder is 100 if we have no quota so red shows on the main bar
$tdwidth = array();
$tdwidth['folder'] = $permissions['pmquota'] ? ceil($totalmessages / $permissions['pmquota'] * 100) : 100;
$tdwidth['total'] = $permissions['pmquota'] ? ceil($vbulletin->userinfo['pmtotal'] / $permissions['pmquota'] * 100) - $tdwidth['folder'] : 0;
$tdwidth['quota'] = 100 - $tdwidth['folder'] - $tdwidth['total'];
$show['thisfoldertotal'] = iif($tdwidth['folder'], true, false);
$show['allfolderstotal'] = iif($tdwidth['total'], true, false);
$show['pmicons'] = iif($vbulletin->options['privallowicons'], true, false);
// build navbar
示例2: process_replacement_vars
$threadpms .= $postbit_obj->construct_postbit($threadpm);
}
} else {
$threadpms = vB_Template::create('pm_nomessagehistory')->render();
}
$xml->add_tag('html', process_replacement_vars($threadpms));
}
$xml->close_group();
$xml->print_xml(true);
}
// ############################### start pm folder view ###############################
if ($_REQUEST['do'] == 'messagelist') {
$vbulletin->input->clean_array_gpc('r', array('folderid' => TYPE_INT, 'perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT));
($hook = vBulletinHook::fetch_hook('private_messagelist_start')) ? eval($hook) : false;
$folderid = $vbulletin->GPC['folderid'];
$folderjump = construct_folder_jump(0, $vbulletin->GPC['folderid'], false, '', true);
$foldername = $foldernames["{$vbulletin->GPC['folderid']}"]['name'];
// count receipts
$receipts = $db->query_first_slave("\n\t\tSELECT\n\t\t\tSUM(IF(readtime <> 0, 1, 0)) AS confirmed,\n\t\t\tSUM(IF(readtime = 0, 1, 0)) AS unconfirmed\n\t\tFROM " . TABLE_PREFIX . "pmreceipt\n\t\tWHERE userid = " . $vbulletin->userinfo['userid']);
// get ignored users
$ignoreusers = preg_split('#\\s+#s', $vbulletin->userinfo['ignorelist'], -1, PREG_SPLIT_NO_EMPTY);
$totalmessages = intval($messagecounters["{$vbulletin->GPC['folderid']}"]);
// build pm counters bar, folder is 100 if we have no quota so red shows on the main bar
$tdwidth = array();
$tdwidth['folder'] = $permissions['pmquota'] ? ceil($totalmessages / $permissions['pmquota'] * 100) : 100;
$tdwidth['folder'] = min($tdwidth['folder'], 100);
$totalWidth = $permissions['pmquota'] && $vbulletin->userinfo['pmtotal'] / $permissions['pmquota'] < 1 ? $vbulletin->userinfo['pmtotal'] / $permissions['pmquota'] : 1;
$tdwidth['total'] = $permissions['pmquota'] ? ceil($totalWidth * 100) - $tdwidth['folder'] : 0;
$tdwidth['quota'] = 100 - $tdwidth['folder'] - $tdwidth['total'];
$show['thisfoldertotal'] = iif($tdwidth['folder'], true, false);
$show['allfolderstotal'] = iif($tdwidth['total'], true, false);
示例3: do_get_subscriptions
function do_get_subscriptions()
{
global $vbulletin, $db, $show, $vbphrase, $permissions, $subscribecounters;
$vbulletin->options['threadpreview'] = FR_PREVIEW_LEN;
if (!$vbulletin->userinfo['userid']) {
json_error(ERR_NO_PERMISSION);
}
if (!$vbulletin->userinfo['userid'] and $_REQUEST['do'] != 'removesubscription' or $vbulletin->userinfo['userid'] and !($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']) or $vbulletin->userinfo['usergroupid'] == 4 or !($permissions['genericoptions'] & $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'])) {
json_error(ERR_NO_PERMISSION);
}
$thread_data = array();
$unread_subs = 0;
// vbulletin expects folderid, but we will just get them all
$vbulletin->input->clean_array_gpc('r', array('folderid' => TYPE_NOHTML, 'perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT, 'sortfield' => TYPE_NOHTML, 'sortorder' => TYPE_NOHTML, 'previewtype' => TYPE_INT));
$previewtype = $vbulletin->GPC['previewtype'];
if (!$previewtype) {
$previewtype = 1;
}
$vbulletin->GPC['folderid'] = 'all';
// Values that are reused in templates
$sortfield =& $vbulletin->GPC['sortfield'];
$perpage =& $vbulletin->GPC['perpage'];
$pagenumber =& $vbulletin->GPC['pagenumber'];
$folderid =& $vbulletin->GPC['folderid'];
if ($folderid == 'all') {
$getallfolders = true;
$show['allfolders'] = true;
} else {
$folderid = intval($folderid);
}
$folderselect["{$folderid}"] = 'selected="selected"';
// Build folder jump
require_once DIR . '/includes/functions_misc.php';
$folders = construct_folder_jump(1, $folderid, false, '', true);
$templater = vB_Template::create('subscribe_folder_jump');
$templater->register('folders', $folders);
$folderjump = $templater->render();
// look at sorting options:
if ($vbulletin->GPC['sortorder'] != 'asc') {
$vbulletin->GPC['sortorder'] = 'desc';
$sqlsortorder = 'DESC';
$order = array('desc' => 'selected="selected"');
} else {
$sqlsortorder = '';
$order = array('asc' => 'selected="selected"');
}
switch ($sortfield) {
case 'title':
case 'lastpost':
case 'replycount':
case 'views':
case 'postusername':
$sqlsortfield = 'thread.' . $sortfield;
break;
default:
$handled = false;
if (!$handled) {
$sqlsortfield = 'thread.lastpost';
$sortfield = 'lastpost';
}
}
$sort = array($sortfield => 'selected="selected"');
if ($getallfolders) {
$totalallthreads = array_sum($subscribecounters);
} else {
$totalallthreads = $subscribecounters["{$folderid}"];
}
// set defaults
sanitize_pageresults($totalallthreads, $pagenumber, $perpage, 200, $vbulletin->options['maxthreads']);
// display threads
$limitlower = ($pagenumber - 1) * $perpage + 1;
$limitupper = $pagenumber * $perpage;
if ($limitupper > $totalallthreads) {
$limitupper = $totalallthreads;
if ($limitlower > $totalallthreads) {
$limitlower = $totalallthreads - $perpage;
}
}
if ($limitlower <= 0) {
$limitlower = 1;
}
$hook_query_fields = $hook_query_joins = $hook_query_where = '';
$getthreads = $db->query_read_slave("\n\t\tSELECT thread.threadid, emailupdate, subscribethreadid, thread.forumid, thread.postuserid\n\t\t\t{$hook_query_fields}\n\t\tFROM " . TABLE_PREFIX . "subscribethread AS subscribethread\n\t\tLEFT JOIN " . TABLE_PREFIX . "thread AS thread ON(thread.threadid = subscribethread.threadid)\n\t\t{$hook_query_joins}\n\t\tWHERE subscribethread.userid = " . $vbulletin->userinfo['userid'] . "\n\t\t\tAND thread.visible = 1\n\t\t\tAND canview = 1\n\t\t" . iif(!$getallfolders, "\tAND folderid = {$folderid}") . "\n\t\t\t{$hook_query_where}\n\t\tORDER BY {$sqlsortfield} {$sqlsortorder}\n\t\tLIMIT " . ($limitlower - 1) . ", {$perpage}\n\t");
if ($totalthreads = $db->num_rows($getthreads)) {
$forumids = array();
$threadids = array();
$emailupdate = array();
$killthreads = array();
while ($getthread = $db->fetch_array($getthreads)) {
$forumperms = fetch_permissions($getthread['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) or $getthread['postuserid'] != $vbulletin->userinfo['userid'] and !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'])) {
$killthreads["{$getthread['subscribethreadid']}"] = $getthread['subscribethreadid'];
$totalallthreads--;
continue;
}
$forumids["{$getthread['forumid']}"] = true;
$threadids[] = $getthread['threadid'];
$emailupdate["{$getthread['threadid']}"] = $getthread['emailupdate'];
$subscribethread["{$getthread['threadid']}"] = $getthread['subscribethreadid'];
}
//.........这里部分代码省略.........
示例4: array
case 'move':
$ids = array();
foreach ($deletebox as $id) {
$id = intval($id);
$ids["{$id}"] = $id;
}
$numthreads = sizeof($ids);
$ids = sign_client_string(serialize($ids));
unset($id, $deletebox);
require_once DIR . '/includes/functions_misc.php';
if ($vbulletin->GPC['folderid'] === 'all') {
$exclusions = false;
} else {
$exclusions = array($vbulletin->GPC['folderid'], -1);
}
$folderoptions = construct_folder_jump(1, 0, $exclusions);
($hook = vBulletinHook::fetch_hook('usersub_manage_move')) ? eval($hook) : false;
if ($folderoptions) {
if ($vbulletin->GPC['folderid'] === 'all') {
$fromfolder = $vbphrase['all'];
} else {
$folders = unserialize($vbulletin->userinfo['subfolders']);
$fromfolder = $folders["{$vbulletin->GPC['folderid']}"];
}
// build the cp nav
construct_usercp_nav('substhreads_listthreads');
$navbits[''] = $vbphrase['subscriptions'];
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
$folderid =& $vbulletin->GPC['folderid'];
eval('$HTML = "' . fetch_template('subscribe_move') . '";');
示例5: fetch_emailchecked
if ($edit['emailupdate'] !== NULL) {
$folderselect["{$edit['folderid']}"] = 'selected="selected"';
$emailchecked["{$edit['emailupdate']}"] = 'selected="selected"';
} else {
if ($threadinfo['issubscribed']) {
$folderselect["{$threadinfo['folderid']}"] = 'selected="selected"';
} else {
$folderselect[0] = 'selected="selected"';
}
// get the checked option for auto subscription
$emailchecked = fetch_emailchecked($threadinfo);
}
// Don't show the folderjump if we only have one folder, would be redundant ;)
if (sizeof($folders) > 1) {
require_once DIR . '/includes/functions_misc.php';
$folderbits = construct_folder_jump(1, $threadinfo['folderid'], false, $folders);
$show['subscriptionfolders'] = true;
}
if ($previewpost or $vbulletin->GPC['advanced']) {
$newpost['reason'] = $edit['reason'];
} else {
if ($vbulletin->userinfo['userid'] == $postinfo['edit_userid']) {
// Only carry the reason over if the editing user owns the previous edit
$newpost['reason'] = $postinfo['edit_reason'];
}
}
$postinfo['postdate'] = vbdate($vbulletin->options['dateformat'], $postinfo['dateline']);
$postinfo['posttime'] = vbdate($vbulletin->options['timeformat'], $postinfo['dateline']);
// find out if first post
$getpost = $db->query_first("\n\t\tSELECT postid\n\t\tFROM " . TABLE_PREFIX . "post\n\t\tWHERE threadid = {$threadinfo['threadid']}\n\t\tORDER BY dateline\n\t\tLIMIT 1\n\t");
if ($getpost['postid'] == $postinfo['postid']) {
示例6: iif
}
if (!isset($checked['postpoll'])) {
$checked['postpoll'] = '';
}
if (!isset($newpost['polloptions'])) {
$polloptions = 4;
} else {
$polloptions = $newpost['polloptions'];
}
// Get subscribed thread folders
$newpost['folderid'] = iif($newpost['folderid'], $newpost['folderid'], 0);
$folders = unserialize($vbulletin->userinfo['subfolders']);
// Don't show the folderjump if we only have one folder, would be redundant ;)
if (sizeof($folders) > 1) {
require_once DIR . '/includes/functions_misc.php';
$folderbits = construct_folder_jump(1, $newpost['folderid'], false, $folders);
}
$show['subscribefolders'] = iif(!empty($folderbits), true, false);
// get the checked option for auto subscription
$emailchecked = fetch_emailchecked($threadinfo, $vbulletin->userinfo, $newpost);
if ($emailchecked['9999']) {
$emailchecked['0'] = $emailchecked['9999'];
unset($emailchecked['9999']);
$checked['subscribe'] = '';
} else {
$checked['subscribe'] = 'checked="checked"';
}
if ($foruminfo['allowhtml']) {
if (!isset($htmlchecked)) {
$htmlchecked = array('on_nl2br' => 'selected="selected"');
}
示例7: unserialize
if ($threadinfo['issubscribed'])
{
$folderid = $threadinfo['folderid'];
}
else
{
$folderid = 0;
}
}
$folders = unserialize($vbulletin->userinfo['subfolders']);
// Don't show the folderjump if we only have one folder, would be redundant ;)
if (sizeof($folders) > 1)
{
require_once(DIR . '/includes/functions_misc.php');
$folderbits = construct_folder_jump(1, $folderid, false, $folders);
}
$show['subscribefolders'] = iif(!empty($folderbits), true, false);
// get the checked option for auto subscription
$emailchecked = fetch_emailchecked($threadinfo, $vbulletin->userinfo, $newpost);
if ($emailchecked['9999'])
{
$emailchecked['0'] = $emailchecked['9999'];
unset($emailchecked['9999']);
$checked['subscribe'] = '';
}
else
{
$checked['subscribe'] = 'checked="checked"';
}
示例8: do_get_pm
function do_get_pm()
{
global $vbulletin, $db;
require_once DIR . '/includes/class_postbit.php';
require_once DIR . '/includes/functions_bigthree.php';
$vbulletin->input->clean_array_gpc('r', array('pmid' => TYPE_UINT, 'showhistory' => TYPE_BOOL));
($hook = vBulletinHook::fetch_hook('private_showpm_start')) ? eval($hook) : false;
$pm = $db->query_first_slave("\n\t\tSELECT\n\t\t\tpm.*, pmtext.*,\n\t\t\t" . iif($vbulletin->options['privallowicons'], "icon.title AS icontitle, icon.iconpath,") . "\n\t\t\tIF(ISNULL(pmreceipt.pmid), 0, 1) AS receipt, pmreceipt.readtime, pmreceipt.denied,\n\t\t\tsigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight\n\t\tFROM " . TABLE_PREFIX . "pm AS pm\n\t\tLEFT JOIN " . TABLE_PREFIX . "pmtext AS pmtext ON(pmtext.pmtextid = pm.pmtextid)\n\t\t" . iif($vbulletin->options['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "\n\t\tLEFT JOIN " . TABLE_PREFIX . "pmreceipt AS pmreceipt ON(pmreceipt.pmid = pm.pmid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "sigpic AS sigpic ON(sigpic.userid = pmtext.fromuserid)\n\t\tWHERE pm.userid=" . $vbulletin->userinfo['userid'] . " AND pm.pmid=" . $vbulletin->GPC['pmid'] . "\n\t");
if (!$pm) {
json_error(strip_tags(fetch_error('invalidid', $vbphrase['private_message'], $vbulletin->options['contactuslink'])));
}
$folderjump = construct_folder_jump(0, $pm['folderid']);
// do read receipt
$show['receiptprompt'] = $show['receiptpopup'] = false;
if ($pm['receipt'] == 1 and $pm['readtime'] == 0 and $pm['denied'] == 0) {
if ($permissions['pmpermissions'] & $vbulletin->bf_ugp_pmpermissions['candenypmreceipts']) {
// set it to denied just now as some people might have ad blocking that stops the popup appearing
$show['receiptprompt'] = $show['receiptpopup'] = true;
$receipt_question_js = addslashes_js(construct_phrase($vbphrase['x_has_requested_a_read_receipt'], unhtmlspecialchars($pm['fromusername'])), '"');
$db->shutdown_query("UPDATE " . TABLE_PREFIX . "pmreceipt SET denied = 1 WHERE pmid = {$pm['pmid']}");
} else {
// they can't deny pm receipts so do not show a popup or prompt
$db->shutdown_query("UPDATE " . TABLE_PREFIX . "pmreceipt SET readtime = " . TIMENOW . " WHERE pmid = {$pm['pmid']}");
}
} else {
if ($pm['receipt'] == 1 and $pm['denied'] == 1) {
$show['receiptprompt'] = true;
}
}
$postbit_factory = new vB_Postbit_Factory();
$postbit_factory->registry =& $vbulletin;
$postbit_factory->cache = array();
$postbit_factory->bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$postbit_obj =& $postbit_factory->fetch_postbit('pm');
$pm_postbit = $pm;
$postbit = $postbit_obj->construct_postbit($pm_postbit);
// update message to show read
if ($pm['messageread'] == 0) {
$db->shutdown_query("UPDATE " . TABLE_PREFIX . "pm SET messageread=1 WHERE userid=" . $vbulletin->userinfo['userid'] . " AND pmid={$pm['pmid']}");
if ($pm['folderid'] >= 0) {
$userdm =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
$userdm->set_existing($vbulletin->userinfo);
$userdm->set('pmunread', 'IF(pmunread >= 1, pmunread - 1, 0)', false);
$userdm->save(true, true);
unset($userdm);
}
}
$cclist = array();
$bcclist = array();
$ccrecipients = '';
$bccrecipients = '';
$touser = unserialize($pm['touserarray']);
if (!is_array($touser)) {
$touser = array();
}
foreach ($touser as $key => $item) {
if (is_array($item)) {
foreach ($item as $subkey => $subitem) {
$userinfo = array('userid' => $subkey, 'username' => $subitem);
$templater = vB_Template::create('pm_messagelistbit_user');
$templater->register('userinfo', $userinfo);
${$key . 'list'}[] = $templater->render();
}
} else {
$userinfo = array('username' => $item, 'userid' => $key);
$templater = vB_Template::create('pm_messagelistbit_user');
$templater->register('userinfo', $userinfo);
$bcclist[] = $templater->render();
}
}
if (count($cclist) > 1 or is_array($touser['cc']) and !in_array($vbulletin->userinfo['username'], $touser['cc']) or $vbulletin->userinfo['userid'] == $pm['fromuserid'] and $pm['folderid'] == -1) {
if (!empty($cclist)) {
$ccrecipients = implode("\r\n", $cclist);
}
if (!empty($bcclist) and $vbulletin->userinfo['userid'] == $pm['fromuserid'] and $pm['folderid'] == -1) {
if (empty($cclist) and count($bcclist == 1)) {
$ccrecipients = implode("\r\n", $bcclist);
} else {
$bccrecipients = implode("\r\n", $bcclist);
}
}
$show['recipients'] = true;
}
$pm['senddate'] = vbdate($vbulletin->options['dateformat'], $pm['dateline']);
$pm['sendtime'] = vbdate($vbulletin->options['timeformat'], $pm['dateline']);
list($text, $nuked_quotes, $images) = parse_post($pm['message'], $vbulletin->options['privallowsmilies'] && $usesmiles);
$fr_images = array();
foreach ($images as $image) {
$fr_images[] = array('img' => $image);
}
// Avatar work
$avatarurl = '';
if ($pm_postbit['avatarurl']) {
$avatarurl = process_avatarurl($pm_postbit['avatarurl']);
}
$to_users = unserialize($pm['touserarray']);
$users = array();
if ($to_users !== false) {
if ($to_users['cc']) {
$users = $to_users['cc'];
//.........这里部分代码省略.........