Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
3 + 5 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: Text over rotating image?
by JMorris on 2005/6/28 13:48:56

Quote:
Btw> how dificult would be to call a quotes module on your header?


I tried using 3 different random quote modules in conjunction with the default banner manager and I could not get it to work.

Oh well, plan B. I'll just use a timed animated .gif applied through the CSS background-image property and use the default banner manager to rotate the quotes.

Thanks for the help.
Re: Text over rotating image?
by simeon on 2005/6/27 17:46:34

i don“t know if i got it right.
but maybe try to put the code into a <div> inside the banners <td>




le="color: #000000"><?php <{php}> $quoteFile = "quotes.txt"; $fp = fopen($quoteFile, "r"); $content = fread($fp, filesize($quoteFile)); $quotes = explode("n",$content); fclose($fp); srand((double)microtime()*1000000); $index = (rand(1, sizeof($quotes)) - 1); $var = $quotes[$index]; $GLOBALS['xoopsTpl']->assign( 'xoops_bantxt', $var); <{/php}> <td align="center" style="background-image:url(<{$xoops_banner}>); background-position:center; [color=990000] (i dont think this centering is nessecary cause of the td is already centered)[/color] background-repeat:no-repeat;"> <div><{$xoops_bantxt}></div></td>



i didnt tryed it.see whats going on!

sime
Re: Text over rotating image?
by wcrwcr on 2005/6/27 16:46:51

Hi Jmorris

Did you see this theme?s random header function?
https://xoops.org/modules/news/article.php?storyid=2271&

At least to rotate the headers i guess it works

Btw> how dificult would be to call a quotes module on your header?

See you
Text over rotating image?
by JMorris on 2005/6/27 13:56:39

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:

<table cellspacing="0" height="70px" width="500px"> <tr> <td align="center" style="background-image:url(<{$xoops_banner}>); background-position:center; background-repeat:no-repeat;"> <?php $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 ?> </td> </tr> </table>


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:

<table cellspacing="0" height="70px" width="500px"> <tr> <td align="center" style="background-image:url(http://127.0.0.1/xoops/images/banners/xoops_banner.gif); background-position:center; background-repeat:no-repeat;"> <?php $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 ?> </td> </tr> </table>


Still no dice.

Does anyone know how to create a random image background with random text displayed over it?

Thanks for the help.

Who's Online

856 user(s) are online (786 user(s) are browsing Support Forums)


Members: 0


Guests: 856


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits