PDA

View Full Version : HDI put a plugin into vba 2.0?


Spinball
01-20-2006, 02:46 PM
I currently slap a bit of code into vba_cmps_include_bottom.php to display banners at the top of the vba home page.
I would like to use the plugin system instead so I can activate it and deactivate it from time to time.
How would I do this, please?
I tried adding a new plugin, but vba is not in the product list. :confused:

Brian
01-21-2006, 12:06 AM
You would need to add it to your global_start template, and wrap this code around it:

if (THIS_SCRIPT == 'adv_index')
{

}

Our Sponsors
 

Spinball
01-29-2006, 02:13 PM
Sorry Brian, that doesn't work.
The code looks like this:
$session_for_ads=session_id();
if (strlen($session_for_ads==0)) {
$session_for_ads=$_COOKIE['AVFsessionhash'];
}
$userip = $_SERVER['REMOTE_ADDR'];
$banners = file_get_contents("http://www.avads.co.uk/ad_serve.php?s=" . $session_for_ads . "&zoneid=HPH-HPF&userid=" . $vbulletin->userinfo['userid'] . "&ip=" . $userip);
list($headerbanner, $footerbanner) = explode("|",$banners);
If $vbulletin->userinfo['userid'] isn't correctly set, the script doesn't work and I can only guess that it isn't set until after global_start or global_end which I also tried.

Brian
01-30-2006, 04:22 PM
The $vbulletin->userinfo array is set well before the global_start plugin.