Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => SMF Feedback and Discussion => Topic started by: 123kid on August 13, 2008, 10:10:23 PM

Title: Just thinking of a rotating banner heading
Post by: 123kid on August 13, 2008, 10:10:23 PM
Thansk for SMF, works like a charm for us ;)

We have multiple board heading designs like google that interchanged weekly...

But then i was curious if there is a mod to install or a code to modify in board.index.template that would rotate our board heading image for like every page load or scheduled every day/week/months.

We have like almost 10 board heading designs already and it would be really helpful for us if we could have this, for us not to manually overwrite our board heading image via FTP every week ;)

TIA! and More power!
Title: Re: Just thinking of a rotating banner heading
Post by: ccbtimewiz on August 14, 2008, 12:24:26 AM
If you know some PHP, you could do something like:

$x = array( "image1.jpg","image2.jpg","image3.jpg" );
$y = rand( 0,2 );
$z = $x[$y];

echo '<img src="static URL/$x">';


Just add more images to the array and increase the rand range.  Then have the Static URL correct for the location of the image you'll be using.

Though if you want it timed, I'm not quite sure. You'd need to use some javascript at that point. What I showed you does it upon every page load.
Title: Re: Just thinking of a rotating banner heading
Post by: 123kid on August 14, 2008, 01:51:47 AM
Quote from: ccbtimewiz on August 14, 2008, 12:24:26 AM
If you know some PHP, you could do something like:

$x = array( "image1.jpg","image2.jpg","image3.jpg" );
$y = rand( 0,2 );
$z = $x[$y];

echo '<img src="static URL/$x">';


Just add more images to the array and increase the rand range.  Then have the Static URL correct for the location of the image you'll be using.

Though if you want it timed, I'm not quite sure. You'd need to use some javascript at that point. What I showed you does it upon every page load.
thanks for the quick reply :) but i'm not that good in php could you provide the exact full code where to insert, what line, what to replace... :) tia!