Vbulletin Hacks

Here is a few Hacks and Workarounds I found while working on a client system using vBulletin, Photopost and Photopost Classifieds.

Variables ex. {vb:rawphrase your_notifications}

These variables are normally just available in a certain template. for example the notification variables are only available in the header template. To add these to work in different locations, in the includes folder is a file called class_bootstrap.php. Around line 450 you will see the varaibles being set and you can just add it to the different templates. code Example below.

$templater = vB_Template::create('headinclude');
	$templater->register('foruminfo', $foruminfo);
	$templater->register('pagenumber', $pagenumber);
	$templater->register('style', $style);
	$templater->register('basepath', $vbulletin->input->fetch_basepath());
	$templater->register('this_script', THIS_SCRIPT);
	$templater->register('facebook_opengraph', $facebook_opengraph);
$headinclude = $templater->render();

$templater = vB_Template::create('headinclude_bottom');
	$templater->register('foruminfo', $foruminfo);
	$templater->register('pagenumber', $pagenumber);
	$templater->register('style', $style);
	$templater->register('basepath', $vbulletin->input->fetch_basepath());
$headinclude_bottom = $templater->render();

$templater = vB_Template::create('header');
	$templater->register('ad_location', $ad_location);
	$templater->register('pmbox', $pmbox);
	$templater->register('notifications_menubits', $notifications_menubits);
	$templater->register('notifications_total', $notifications_total);
	$templater->register('notices', $notices);
	$templater->register('facebook_header', $facebook_header);
$header = $templater->render();

$templater = vB_Template::create('footer');
	$templater->register('admincpdir', $admincpdir);
	$templater->register('ad_location', $ad_location);
	$templater->register('cronimage', $cronimage);
	$templater->register('languagechooserbits', $languagechooserbits);
	$templater->register('modcpdir', $modcpdir);
	$templater->register('quickchooserbits', $quickchooserbits);
	$templater->register('template_hook', $template_hook);
	$templater->register('facebook_footer', $facebook_footer);
        // HERE I ADDED THE NOTIFICATIONS VARIABLES THAT WAS ONLY AVAILABLE IN THE HEADER TEMPLATE
        $templater->register('notifications_total', $notifications_total);
        $templater->register('notifications_menubits', $notifications_menubits);
$footer = $templater->render();

Published by Janes Oosthuizen

Programmer and Tech Junky from Bloemfontein, South-Africa. I have been programming for 8 years in various languages including ( CSS, HTML, jQuery, PHP, MySQL, Wordpress and many other ).

Leave a comment

Your email address will not be published. Required fields are marked *