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


PHP render_navbar_template函数代码示例

本文整理汇总了PHP中render_navbar_template函数的典型用法代码示例。如果您正苦于以下问题:PHP render_navbar_template函数的具体用法?PHP render_navbar_template怎么用?PHP render_navbar_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: eval

		eval(standard_error(fetch_error('invalidid', $vbphrase['message'], $vbulletin->options['contactuslink'])));
	}

	($hook = vBulletinHook::fetch_hook('report_start')) ? eval($hook) : false;

	if ($_REQUEST['do'] == 'report')
	{
		// draw nav bar
		$navbits = array();
		$navbits[fetch_seo_url('member', $userinfo)] = $userinfo['username'];
		$navbits[''] = $vbphrase['report_bad_visitor_message'];
		$navbits = construct_navbits($navbits);

		$usernamecode = vB_Template::create('newpost_usernamecode')->render();

		$navbar = render_navbar_template($navbits);
		$url =& $vbulletin->url;

		($hook = vBulletinHook::fetch_hook('report_form_start')) ? eval($hook) : false;

		$forminfo = $reportobj->set_forminfo($messageinfo);
		$templater = vB_Template::create('reportitem');
			$templater->register_page_templates();
			$templater->register('forminfo', $forminfo);
			$templater->register('navbar', $navbar);
			$templater->register('url', $url);
			$templater->register('usernamecode', $usernamecode);
		print_output($templater->render());
	}

	if ($_POST['do'] == 'sendemail')
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:visitormessage.php

示例2: do_intro


//.........这里部分代码省略.........
	}

	search_intro_register_prefs($template, $prefs);
	vB_Search_Searchtools::searchIntroRegisterHumanVerify($template);

	//actually render any errors.
	search_intro_register_errors($template, $errors);
	$show['errors'] = !empty($errors);
	$show['tag_option'] = $vbulletin->options['threadtagging'];

	//check to see if we have a preferred type
	$defaulttype = null;

	if ($prefs['type'])
	{
		if (is_array($prefs['type']))
		{
			$defaulttype = $prefs['type'][0];
		}
		else
		{
			$defaulttype = $prefs['type'];
		}
	}

	if ($vbulletin->GPC['contenttypeid'])
	{
		$defaulttype = $vbulletin->GPC['contenttypeid'];
	}

	//If we have nothing else, let's show Posts
	if ($defaulttype == null)
	{
		$defaulttype = vB_Search_Core::get_instance()->get_contenttypeid('vBForum', 'Post');
	}

	//If we have the common type, set to the default
	if ($search_type instanceof vBForum_Search_Type_Common)
	{
		unset($search_type);
		$search_type = vb_Search_Core::get_instance()->get_search_type_from_id($defaulttype);
		$prefs = vB_Search_Searchtools::searchIntroFetchPrefs($user, $defaulttype);
	}

	if ($vbulletin->GPC['search_type'] )
	{
		$template->register('input_search_types', vB_Search_Searchtools::listSearchable('vb_search_params',
			 'search.php', $prefs, $defaulttype));

		if (intval($vbulletin->GPC['contenttypeid']) OR $defaulttype)
		{
			$template->register('search_ui', $search_type->listUi($prefs,
				intval($vbulletin->GPC['contenttypeid']) ?
				$vbulletin->GPC['contenttypeid'] : $defaulttype));
		}
	}
	else if (isset($vbulletin->GPC['searchfromtype'])
		AND strlen($vbulletin->GPC['searchfromtype']) > 6)
	{
		$template->register('input_search_types', vB_Search_Searchtools::listSearchable('vb_search_params',
			 'search.php', $prefs, $defaulttype));
		$search_type = explode(':', $vbulletin->GPC['searchfromtype'], 2);

		if (count($search_type) == 2)
		{
			$search_type = vb_Search_Core::get_instance()->get_search_type($search_type[0], $search_type[1]);
		}
		else if (intval($vbulletin->GPC['contenttypeid']))
		{
			$search_type = vb_Search_Core::get_instance()->get_search_type_from_id($vbulletin->GPC['contenttypeid']);
		}
		if (isset($search_type))
		{
			$template->register('search_ui', $search_type->listUi($prefs,
				$search_type->get_contenttypeid()));
		}
	}

	$template->register('sessionhash', $sessionhash);
	search_intro_register_tagcloud($template);

	if ($vbulletin->debug)
	{
		$show['nocache'] = true;
	}

	// unlink the 'search' part of the navbits
	array_pop($navbits);
	$navbits[''] = $vbphrase['advanced_search'];
	($hook = vBulletinHook::fetch_hook('search_intro')) ? eval($hook) : false;

	//finish off search
	($hook = vBulletinHook::fetch_hook('search_complete')) ? eval($hook) : false;

	$template->register('show', $show);
	$template->register('navbar', render_navbar_template(construct_navbits($navbits)));
	$template->register_page_templates();

	print_output($template->render());
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:search.php

