/**
  * Builds the applicable notice HTML
  *
  * @return	string	Applicable notice HTML
  */
 protected function build_notices()
 {
     global $vbulletin, $vbphrase, $show;
     $notices = '';
     if (!defined('NONOTICES') and !empty($vbulletin->noticecache) and is_array($vbulletin->noticecache)) {
         $return_link = $vbulletin->scriptpath;
         require_once DIR . '/includes/functions_notice.php';
         if ($vbulletin->userinfo['userid'] == 0) {
             $vbulletin->userinfo['musername'] = fetch_musername($vbulletin->userinfo);
         }
         foreach (fetch_relevant_notice_ids() as $_noticeid) {
             $show['notices'] = true;
             if ($vbulletin->noticecache["{$_noticeid}"]["dismissible"] == 1 and $vbulletin->userinfo['userid']) {
                 // only show the dismiss link for registered users; guest who wants to dismiss?  Register please.
                 $show['dismiss_link'] = true;
             } else {
                 $show['dismiss_link'] = false;
             }
             $notice_html = str_replace(array('{musername}', '{username}', '{userid}', '{sessionurl}', '{sessionurl_q}'), array($vbulletin->userinfo['musername'], $vbulletin->userinfo['username'], $vbulletin->userinfo['userid'], vB::getCurrentSession()->get('sessionurl'), vB::getCurrentSession()->get('sessionurl_q')), $vbphrase["notice_{$_noticeid}_html"]);
             // Legacy Hook 'notices_noticebit' Removed //
             $templater = vB_Template::create('navbar_noticebit');
             $templater->register('notice_html', $notice_html);
             $templater->register('_noticeid', $_noticeid);
             $notices .= $templater->render();
         }
     }
     return $notices;
 }
Esempio n. 2
0
eval('$ad_location[\'ad_footer_end\'] = "' . fetch_template('ad_footer_end') . '";');
// process editor css if required
if ($show['editor_css']) {
    require_once DIR . '/includes/functions_editor.php';
    construct_editor_styles_js($style['editorstyles']);
    eval('$editor_css = "' . fetch_template('editor_css') . '";');
}
// #############################################################################
// handle notices
if (!empty($vbulletin->noticecache) and is_array($vbulletin->noticecache)) {
    $notices = '';
    require_once DIR . '/includes/functions_notice.php';
    if ($vbulletin->userinfo['userid'] == 0) {
        $vbulletin->userinfo['musername'] = fetch_musername($vbulletin->userinfo);
    }
    foreach (fetch_relevant_notice_ids() as $_noticeid) {
        $show['notices'] = true;
        $notice_html = str_replace(array('{musername}', '{username}', '{userid}', '{sessionurl}'), array($vbulletin->userinfo['musername'], $vbulletin->userinfo['username'], $vbulletin->userinfo['userid'], $vbulletin->session->vars['sessionurl']), $vbphrase["notice_{$_noticeid}_html"]);
        ($hook = vBulletinHook::fetch_hook('notices_noticebit')) ? eval($hook) : false;
        eval('$notices .= "' . fetch_template('navbar_noticebit') . '";');
    }
} else {
    $show['notices'] = false;
    $notices = '';
}
// #############################################################################
// set up user notifications
$show['notifications'] = false;
if ($vbulletin->userinfo['userid']) {
    $notifications = array();
    if ($show['pmstats']) {
Esempio n. 3
0
	/**
	* Builds the applicable notice HTML
	*
	* @return	string	Applicable notice HTML
	*/
	protected function build_notices()
	{
		global $vbulletin, $vbphrase, $show;

		$notices = '';
		if (!defined('NONOTICES') AND !empty($vbulletin->noticecache) AND is_array($vbulletin->noticecache))
		{
			$return_link = $vbulletin->scriptpath;

			require_once(DIR . '/includes/functions_notice.php');
			if ($vbulletin->userinfo['userid'] == 0)
			{
				$vbulletin->userinfo['musername'] = fetch_musername($vbulletin->userinfo);
			}
			foreach (fetch_relevant_notice_ids() AS $_noticeid)
			{
				$show['notices'] = true;
				if (($vbulletin->noticecache["$_noticeid"]["dismissible"] == 1) AND $vbulletin->userinfo['userid'])
				{
					// only show the dismiss link for registered users; guest who wants to dismiss?  Register please.
					$show['dismiss_link'] = true;
				}
				else
				{
					$show['dismiss_link'] = false;
				}
				$notice_html = str_replace(
					array('{musername}', '{username}', '{userid}', '{sessionurl}', '{sessionurl_q}'),
					array($vbulletin->userinfo['musername'], $vbulletin->userinfo['username'], $vbulletin->userinfo['userid'], $vbulletin->session->vars['sessionurl'], $vbulletin->session->vars['sessionurl_q']),
					$vbphrase["notice_{$_noticeid}_html"]
				);

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

				$templater = vB_Template::create('navbar_noticebit');
					$templater->register('notice_html', $notice_html);
					$templater->register('_noticeid', $_noticeid);
				$notices .= $templater->render();
			}
		}

		return $notices;
	}