The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Variable not showing up in postbit template
Hi,
I want to add an ad after the first post. This I am able to do by adding the below code in postbit template Code:
<if condition="!$GLOBALS['FIRSTPOSTID']"> <div class="firstpostad"> Ad Code Here </div> </if> For this I have written a php code which works fine independently and in header template as well. But not in postbit template. I tried using $global, then writing in plugin and as a separate php file but in vain. Please help. My vb version is 3.8.1 patch level1 My code is as below Code:
<?php function ad_after_first_post() { $hostname=$_SERVER["SERVER_NAME"]; $urls = array('test.forums.v3.co.uk','test.forums.accountancyage.com','test.forums.businessgreen.com','test.forums.computeractive.co.uk'); $brand_name['test.forums.v3.co.uk']='vn2.uk'; $brand_name['test.forums.accountancyage.com']='aa2.uk'; $brand_name['test.forums.businessgreen.com']='bg2.uk'; $brand_name['test.forums.computeractive.co.uk']='ca2.uk'; foreach($urls as $url) { if ($hostname==$url) { $brand_var_for_ad=$brand_name[$url]; } } return $brand_var_for_ad; } $ad=ad_after_first_post(); ?> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|