Random Pictures Problem

Results 1 to 2 of 2

Thread: Random Pictures Problem

  1. #1
    Join Date
    Dec 1969

    Default Random Pictures Problem

    Hi, I have a script from 4guy from about a year ago. It displays one picture. I need to figure out how to display 6 or more pictures, with a link the the full size version. Example of file names.<BR>PIC1:<BR>Small version: 123456.jpg<BR>Large version: tn_123456.jpg<BR><BR>here is the code from the random picture script i have right now. ANy help would be greatly needed!<BR><BR>&#060;%<BR>dim x(293)<BR><BR>&#039;The directory of all my pictures...<BR>Const mypath="/pics"<BR><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)=file.name<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><BR>&#039;Display the image!<BR><BR>Response.Redirect mypath & "/" & x(whichNO)<BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Random Pictures Problem

    as long as all th images are in the target folder, that script will work!

Posting Permissions

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