View Full Version : [release] Random header image
filburt1
11-28-2002, 10:00 PM
Author: filburt1
Description: Makes the header image a different image (or likely to be a different image) for each page.
Demo: http://www.webdesignforums.net/?styleid=3 (please don't constantly refresh the page to see all four header images)
Screenshot: n/a, see demo
A simple mod but I'm sure somebody could benefit from it.
Rufus69
11-29-2002, 02:05 AM
hmm is it that thing that goes from all Pixelated to clear texT?
if so I'm installing :D
filburt1
11-29-2002, 02:06 AM
No, and I already posted a tutorial at my forums on how to do that transition :p
MustangBST
11-29-2002, 03:00 AM
What does this do. I know you hate to have that question but I didnt see anything
Larry
Tony G
11-29-2002, 03:23 AM
Nice mod filburt, anything thats rotational I like! :D
Rufus69
11-29-2002, 01:11 PM
bah where on your forums?
filburt1
11-29-2002, 03:02 PM
Okay, let's say you have four title images: header1.jpg, header2.jpg, header3.jpg, and header4.jpg. The header image you see in your forums will be one of these chosen randomly.
Rufus: top of the page (alternates between clouds, mountains, earth, and the default one)
Rufus69
11-29-2002, 03:28 PM
ah Isee it now :0 nice work :)
MacKenzie
12-13-2002, 05:02 PM
Excellent modification, Filburt. I'd seen this done with one of the skins at the relicforums, and liked the idea, especialy as it'll be usefull for my forums where we have a couple title images that everyone wants to use. Thank you for sharing this :)
MacKenzie
12-13-2002, 06:29 PM
Minor problem... I can't get this to work. I changed the header as the instructions noted, and put the code into the phpinclude template as well, changing the paths to where I have my images located... but they don't show.
Here's my phpinclude:
// This code is PHP4 only:
// ob_start();
// require("yourheader.html");
// $header = ob_get_contents();
// ob_end_clean();
//AdminCP/ModCP Login Link
if ($bbuserinfo[usergroupid]==6) { //Admins
$adminlogin = "| <a href=\"admin/\">Administrator CP</a><br>";
} elseif ($bbuserinfo[usergroupid]==5) { //Mods
$adminlogin = "| <a href=\"mod/\">Moderator CP</a><br>";
} else { //Everyone else
$adminlogin = "";
}
$totalheaderimages = 4;
$randomindex = rand(1, $totalheaderimages);
$headerimage = "images/$randomindex.jpg";
Here's my header:
<!-- logo and buttons -->
<center>
<table border="0" width="{tablewidth}" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" align="left" background="{imagesfolder}/menu_background.gif"><a href="index.php?s=$session[sessionhash]"><img src="$headerimage" border="0" alt="$bbtitle"></a></td>
<td valign="bottom" align="right" nowrap background="{imagesfolder}/menu_background.gif">
<!-- toplinks -->
<a href="usercp.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences" border="0"></a>
<a href="register.php?s=$session[sessionhash]&action=signup"><img src="{imagesfolder}/top_register.gif" alt="Registration is free!" border="0"></a>
<a href="calendar.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_calendar.gif" alt="Calendar" border="0"></a>
<a href="memberlist.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_members.gif" alt="Find other members" border="0"></a>
<a href="misc.php?s=$session[sessionhash]&action=faq"><img src="{imagesfolder}/top_faq.gif" alt="Frequently Asked Questions" border="0"></a>
<a href="search.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_search.gif" alt="Search" border="0"></a>
<a href="index.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_home.gif" alt="Home" border="0"></a>
<a href="member.php?s=$session[sessionhash]&action=logout"><img src="{imagesfolder}/top_logout.gif" alt="Logout" border="0"></a>
<!-- /toplinks -->
</td>
</tr>
</table>
<!-- /logo and buttons -->
<!-- content table -->
<table bgcolor="{pagebgcolor}" width="{tablewidth}" cellpadding="10" cellspacing="0" border="0">
<tr>
<td>
filburt1
12-13-2002, 06:30 PM
Are your images in /images/1.jpg, /images/2.jpg, etc?
MacKenzie
12-13-2002, 06:35 PM
... no... oops. I named them header1.jpg, header2.jpg, ect. I am guessing that makes a huge differance?
filburt1
12-13-2002, 06:36 PM
Just change:
$headerimage = "images/$randomindex.jpg";
to
$headerimage = "images/header$randomindex.jpg";
MacKenzie
12-13-2002, 06:50 PM
Thanks! :)
I already changed the names of the files to just numbers, but thank you anyway for that hint. I may go and change it to that method so my other admins know better what the images are and such.
Cheers!
imported_WvD
12-31-2002, 04:01 PM
very very nice dude!! many thnx 2 u!!
Orfejs
01-30-2003, 03:56 PM
Well done.
oz_moses
05-03-2005, 10:34 AM
nice Mod, I really like this one!
is there a way to move the 3 lines of code that are in the php_include into the header template? I ask this as my CMPS page is also showing the header, but doesn't run the php_include template and as such displays a broken image :(
Thanks,
Moses.
2 FN LOW
03-15-2007, 10:20 PM
can anybody tell me where the phpinclude template is located? Cant seem to find it
2 FN LOW
03-15-2007, 10:27 PM
also, if my header is already modified how do i go about changing that to make this work?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.