PDA

View Full Version : Rotating Header Images


2 FN LOW
03-15-2007, 11:18 PM
Can anybody help me set up a header so it will rotate images when the page refreshes?

i have tried abunch of the mods/hacks on this site and i cant seem to get any of them to work. I have no idea where im going wrong..If somebody can take a walk through with me that would be great. Thanks

heres what i have done....My header is already modified to begin with, so i think thats where i keep messing up...

i am using these instructions..

Random Header Image
by filburt1

1. Save all your header images in the format headerN.jpg, where N goes from 1 to the total number of header images.


2. Add the following to your phpinclude template, changing "customimages/headerimages/" to the location of your header image. Replacements will not likely work so you probably won't be able to use {imagesfolder}:

$totalheaderimages = 4; // change to the number of header images you have
$randomindex = rand(1, $totalheaderimages);
$headerimage = "customimages/toptitles/toptitle$randomindex.jpg";


3. In your header template, replace:

{titleimage}

with

$headerimage


Done.


so i create a folder on my server called forumbanners....I then go about adding the plugin...there are 7images im using so i change the plugin code to this

$random_number = rand(1, 7);

$random_banner[1] = '<a href="http://www.obsession2speed.com/forums"><img src="forumbanner/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.obsession2speed.com/forums"><img src="forumbanner/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.obsession2sped.com/forums"><img src="forumbanner/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.obsession2speed.com/forums"><img src="forumbanner/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.obsession2speed.com/forums"><img src="forumbanner/banner5.gif" alt="" border="0" /></a>';
$random_banner[6] = '<a href="http://www.obsession2speed.com/forums"><img src="forumbanner/banner6.gif" alt="" border="0" /></a>';
$random_banner[7] = '<a href="http://www.obsession2speed.com/forums"><img src="forumbanner/banner7.gif" alt="" border="0" /></a>';

now this is where i get lost...the instructions say
In your header template, replace:

{titleimage}

with

$headerimage


My header template looks like this...
<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>

</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

i changed what it says to change and no pictures come up at all...just a link that says the name of my forums...I dont understand where i am going wrong...By the way, i am using the newest version of VB and i installed the plugin for PHP in global_start.

anybody....?

TheRed
03-19-2007, 02:05 AM
You could try using an external script like phpads, there are many open source scripts.

faqcorner
12-19-2007, 05:59 PM
In your header template, replace:

{titleimage}

with

$headerimage


My header template looks like this...


i changed what it says to change and no pictures come up at all...just a link that says the name of my forums...I dont understand where i am going wrong...By the way, i am using the newest version of VB and i installed the plugin for PHP in global_start.

anybody....?

<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>

</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

see the "logo" and "/logo"? "$stylevar[titleimage]" I THINK would do it

jdbnsnobal.net
12-19-2007, 06:10 PM
We have set this up on our forum www.thebestcasescenario.com (look at front page and refresh, the images rotate every 60 seconds). I'll try to get that code for you and post it here.