vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Rotating Header Images (https://vborg.vbsupport.ru/showthread.php?t=142164)

2 FN LOW 03-15-2007 11:18 PM

Rotating Header Images
 
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..

Quote:

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

Quote:

$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...
Quote:

<!-- 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

Quote:

Originally Posted by 2 FN LOW (Post 1204480)
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....?

Quote:

<!-- 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.


All times are GMT. The time now is 11:15 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01247 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete