<%@ Language=VBScript %> <% 'set show variables 'Session("fwdcounter")=1 Session("rwdcounter")=Session("idx") ' set slide show direction direction= "Forward" Session("direction")= Direction 'Set Slide show speed refresh=2 Session("refresh")=refresh ' Set Slide Show Size size="normal" if size="small" then xheight="height=100" yWidth="width=130" else xheight="height=400" yWidth="width=530" end if ' Set Slide Show Folder foldername =Request("folder") dim x(1000) 'The directory of all my pictures... 'mypath = Server.MapPath("\")& "\photo\" & foldername mypath="./" + foldername Set filesystem = CreateObject("Scripting.FileSystemObject") Set folder = filesystem.GetFolder(server.mappath(mypath)) Set filecollection = folder.Files 'Step through the files list, keeping track of 'the number of files.... idx=0 For Each file in filecollection idx=idx+1 x(idx)=file.name Next Session("mypath")=mypath Session("idx")=idx set filesystem=nothing set folder=nothing set filecollection=nothing %> <% 'x = session("x") mypath=Session("mypath") idx=Session("idx") direction=Session("direction") refresh=Session("refresh") %> <% Sub random 'Choose a random picture randomize timer whichNo=int(rnd()*idx)+1 'Display the image! response.write " & x(whichNo) & " End sub Sub forward 'display picture from begining to end 'set variable to 1 whichno=Session("fwdcounter") 'Display the image! response.write " & x(whichNo) & " if Session("fwdcounter")<>Session("idx") then Session("fwdcounter")=Session("fwdcounter")+1 else Session("fwdcounter") = 1 end if 'call forward End sub Sub reverse 'display picture from end to beginning whichno=Session("rwdcounter") 'Display the image! response.write " & x(whichNo) & " if Session("rwdcounter")<>1 then Session("rwdcounter")=Session("rwdcounter")-1 end if End sub %> ..:: HMP Professional Construction Ltd - Slide show ::..
<% if direction="Forward" then call forward end if if direction="Random" then Call random End if If direction="Reverse" then call reverse end if %>
Close