2008-10-03, 08:12 AM
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
look at the code
my Banner_ads.txt is this
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?
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
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?