Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Random/Rotating Title Image
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Skitzo
Starting Member

10 Posts

Posted - 15 June 2002 :  00:42:19  Show Profile
I used to have the following script on an old HTML page that would rotate the title image randomly:

<script language="JavaScript">
function random_bclogo(){
var logos=new Array(12)
logos[1]="URL to logo 1"
logos[2]="URL to logo 2"
logos[3]="URL to logo 3"
logos[4]="URL to logo 4"
logos[5]="URL to logo 5"
logos[6]="URL to logo 6"
logos[7]="URL to logo 7"
logos[ 8]="URL to logo 8"
logos[9]="URL to logo 9"
logos[10]="URL to logo 10"
logos[11]="URL to logo 11"
logos[12]="URL to logo 12"

var y=Math.round(Math.random()*12)
if (y==0) y=1
if (y>11.5) y=12
document.write('<img src="'+logos[y]+'" border=0>')
}
random_logo()
</script>

What would be the easiest way to implement this code into inc_top.asp? I apologize if it's an ignorant post, but I have little knowledge of .asp, although I'm learning more each day.

dayve
Forum Moderator

USA
5820 Posts

Posted - 15 June 2002 :  01:07:41  Show Profile  Visit dayve's Homepage
I always use something like the following... it allows me to do an <img src="random.asp"> and it works with forum code as well. you can easily use this script and in your administrative controls instead of putting a jpg or gif you can put random.asp


random.asp
============

<%
Randomize

Dim iRnd
iRnd = Int(Rnd*9)
Select Case iRnd
Case 0
Response.Redirect "forum_banner1.gif"
Case 1
Response.Redirect "forum_banner2.gif"
Case 2
Response.Redirect "forum_banner3.gif"
Case 3
Response.Redirect "main_banner.gif"
Case 4
Response.Redirect "bs_banner1.jpg"
Case 5
Response.Redirect "bs_banner2.jpg"
Case 6
Response.Redirect "bs_banner3.jpg"
Case 7
Response.Redirect "bs_banner4.jpg"
Case 8
Response.Redirect "bs_banner5.jpg"
Case Else
Response.Redirect "forum_banner2.gif"
End Select
%>

=========================================
here is an example... (refresh to test)


=========================================


http://www.nineinchnailz.com


Edited by - dayve on 15 June 2002 01:10:39
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07