I was wondering if anyone knew if there is a way to make the banner on my site rotate.
I mean like, each time someone refreshes or visits the page, there is a different banner - So like if I am on my PC and my brother is on his PC, we will both see different banners
I have seen it on a couple sites but it might've been PHP involved
Anybody know the code?
Is there a way to code this?
Started by zinguzi, Apr 01 2007 12:40 AM
2 replies to this topic
#1
Posted 01 April 2007 - 12:40 AM
Squizz Studios -
squizzstudios.gamemod.net
#2
Posted 01 April 2007 - 02:30 AM
JS is probably easier, but as php is more fun, try this
1. Put your images in a folder called randomimages (this can be changed - see $folder)
2. Name your images numerically (1.gif, 2.gif, etc.)
3. Paste below code where you want the image
1. Put your images in a folder called randomimages (this can be changed - see $folder)
2. Name your images numerically (1.gif, 2.gif, etc.)
3. Paste below code where you want the image
<? $total = "2"; // Total number of images in the folder $ext = ".gif"; // File extension used (.gif, .png, etc) $folder = "randomimages"; // Location of images // You shouldn't have to edit below $start = "1"; $random = mt_rand($start, $total); $image = $random . $ext; echo "<img src=\"$folder/$image\" alt=\"$image\" />"; ?>There are prolly better ways of doing it, but I just got out of bed
World Domination Status: ▾2.7%
#3
Posted 01 April 2007 - 03:57 AM
Erm.... I am lost now lol I understood it at first glance but when I check the website's source code its confusing
heres the site:
I want to make logo.png rotate, can you give me the edited code X_X in the meanwhile, I am going to not be lazy and try figuring it out myself
heres the site:
<BODY BGCOLOR=#FFFFFF background="images/bg.png" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/Rollovers/Independance_05.png','images/Rollovers/Independance_06.png','images/Rollovers/Independance_07.png','images/Rollovers/Independance_08.png','images/Rollovers/Independance_09.png','images/Rollovers/Independance_10.png')"> <script LANGUAGE="javascript" SRC="http://www.revora.net/bar.js"></SCRIPT> <div align="center"> <table id="Table_01" width="796" height="751" border="0" cellpadding="0" cellspacing="0"> <tr> <td rowspan="22" background="images/Independance_01.png"> </td> <td colspan="21"> This is what I want to rotate ------> <img src="images/logo.png" width="694" height="168" alt=""></td> <td rowspan="22" background="images/Independance_03.png"> </td> <td> <img src="images/spacer.gif" width="1" height="168" alt=""></td> </tr> <tr>
I want to make logo.png rotate, can you give me the edited code X_X in the meanwhile, I am going to not be lazy and try figuring it out myself
Edited by zinguzi, 01 April 2007 - 04:03 AM.
Squizz Studios -
squizzstudios.gamemod.net
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users