Go Back   vBulletin Modification Discussions > Coding Discussions > PHP Discussions, Tutorials and Help
Home Register FAQ Members List Calendar Mark Forums Read
vBSEO Info Tags

About This Page: This is a discussion on revolving header on page refresh within the PHP Discussions, Tutorials and Help forums, part of the Coding Discussions category, at vBulletin Modification Discussions. can anybody help me set up a header that will change images on page refresh? i have tried abunch of hacks/mods i found on various forums and i always seem to mess up somewhere cause they never work..


Reply
 
LinkBack Thread Tools
Old 03-17-2007, 07:41 PM   #1 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 2
2 FN LOW is on a distinguished road
iTrader: (0)
revolving header on page refresh

can anybody help me set up a header that will change images on page refresh?

i have tried abunch of hacks/mods i found on various forums and i always seem to mess up somewhere cause they never work..
2 FN LOW is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links

Old 03-18-2007, 03:19 AM   #2 (permalink)
Junior Member
 
Join Date: Jan 2007
Location: Anaheim, CA
Posts: 5
whitemike is on a distinguished road
iTrader: (0)
Name it index.php and put it in ur logo directory, then in ur header, call to the directory

in header add something like this depending on ur logo directory

Code:
<td align="center" valign="bottom"><img src="http://www.yourdomain.com/images/logos/index.php" alt="" /></td>
PHP Code:
<?php 
////////////////////////////////////////////////////////////////////// 
/*                  Matt Sims' PHP Sig Rotator V1.3                 */ 
/*                                                                  */ 
/* This script takes an inventory of all image files in a directory */ 
/* and displays one at random. All you need to do is save this code */ 
/* in a directory that contains your images (name it what you will, */ 
/* but make sure it has a ".php" extension). Then just link to this */ 
/* script to get your random image.                                 */ 
/*                                                                  */ 
/* I would recommend naming this file "index.php," and then you can */ 
/* just link to the directory itself (like I do in my example).     */ 
/*                                                                  */ 
/* matt_sims101@hotmail.com                                         */ 
/* www.evilmerc.com                                                 */ 
////////////////////////////////////////////////////////////////////// 

if ($dir opendir(".")) 

     
$list buildimagearray($dir); 
     
displayrandomimage($list); 


// This function reads all the files in the current directory and adds all image files to the array $list[] 

function buildimagearray($dir

     while (
false !== ($file readdir($dir))) 
     { 
          if (!
is_dir($file) && getimagesize($file)) 
          { 
               
$list[] = $file
          } 
     }      
array_shift($list);
     return 
$list


// This function selects a random image, determines the mime type, opens the file for reading, 
// and then outputs the image 

function displayrandomimage($list

     
srand ((double) microtime() * 10000000); 
     
$sig array_rand ($list); 

     
$size getimagesize ($list[$sig]); 
     
$fp fopen($list[$sig], "rb"); 

     if (
$size && $fp
     { 
          
header("Content-type: {$size['mime']}"); 
          
fpassthru($fp); 
          exit; 
     } 

?>
Hope this helps
whitemike is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-18-2007, 05:36 AM   #3 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 2
2 FN LOW is on a distinguished road
iTrader: (0)
still cant get it to work...I save that script and put it on my server...I saved it as a PHP file and put in it /forums/images/banner.....

The banner i have now is coded like this

Code:
<!-- 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 wasnt really sure where to place the tag you gave me, so i replaced
Code:
<td align="center"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
with
Code:
<td align="center" valign="bottom"><img src="http://www.obsession2speed.com/forums/images/banner/index.php" alt="" /></td>
and no pictures showed up at all

can anybody tell me how to code this to get it to work? Ive been playing with rotating php scripts for like a week now lol
2 FN LOW is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-18-2007, 10:34 AM   #4 (permalink)
Junior Member
 
Join Date: Jan 2007
Location: Anaheim, CA
Posts: 5
whitemike is on a distinguished road
iTrader: (0)
its not liking the location that you chose. Just tamper withthe <img src=" and you should get it
whitemike is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


A vBSkinworks Design Recoded By vBModder.
All Code Distributed On This Site is © 2006 by it's author.
Search Engine Optimization by vBSEO 3.1.0

All times are GMT -7. The time now is 01:14 PM.
Online Users 32
Registered 0
Guests 32
Members 3914
Active Members 162
Threads 1855
Posts 7346
Top poster: Code Monkey (2236)
Welcome to our newest member, xer321
Most users ever online was 235, 04-11-2007 at 09:59 AM.
Speak Out! vBulletin gets the web talking!


vBulletin Setup SEO

vBulletin graphics resource images