After experiencing a lot of down time, We decided to move this site to CrystalTech.com. CrystalTech.com is powered by only the finest Windows servers providing the best performance, reliability, and value anywhere.

 latest image upload applet

Author Message
NazzDesigns
  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 12/12/2009
latest image upload applet - Saturday, December 12, 2009 5:31 AM
0
hey everyone,
I am new to this forum and also vbscript
 
I use the following coding to show six images from the latest photo album i uploaded picture to. However the images being shown are the 1st six images in the folder (which are the ones the oldest uploaded) not the final six images uploaded. Anyone can help me what should i change in the following coding to show the last six images in the folder.
 
 
       <%
                                                     latestfolder = "na"
                                                     latestdate = cdate("01/01/09")
     
                                                     set fs=Server.CreateObject("Scripting.FileSystemObject")
                             set fo=fs.GetFolder(Server.MapPath("images/gallery"))
                                                     for each folder in fo.subfolders 
                                                             if cdate(folder.DateLastModified) > latestdate then
                                                                     latestdate = cdate(folder.DateLastModified)
                                                                     latestfolder = folder.name
                                                             end if
                                                     next
     
                                                     if latestfolder <> "na" then
                                                       set fi=fs.GetFolder(Server.MapPath("images/gallery/" & latestfolder))
                                                             looptimes = 0
                                                             for each file in fi.files 
     
         if right(lcase(file.Name),3) = "jpg" then %>
     
      <a href="thumbnail.aspx?picture=<%=server.URLEncode("images/gallery/" & latestfolder & "/" & file.Name)%>&maxWidth=640&maxHeight=480" target="_blank"  style="text-decoration:none; cursor:pointer;">          
        <img src="thumbnail.aspx?picture=<%=server.URLEncode("images/gallery/" & latestfolder & "/" & file.Name)%>&maxWidth=100&maxHeight=60" style="border:1px solid #ffffff; margin:5px; margin-top:14px;">        </a> 
     
       <% end if
     
                                                                     looptimes = looptimes + 1
                                                                     if looptimes = 6 then exit for end if
                                                             next
     
                                                     end if
                                     %>