Carissimi,
questo script, così com'è mette in ordine dall'alto in basso singolarmente titolo e foto estrapolate da cartelle sul web.
Ora come modificarlo per visionare in ordine di 3 per ogni rigo tabellate?
Graziecodice:<% Function GetRndImg(PhotoFolder,GalleryTitle,ImgList,NumImgs) ImgArr = Split(ImgList,"|") ImgCt = UBound(ImgArr) ImgStr = "" If ImgCt >= NumImgs Then For x = 1 to NumImgs Randomize Timer RndImgNum = Int(ImgCt * Rnd) While Instr(1,ImgStr,ImgArr(RndImgNum)) > 0 RndImgNum = Int(ImgCt * Rnd) Wend ImgStr = ImgStr & ImgArr(RndImgNum) & "|" Next ImgStr = Left(ImgStr,Len(ImgStr)-1) ImgArr = Split(ImgStr,"|") End If GetRndImg = "<td width='230'>" & chr(13) & _ "<tr style=" & chr(34) & "text-align:center;vertical-align:top;" & chr(34) & ">" & chr(13) For x = 0 To Ubound(ImgArr) GetRndImg = GetRndImg & "<td style=" & chr(34) & "width "& 150 &"" & Cint(100/NumImgs) & chr(34) & ">" & chr(13) & _ "[img] & chr(34) & [/img]" & chr(13) & _ "" Next GetRndImg = GetRndImg & "</table><td style='width 150100'>" End Function Set FSO = Server.CreateObject("Scripting.FileSystemObject") Set PhotoGallery = FSO.GetFolder(Server.MapPath("PhotoGallery")) For each Fldr in PhotoGallery.SubFolders PhotoFolder = Fldr.Name Set ImgFldr = FSO.GetFolder(Server.MapPath("PhotoGallery/" & Fldr.Name)) ImgCt = 0 ImgList = "" For Each FileName in ImgFldr.Files If Right(LCase(FileName.Name),3) = "jpg" OR Right(LCase(FileName.Name),3) = "gif" OR Right(LCase(FileName.Name),4) = "jpeg" Then ImgCt = ImgCt + 1 ImgList = ImgList & FileName.Name & "|" End If Next Set ImgFldr = Nothing If Len(Trim(ImgList)) > 0 Then Set DescFile = FSO.OpenTextFile(Server.MapPath("PhotoGallery/" & Fldr.Name & "/Gallery.txt"), 1) GalleryTitle = DescFile.ReadLine Set DescrFile = Nothing ImgList = Left(ImgList,Len(ImgList)-1) Response.Write "<table border='1' width='230' id='table1'><div class=" & chr(34) & "breg" & chr(34) & " style=" & chr(34) & "padding:5px;" & chr(34) & ">" & chr(13) & _ "<a href=" & chr(34) & "Photos.asp?Gallery=" & PhotoFolder & chr(34) & " rel=" & lightbox & " class=" & chr(34) & "Cat" & chr(34) & " style=" & chr(34) & "font-weight:bold;" & chr(34) & ">" & chr(13) & _ GalleryTitle & _ " <span style=" & chr(34) & "font-size:8pt" & chr(34) & ">(" & ImgCt & " foto)</span>" & chr(13) & _ "</a>" & chr(13) Response.Write "<div style=" & chr(34) & "padding:3px;padding-left:20px;" & chr(34) & ">" & chr(13) & _ GalleryDesc & chr(13) & _ "</div>" & chr(13) Response.Write "<div class=" & chr(34) & "bnotes" & chr(34) & " style=" & chr(34) & "padding:3px;padding-left:20px;font-style:italic;" & chr(34) & ">" & chr(13) & _ "</div>" & chr(13) Response.Write GetRndImg(PhotoFolder,GalleryTitle,ImgList,1) Response.Write ""& chr(13) End If Next Set PhotoGallery = Nothing Set FSO = Nothing %>
G.

Rispondi quotando