My forum uses an include PHP function to rotate ads at the top of the forum for my sponsors. It worked great in phpbb 3.2 and all previous versions before that. But in phpbb 3.3 it causes the forum to show a blank page and a 500 server error. So the function appears to be incompatible. How can I fix or alter the code to make it work with 3.3? Where is the conflict? Here is the code that causes the forum to disappear.
Code: Select all
<!-- INCLUDEPHP ./random.php -->
Code: Select all
<?php
/************************************************************************/
/* PHP RandomRotator v1.0 */
/* =========================== */
/* */
/* Written by Steve Dawson - http://www.stevedawson.com */
/* Freelance Web Developer - PHP, Perl and Javascript programming */
/* */
/* This program is free software. You can redistribute it and/or modify */
/************************************************************************/
## HTML or plain text can be randomised. see associated random.txt for the quotes/html.
## See the associated ReadMe.txt file for full installation instructions.
## The name of the .txt file which hold the rotating info (currently random.txt)
$filename = "random.txt";
$file = file($filename);
srand((double)microtime()*1000000);
while ($RandomRotator == "") {
$RandomRotator = ereg_replace("\n","",$file[rand(0,count($file))]);
}
## This prints the banner, quotes or random text, or whatever is in the random.txt file
print "$RandomRotator";
?>