MyBB Community Forums

Full Version: PHP incorporation?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, I found this useful ad rotation script, and I want to incorporate it to my index_boardstats page, everything except the PHP script is working. How do I get PHP working (I understand there's systematic stuff involved)? Here's my script, it's pretty simplistic.

<?php
$bannerAd[1] = 'code for ad 1';
$bannerAd[2] = 'code for ad 2';
$bannerAd[3] = 'code for ad 3';
$bannerAd[4] = 'code for ad 4';
$bannerAd[5] = 'code for ad 5';

$adCount = count($bannerAd);
$randomAdNumber = mt_rand(1, $adCount);
echo $bannerAd[$randomAdNumber];
?>
You cannot run PHP through the templates.
You could either use a plugin, or you could look for a javascript version of the script?
Alright then, I understand. Thanks anyway.
I'm going to move this to code modifications. That way other users will be able to advise you on what you can do in terms of ad rotation...