I found some code on another forum that's supposed to show a random banner within vbulletin. People posting in the thread got it to work, but I'm stuggling. If someone wouldn't mind taking a look and telling me what I'm doing wrong, I'd greatly appreciate it.
I created a new plugin, with the hook location of "global_start" with this code:
Code:
$banner[1] = "<center><a href=\"http://advertiser-edit.com/?utm_source=website.org&utm_medium=banner&utm_campaign=websiteleaderboard\"><img src=\"http://www.website.org/leaderboard_books_design.jpg\"></a></center>";
$banner[2] = "<center>
<script type=\"text/javascript\"><!--
google_ad_client = \"ca-pub-numbersremoved\";
google_ad_slot = \"4591232780\";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script></center>";
$rotator = rand(1, 2);
$bannerrotator = $banner[$rotator];
I've tried placing $bannerrotator in the bottom of the navbar template and also in the ad location in the ads section, but neither work. Instead I get "$bannerrotator" where the ad should appear. What am I doing wrong?
Thanks guys.