Banner Rotater

Results 1 to 2 of 2

Thread: Banner Rotater

  1. #1
    Join Date
    Dec 1969

    Default Banner Rotater

    I have a couple cool banners for my webpage ( --- DONT LAUGH IT ISNT NEARLY FINISHED!!! =] )<BR><BR>I wanna make a rotater to show a different banner on refresh or page entry ....<BR><BR><BR>Would I do this by Seeion.ID????

  2. #2
    Join Date
    Dec 1969

    Default RE: Banner Rotater

    There are dozens of solutions for banner rotation. I have used a number of them myself. For a simple website, my favorite solution is using FSO and text files in a particular folder. The only disadvantage is that you get no statistics per banner. But, in most cases, you won&#039;t need them anyway. If you need statistics, try this free and easy solution:<BR><BR>But suppose you don&#039;t need statistics, why not just have a folder. In that folder are various text files. Each one has the html necessary to display a banner. At the location you want the banner to display, you place this:<BR>&#060;!--#include virtual="/adverts/fishing_get_advert.asp"--&#062;<BR>&#060;% getadvert %&#062;<BR><BR>which calls this sub:<BR><BR>&#060;%<BR>sub getadvert<BR><BR>dim x(1000)<BR><BR>Const mypath="/games/fish/adverts/"<BR>&#039;&#060;!--""<BR>Set filesystem = CreateObject("Scripting.FileSystemObject")<BR>Set folder = filesystem.GetFolder(server.mappath(mypath))<BR><B R>Set filecollection = folder.Files<BR><BR>&#039;Step through the files list, keeping track of<BR>&#039;the number of files....<BR>idx=0<BR>For Each file in filecollection<BR> idx=idx+1<BR> x(idx)<BR>Next<BR><BR>&#039;Choose a random picture<BR>randomize timer<BR>whichNo=int(rnd()*idx)+1<BR><BR>&#039;Cle an up...<BR>set filesystem=nothing<BR>set folder=nothing<BR>set filecollection=nothing<BR>thisisit = "d:/1st-r8com/html/games/fish/adverts/" & x(whichNO)<BR>&#039;&#060;!--""<BR>&#039;response.write thisisit<BR> Dim fs, banFile<BR> Set fs = Server.CreateObject("Scripting.FileSystemObject")< BR><BR> &#039;Open banners.txt for reading<BR> Set banFile = fs.OpenTextFile(thisisit, 1)<BR><BR><BR> &#039;Read the file:<BR> Dim mytext<BR> mytext = banFile.ReadAll<BR><BR> &#039; Close file<BR> banFile.Close<BR><BR><BR><BR>set fs = nothing<BR>set banfile = nothing<BR><BR><BR>response.write mytext<BR>end sub<BR><BR>%&#062;<BR>Which creats a list of all the files in that folder, and picks one at random and displays it. By the way, you can weight banners by placing more than one of one file in that folder. So, if you want one banner to show twice as often as another, you place 2 files of the first one one file of the second in that folder. Also, you can display banners from various banner companies this way. Say you want to show banners from or It is easy. Just make a text file of their html code, and place the file in that folder.<BR><BR>I have used this method flawlessly and I like its ease and simplicity.<BR><BR>Good luck,<BR><BR>Edward<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts