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/Code)
 Banner code rotator
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

James
Average Member

USA
539 Posts

Posted - 25 February 2001 :  10:45:34  Show Profile  Visit James's Homepage
On my site, I've had a banner on the top of the forums since nearly the start. I did it by including the code in the inc_top.asp file. However, I've always wanted to be able to randomly display different banners. And I wanted to do this with the ability to include different code depending on the banner instead of just randomly displaying an image. So I came up with the code below. It allows you to include not only your image, but any code that goes with it (such as Javascript, etc.).

In inc_top.asp, add the following code below the <body> tag:


<%
randomize

RandomBanner = int (6 * rnd)+1


select case RandomBanner
case "1"
%>
Banner 1 code inserted here<%
case "2"
%>
Banner 2 code inserted here<%
case "3"
%>
Banner 3 code inserted here<%
case "4"
%>
Banner 4 code inserted here<%
case "5"
%>
Banner 5 code inserted here<%
case else
%>
Banner 6 code inserted here<%

end select
%>


You can change the number of banners by altering the int statement to reflect the correct number and adding or deleting the CASES to match. If you want to favor a banner, then you can include it in the case else statement and change the int value to reflect more than the number of banners.


-
*Interested in Radio Control - http://www.rcwebboard.com/*

Edited by - James on 25 February 2001 10:48:07

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 25 February 2001 :  15:15:07  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
very nice :)

Reinsnitz (Mike)
><)))'> Need a Mod?
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 26 February 2001 :  21:18:04  Show Profile  Visit James's Homepage
quote:

very nice :)



Thanks. It's actually something that's very simple and useful.

-
*Interested in Radio Control - http://www.rcwebboard.com/*
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 27 February 2001 :  13:21:47  Show Profile  Visit Rob Poretti's Homepage
Hi James,

I'm intrigued, but I think I need further explanation...

Isn't random display of banners controlled by a banner management system of some kind? Is this a replacement for a banner manager or does it somehow work along with one?

Aside from randomly displaying banners I'm not sure what you're trying to do... sorry... I feel stupid, and I hope you don't mind the questions...

Could you give me a practical example perhaps?



Go to Top of Page

BogieMan
New Member

USA
88 Posts

Posted - 27 February 2001 :  15:03:24  Show Profile  Visit BogieMan's Homepage
I think this is just a simple way to randomly display banners on your site...

I have a pretty simple java script to do the same thing but times the banner at say 15 seconds (you can set how long) then rotates to the next one...

Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 27 February 2001 :  22:35:09  Show Profile  Visit James's Homepage
Yes, it's a simple way to randomly display a banner. It's not as complex as a banner managment system and doesn't allow as many options (unless you code them in), but it's pretty effective. It allows yoy to add not just a graphic banner, but all the code that goes with that banner whether it just be a link, javascript, etc. You can see an example of this code in place at the top of my forum here.

An example of banner code is below. This is one of my banners and would be inserted where it says %>Banner 1 code inserted here<% in the post at the top. This particular code is provided to me be E-news and I display this code for them in exchange for a commision on any sales that result from it.

<p align="center"><img
SRC="http://service.bfast.com/bfast/serve?bfmid=17707&sourceid=33211761&bfpage=tv_promo"
BORDER="0" WIDTH="1" HEIGHT="1" NOSAVE>
<a HREF="http://service.bfast.com/bfast/click?bfmid=17707&sourceid=33211761&bfpage=tv_promo"
TARGET="_top"><img SRC="http://www.enews.com/image/0,1036,NN_tvshowpromo468x60,00.gif"
BORDER="0" WIDTH="468" HEIGHT="60" ALT="Over 50 outdoor magazines!"></a></p>


The whole bit above is placed under one of the case statements.

-

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*


Edited by - James on 27 February 2001 22:37:04
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.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07