示例3: standard_error

/**
* Halts execution and shows the specified error message
*
* @param	string	Error message
* @param	string	Optional HTML code to insert in the <head> of the error page
* @param	boolean	If true, set the visitor's status on WOL to error page
* @param	string	Optional template to force the display to use. Ignored if showing a lite error
*/
function standard_error($error = '', $headinsert = '', $savebadlocation = true, $override_template = '')
{
	global $header, $footer, $headinclude, $forumjump, $timezone, $gobutton;
	global $vbulletin, $vbphrase, $template_hook;
	global $pmbox, $show, $ad_location, $notifications_menubits, $notifications_total;

	$show['notices'] = false;

	construct_quick_nav(array(), -1, true, true);

	$title = $vbulletin->options['bbtitle'];
	$pagetitle =& $title;
	$errormessage = $error;

	if (!$vbulletin->userinfo['badlocation'] AND $savebadlocation)
	{
		$vbulletin->userinfo['badlocation'] = 3;
	}
	require_once(DIR . '/includes/functions_misc.php');
	if ($_POST['securitytoken'] OR $vbulletin->GPC['postvars'])
	{
		$postvars = construct_post_vars_html();
		if ($vbulletin->GPC['postvars'])
		{
			$_postvars = @unserialize(verify_client_string($vbulletin->GPC['postvars']));
			if ($_postvars['securitytoken'] = 'guest')
			{
				unset($$postvars);
			}
		}
		else if ($_POST['securitytoken'] == 'guest')
		{
			unset($postvars);
		}
	}
	else
	{
		$postvars = '';
	}

	if (defined('VB_ERROR_PERMISSION') AND VB_ERROR_PERMISSION == true)
	{
		$show['permission_error'] = true;
	}
	else
	{
		$show['permission_error'] = false;
	}

	$show['search_noindex'] = (bool)($vbulletin->userinfo['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']);

	$navbits = $navbar = '';
	if (defined('VB_ERROR_LITE') AND VB_ERROR_LITE == true)
	{
		$templatename = 'STANDARD_ERROR_LITE';
		define('NOPMPOPUP', 1); // No Footer here
	}
	else
	{
		// bug 33454: we used to not register the navbar when users did not have general forum permissions (banned)
		// but that was causing display issues with the vb4 style, so now we always render navbar
		$navbits = construct_navbits(array('' => $vbphrase['vbulletin_message']));
		$navbar = render_navbar_template($navbits);

		$templatename = ($override_template ? preg_replace('#[^a-z0-9_]#i', '', $override_template) : 'STANDARD_ERROR');
	}

	($hook = vBulletinHook::fetch_hook('error_generic')) ? eval($hook) : false;

	if ($vbulletin->GPC['ajax'])
	{
		require_once(DIR . '/includes/class_xml.php');
		$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
		$xml->add_tag('error', $errormessage);
		$xml->print_xml();
		exit;
	}
	else
	{
		if ($vbulletin->noheader)
		{
			@header('Content-Type: text/html' . ($vbulletin->userinfo['lang_charset'] != '' ? '; charset=' . $vbulletin->userinfo['lang_charset'] : ''));
		}

		$templater = vB_Template::create($templatename);
			$templater->register_page_templates();
			$templater->register('errormessage', $errormessage);
			$templater->register('forumjump', $forumjump);
			$templater->register('headinsert', $headinsert);
			$templater->register('navbar', $navbar);
			$templater->register('pagetitle', $pagetitle);
			$templater->register('postvars', $postvars);
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:functions.php

示例4: eval

if ($vbulletin->options['enablesidebar'] AND !(is_browser('ie') AND !is_browser('ie', 7)))
{
	$blockmanager = vB_BlockManager::create($vbulletin);
	$sidebar = $blockmanager->getSidebarHTML();
	if ($sidebar)
	{
		$show['sidebar'] = true;
	}

	$show['sidebarposition'] = vB_Template_Runtime::fetchStyleVar($vbulletin->options['sidebarposition'] == 0 ? 'left' : 'right');
}

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
($hook = vBulletinHook::fetch_hook('forumhome_complete')) ? eval($hook) : false;

$navbar = render_navbar_template(construct_navbits($navbits));
$templater = vB_Template::create('FORUMHOME');
	$templater->register_page_templates();
	$templater->register('activemembers', $activemembers);
	$templater->register('activeusers', $activeusers);
	$templater->register('ad_location', $ad_location);
	$templater->register('birthdays', $birthdays);
	$templater->register('forumbits', $forumbits);
	$templater->register('forumhome_markread_script', $forumhome_markread_script);
	$templater->register('navbar', $navbar);
	$templater->register('newuserinfo', $newuserinfo);
	$templater->register('numberguest', $numberguest);
	$templater->register('numbermembers', $numbermembers);
	$templater->register('numberregistered', $numberregistered);
	$templater->register('recorddate', $recorddate);
	$templater->register('recordtime', $recordtime);
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:forum.php

示例5: showpage

	public function showpage($pagenumber, $perpage, $base, $navbits, $print_output = true)
	{
		global $vbulletin;
		global $show;
		$errors = array();
		($hook = vBulletinHook::fetch_hook('search_before_process')) ? eval($hook) : false;

		$perpage = fetch_perpage($perpage, $this->maxpagesize, $vbulletin->options['searchperpage']);
		$pagenumber = max(intval($pagenumber), 1);

		if (!$this->results)
		{
			eval(standard_error(fetch_error('searchnoresults', $displayCommon), '', false));
		}
		$page_results = $this->results->get_page($pagenumber, $perpage, $this->window);

		if (!$page_results)
		{
			eval(standard_error(fetch_error('searchnoresults', $displayCommon), '', false));
		}
		$criteria = $this->results->get_criteria();
		//When we have better template features, the display strings should be passed as
		//an array to the template and handled there.
		$this->template->register('criteriaDisplay', implode('; ', $criteria->get_display_strings()));
		$this->template->register('displayCommon', $criteria->get_common_words_string());

		$this->render_searchbits($page_results);
		$show['results'] = (bool) count($page_results);

		($hook = vBulletinHook::fetch_hook('search_complete')) ? eval($hook) : false;

		//figure searchtime -- time it took to run the search in seconds
		$this->template->register('searchtime', $this->results->get_searchtime());

		//"searchminutes" in the template is minutes since the search was generated.
		$sincegenerated = floor((TIMENOW - $this->results->get_dateline()) / 60);

		if ($sincegenerated >= 1)
		{
			$this->template->register('searchminutes', $sincegenerated);
			$show['generated'] = true;
		}

		$search['showposts'] = true;

		$pagenav = construct_window_page_nav($pagenumber, $this->window, $perpage,
			$this->results->get_confirmed_count(),	$base);

		$this->template->register('navbar', render_navbar_template(construct_navbits($navbits)));
		$this->template->register('base', $base);
		$startat = ($pagenumber-1) * $perpage;
		$this->template->register('first', $startat + 1);
		$this->template->register('last', $startat + count($page_results));
		$this->template->register('total', $this->results->get_confirmed_count());
		$this->template->register('search', $search);
		$this->template->register('pagenav', $pagenav);
		$this->template->register('show', $show);
		$this->template->register('search_back_url', $criteria->get_url());
		$this->template->register_page_templates();
		
		if ($print_output)
		{
			print_output($this->template->render());
		}
		else
		{
			return $this->template->render();
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:69,代码来源:resultsview.php

示例6: do_get_forum

function do_get_forum()
{
    global $vbulletin, $db, $show, $vbphrase, $foruminfo;
    $canpost = true;
    $vbulletin->input->clean_array_gpc('r', array('fid' => TYPE_INT, 'previewtype' => TYPE_INT));
    $previewtype = $vbulletin->GPC['previewtype'];
    if (!$previewtype) {
        $previewtype = 1;
    }
    if (empty($foruminfo['forumid'])) {
        $forumid = -1;
    } else {
        $vbulletin->input->clean_array_gpc('r', array('password' => TYPE_STR));
        // Check the forum password
        if ($vbulletin->GPC['password'] && $foruminfo['password'] == $vbulletin->GPC['password']) {
            // Set a temp cookie for guests
            if (!$vbulletin->userinfo['userid']) {
                set_bbarray_cookie('forumpwd', $foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['password']));
            } else {
                set_bbarray_cookie('forumpwd', $foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['password']), 1);
            }
        }
        $perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT);
        $pagenumber = $vbulletin->input->clean_gpc('r', 'pagenumber', TYPE_UINT);
        $daysprune = $vbulletin->input->clean_gpc('r', 'daysprune', TYPE_INT);
        $sortfield = $vbulletin->input->clean_gpc('r', 'sortfield', TYPE_STR);
        // get permission to view forum
        $_permsgetter_ = 'forumdisplay';
        $forumperms = fetch_permissions($foruminfo['forumid']);
        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])) {
            json_error(ERR_NO_PERMISSION);
        }
        // Check for forum password!
        if (!verify_forum_password($foruminfo['forumid'], $foruminfo['password'], false)) {
            json_error(ERR_NEED_PASSWORD, RV_NEED_FORUM_PASSWORD);
        }
        // Can we post in this forum?
        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostnew'])) {
            $canpost = false;
        }
        $forumid = $foruminfo['forumid'];
    }
    // Can forum contain threads?
    $announcements_out = array();
    // These $_REQUEST values will get used in the sort template so they are assigned to normal variables
    $perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT);
    $pagenumber = $vbulletin->input->clean_gpc('r', 'pagenumber', TYPE_UINT);
    $daysprune = $vbulletin->input->clean_gpc('r', 'daysprune', TYPE_INT);
    $sortfield = $vbulletin->input->clean_gpc('r', 'sortfield', TYPE_STR);
    // get permission to view forum
    $_permsgetter_ = 'forumdisplay';
    $forumperms = fetch_permissions($foruminfo['forumid']);
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])) {
        json_error(ERR_NO_PERMISSION);
    }
    // disable thread preview if we can't view threads
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) {
        $vbulletin->options['threadpreview'] = 0;
    }
    // check if there is a forum password and if so, ensure the user has it set
    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
    // verify that we are at the canonical SEO url
    // and redirect to this if not
    //verify_seo_url('forum', $foruminfo, array('pagenumber' => $_REQUEST['pagenumber']));
    // get vbulletin->iforumcache - for use by makeforumjump and forums list
    // fetch the forum even if they are invisible since its needed
    // for the title but we'll unset that further down
    // also fetch subscription info for $show['subscribed'] variable
    cache_ordered_forums(1, 1, $vbulletin->userinfo['userid']);
    $show['newthreadlink'] = iif(!$show['search_engine'] and $foruminfo['allowposting'], true, false);
    $show['threadicons'] = iif($foruminfo['allowicons'], true, false);
    $show['threadratings'] = iif($foruminfo['allowratings'], true, false);
    $show['subscribed_to_forum'] = $vbulletin->forumcache["{$foruminfo['forumid']}"]['subscribeforumid'] != '' ? true : false;
    if (!$daysprune) {
        if ($vbulletin->userinfo['daysprune']) {
            $daysprune = $vbulletin->userinfo['daysprune'];
        } else {
            $daysprune = iif($foruminfo['daysprune'], $foruminfo['daysprune'], 30);
        }
    }
    $daysprune = -1;
    // FRNR
    // ### GET FORUMS, PERMISSIONS, MODERATOR iCACHES ########################
    cache_moderators();
    // draw nav bar
    $navbits = array();
    $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;
    }
    // pop the last element off the end of the $nav array so that we can show it without a link
    array_pop($navbits);
    $navbits[''] = $foruminfo['title'];
    $navbits = construct_navbits($navbits);
    $navbar = render_navbar_template($navbits);
    $moderatorslist = '';
    $listexploded = explode(',', $foruminfo['parentlist']);
    $showmods = array();
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:get_forum.php

