MyBB Community Forums

Full Version: How to Randomize my ads in Header?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,
I need help to display random ads in header of my forum.
Therez is plugin for this but when i uploaded it system said this plugin is not compatible with MyBB 1.4.2

after that i googled for it and find a nice code for it but its not working Sad
look at the code

<center>
<?php

$fcontents = join ('', file ('banner_ads.txt'));
$s_con = split("~",$fcontents);

$banner_no = rand(0,(count($s_con)-1));
echo $s_con[$banner_no];
?>
</center>

my Banner_ads.txt is this
Banner Code 1
~
Banner Code  2
~
Banner Code 3

Its works quite normally when i test it as stand alone but when i paste above PHP code in my forums header it does not display any thing.
I thing due to PHP Tags???

How to do this?