1
I'm working on the theme for work and what I want to do is use the built in Banners module to rotate a header graphic, then using a simple php script that reads a flat text file DB, display a random quote over top of the random graphic. Here's my code thus far:
); background-position:center; background-repeat:no-repeat;"> $quoteFile = "quotes.txt"; //File holding qoutes $fp = fopen($quoteFile, "r"); //Opens file for read $content = fread($fp, filesize($quoteFile)); $quotes = explode("n",$content); //Put quotes into array fclose($fp); //Close the file srand((double)microtime()*1000000); // randomize $index = (rand(1, sizeof($quotes)) - 1); //Pick random qoute echo $quotes[$index]; //Print quote to screen ?>
|
The problem I'm running into is that php cannot be added to theme.html I've also tried inserting the custom code in the banner manager itself, like so:
http://127.0.0.1/xoops/images/banners/xoops_banner.gif); background-position:center; background-repeat:no-repeat;"> $quoteFile = "quotes.txt"; //File holding qoutes $fp = fopen($quoteFile, "r"); //Opens file for read $content = fread($fp, filesize($quoteFile)); $quotes = explode("n",$content); //Put quotes into array fclose($fp); //Close the file srand((double)microtime()*1000000); // randomize $index = (rand(1, sizeof($quotes)) - 1); //Pick random qoute echo $quotes[$index]; //Print quote to screen ?>
|
Still no dice.
Does anyone know how to create a random image background with random text displayed over it?
Thanks for the help.
Insanity can be defined as "doing the same thing over and over and expecting different results."
Stupidity is not a crime. Therefore, you are free to go.