示例7: process


//.........这里部分代码省略.........
         case 'forum':
             $this->setWhereFilter('section', 'forum');
             $filters['show'] = $this->vbphrase['forums'];
             break;
         case 'cms':
             if ($show['as_cms']) {
                 $this->setWhereFilter('section', 'cms');
                 $filters['show'] = $this->vbphrase['articles'];
             } else {
                 vB::$vbulletin->GPC['show'] = 'all';
             }
             break;
         case 'blog':
             if ($show['as_blog']) {
                 $this->setWhereFilter('section', 'blog');
                 $filters['show'] = $this->vbphrase['blogs'];
             } else {
                 vB::$vbulletin->GPC['show'] = 'all';
             }
             break;
         case 'socialgroup':
             $this->setWhereFilter('section', 'socialgroup');
             $filters['show'] = $this->vbphrase['social_groups'];
             break;
         default:
             // all
             vB::$vbulletin->GPC['show'] = 'all';
     }
     switch (vB::$vbulletin->GPC['time']) {
         case 'today':
             $this->setWhereFilter('maxdateline', TIMENOW - 24 * 60 * 60);
             $filters['time'] = $this->vbphrase['last_24_hours'];
             break;
         case 'week':
             $this->setWhereFilter('maxdateline', TIMENOW - 7 * 24 * 60 * 60);
             $filters['time'] = $this->vbphrase['last_7_days'];
             break;
         case 'month':
             $this->setWhereFilter('maxdateline', TIMENOW - 30 * 24 * 60 * 60);
             $filters['time'] = $this->vbphrase['last_30_days'];
             break;
         default:
             // anytime
             vB::$vbulletin->GPC['time'] = 'anytime';
     }
     $selected = array(vB::$vbulletin->GPC['time'] => ' class="selected" ', vB::$vbulletin->GPC['show'] => ' class="selected" ', vB::$vbulletin->GPC['sortby'] => ' class="selected" ');
     $unselected = array('popular' => ' class="unselected" ', 'recent' => ' class="unselected" ', 'anytime' => ' class="unselected" ', 'today' => ' class="unselected" ', 'week' => ' class="unselected" ', 'month' => ' class="unselected" ', 'all' => ' class="unselected" ', 'photos' => ' class="unselected" ', 'forum' => ' class="unselected" ', 'cms' => ' class="unselected" ', 'blog' => ' class="unselected" ', 'socialgroup' => ' class="unselected" ', 'on' => ' class="unselected" ', 'off' => ' class="unselected" ');
     $unselected = array_diff_key($unselected, $selected);
     ($hook = vBulletinHook::fetch_hook($this->hook_beforefetch)) ? eval($hook) : false;
     $arguments = array('sortby' => array('show=' . vB::$vbulletin->GPC['show'], 'time=' . vB::$vbulletin->GPC['time']), 'time' => array('show=' . vB::$vbulletin->GPC['show'], 'sortby=' . vB::$vbulletin->GPC['sortby']), 'show' => array('time=' . vB::$vbulletin->GPC['time'], 'sortby=' . vB::$vbulletin->GPC['sortby']));
     foreach ($arguments as $key => $values) {
         $arguments[$key] = implode("&amp;", $values);
     }
     $filter = array();
     foreach ($filters as $type => $string) {
         $filter[] = array('phrase' => $string, 'arguments' => $arguments[$type]);
     }
     $show['filterbar'] = !empty($filter);
     if (!vB::$vbulletin->GPC['pagenumber']) {
         vB::$vbulletin->GPC['pagenumber'] = 1;
     }
     $moreactivity = array('type' => vB::$vbulletin->GPC['type'], 'page' => vB::$vbulletin->GPC['pagenumber'] + 1);
     $this->setPage(vB::$vbulletin->GPC['pagenumber'], vB::$vbulletin->options['as_perpage']);
     if (vB::$vbulletin->GPC['ajax']) {
         $this->processExclusions(vB::$vbulletin->GPC['sortby']);
         $result = $this->fetchStream(vB::$vbulletin->GPC['sortby']);
         $this->processAjax($result);
     } else {
         $result = $this->fetchStream(vB::$vbulletin->GPC['sortby']);
         $actdata = array('mindateline' => $result['mindateline'], 'maxdateline' => $result['maxdateline'], 'minscore' => $result['minscore'], 'minid' => $result['minid'], 'maxid' => $result['maxid'], 'count' => $result['count'], 'totalcount' => $result['totalcount'], 'perpage' => $result['perpage'], 'time' => vB::$vbulletin->GPC['time'], 'show' => vB::$vbulletin->GPC['show'], 'sortby' => vB::$vbulletin->GPC['sortby'], 'refresh' => $this->refresh);
         $show['noactivity'] = false;
         $show['nomoreresults'] = false;
         $show['moreactivity'] = false;
         if ($result['totalcount'] == 0) {
             $show['noactivity'] = true;
         } else {
             if ($result['totalcount'] < $result['perpage']) {
                 $show['nomoreresults'] = true;
             } else {
                 $show['moreactivity'] = true;
             }
         }
         foreach ($result['bits'] as $bit) {
             $activitybits .= $bit;
         }
         $navbits = construct_navbits(array(vB::$vbulletin->options['forumhome'] . '.php?' . vB::$vbulletin->session->vars['sessionurl'] => $this->vbphrase['home'], '' => $this->vbphrase['activity_stream']));
         $navbar = render_navbar_template($navbits);
         $templater = vB_Template::create('activitystream_home');
         $templater->register_page_templates();
         $templater->register('selected', $selected);
         $templater->register('unselected', $unselected);
         $templater->register('activitybits', $activitybits);
         $templater->register('arguments', $arguments);
         $templater->register('filter', $filter);
         $templater->register('actdata', $actdata);
         $templater->register('navbar', $navbar);
         $templater->register('template_hook', $template_hook);
         print_output($templater->render());
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:home.php

示例8: standard_error

/**
* Halts execution and shows the specified error message
*
* @param	string	Error message
* @param	string	Optional HTML code to insert in the <head> of the error page
* @param	boolean	If true, set the visitor's status on WOL to error page
* @param	string	Optional template to force the display to use. Ignored if showing a lite error
*/
function standard_error($error = '', $headinsert = '', $savebadlocation = true, $override_template = '')
{
    global $header, $footer, $headinclude, $forumjump, $timezone, $gobutton;
    global $vbulletin, $vbphrase, $template_hook;
    global $pmbox, $show, $ad_location, $notifications_menubits, $notifications_total;
    $show['notices'] = false;
    construct_quick_nav(array(), -1, true, true);
    $title = $vbulletin->options['bbtitle'];
    $pagetitle =& $title;
    $errormessage = $error;
    if (!$vbulletin->userinfo['badlocation'] and $savebadlocation) {
        $vbulletin->userinfo['badlocation'] = 3;
    }
    require_once DIR . '/includes/functions_misc.php';
    if ($_POST['securitytoken'] or $vbulletin->GPC['postvars']) {
        $postvars = construct_post_vars_html();
        if ($vbulletin->GPC['postvars']) {
            $_postvars = @unserialize(verify_client_string($vbulletin->GPC['postvars']));
            if ($_postvars['securitytoken'] == 'guest') {
                unset($_postvars);
            }
        } else {
            if ($_POST['securitytoken'] == 'guest') {
                unset($postvars);
            }
        }
    } else {
        $postvars = '';
    }
    if (defined('VB_ERROR_PERMISSION') and VB_ERROR_PERMISSION == true) {
        $show['permission_error'] = true;
    } else {
        $show['permission_error'] = false;
    }
    $show['search_noindex'] = (bool) ($vbulletin->userinfo['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']);
    $navbar = '';
    $navbits = construct_navbits(array('' => $vbphrase['vbulletin_message']));
    if (defined('VB_ERROR_LITE') and VB_ERROR_LITE == true) {
        $templatename = 'STANDARD_ERROR_LITE';
        define('NOPMPOPUP', 1);
        // No Footer here
    } else {
        $templatename = $override_template ? preg_replace('#[^a-z0-9_]#i', '', $override_template) : 'STANDARD_ERROR';
    }
    $show['dst_correction'] = false;
    ($hook = vBulletinHook::fetch_hook('error_generic')) ? eval($hook) : false;
    // VBIV-4792 always render navbar (also fixes VBIV-11560).
    $navbar = render_navbar_template($navbits);
    if ($vbulletin->GPC['ajax']) {
        require_once DIR . '/includes/class_xml.php';
        $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
        $xml->add_tag('error', $errormessage);
        $xml->print_xml();
        exit;
    } else {
        if ($vbulletin->noheader) {
            @header('Content-Type: text/html' . ($vbulletin->userinfo['lang_charset'] != '' ? '; charset=' . $vbulletin->userinfo['lang_charset'] : ''));
        }
        $redirpath = SCRIPTPATH;
        $pathinfo = $vbulletin->input->parse_url($VB_URL);
        $options = array($vbulletin->options['vbforum_url'], $vbulletin->options['vbblog_url'], $vbulletin->options['vbcms_url']);
        foreach ($options as $value) {
            if ($value and $info = $vbulletin->input->parse_url($value)) {
                if ("{$info['scheme']}://{$info['host']}" == VB_URL_SCHEME . '://' . VB_URL_HOST) {
                    $redirpath = $vbulletin->input->xss_clean(VB_URL);
                    break;
                }
            }
        }
        $templater = vB_Template::create($templatename);
        $templater->register_page_templates();
        $templater->register('errormessage', $errormessage);
        $templater->register('forumjump', $forumjump);
        $templater->register('headinsert', $headinsert);
        $templater->register('navbar', $navbar);
        $templater->register('pagetitle', $pagetitle);
        $templater->register('postvars', $postvars);
        $templater->register('scriptpath', $redirpath);
        $templater->register('url', $vbulletin->url);
        print_output($templater->render());
    }
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:90,代码来源:functions.php


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