Include PHP function not working in 3.3 - What do I need to change in the code?

Discussions computers, internet and mobile technology (cell phones, smart phones, iPads).
Post Reply
User avatar
Winston
Site Admin
Posts: 37670
Joined: August 18th, 2007, 6:16 am
Contact:

Include PHP function not working in 3.3 - What do I need to change in the code?

Post by Winston »

To anyone who knows html or php:

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 -->
Here is the code of the random.php file that the function calls up:

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";
?>
Any idea? Where's the conflict? Why does phpbb 3.3 seem to fragile? Thanks.
Check out my FUN video clips in Russia and SE Asia and Female Encounters of the Foreign Kind video series and Full Russia Trip Videos!

Join my Dating Site to meet thousands of legit foreign girls at low cost!

"It takes far less effort to find and move to the society that has what you want than it does to try to reconstruct an existing society to match your standards." - Harry Browne


Meet Loads of Foreign Women in Person! Join Our Happier Abroad ROMANCE TOURS to Many Overseas Countries!

Meet Foreign Women Now! Post your FREE profile on Happier Abroad Personals and start receiving messages from gorgeous Foreign Women today!

User avatar
Winston
Site Admin
Posts: 37670
Joined: August 18th, 2007, 6:16 am
Contact:

Re: Include PHP function not working in 3.3 - What do I need to change in the code?

Post by Winston »

Would this work better?

Code: Select all

<?php include "/random.php"; ?>
Check out my FUN video clips in Russia and SE Asia and Female Encounters of the Foreign Kind video series and Full Russia Trip Videos!

Join my Dating Site to meet thousands of legit foreign girls at low cost!

"It takes far less effort to find and move to the society that has what you want than it does to try to reconstruct an existing society to match your standards." - Harry Browne
User avatar
Winston
Site Admin
Posts: 37670
Joined: August 18th, 2007, 6:16 am
Contact:

Re: Include PHP function not working in 3.3 - What do I need to change in the code?

Post by Winston »

Oh well, maybe I should try to use the phpbb advertisement management mod to run ads instead?

https://www.phpbb.com/customise/db/extension/ads

I'll try to figure it out. It didn't work before but it should. Maybe I overlooked something.
Check out my FUN video clips in Russia and SE Asia and Female Encounters of the Foreign Kind video series and Full Russia Trip Videos!

Join my Dating Site to meet thousands of legit foreign girls at low cost!

"It takes far less effort to find and move to the society that has what you want than it does to try to reconstruct an existing society to match your standards." - Harry Browne
Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Computers, Internet, Mobile Technology”