Jump to content

Page script


zuper89
 Share

Recommended Posts

How do i do to have only 16 pictures on every site?Please help me, all i have found on tutorials is for records in a database.Heres what i looks like know, but there is a folder that contains 115 MB of pictures and when it loads all of them on one page it is a bit of lagg.

<%Const ForReading = 1, ForWriting = 2, ForAppending = 3Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0qfolder = request.querystring("galleri")if qfolder = "" then	folderspec = server.mappath("bilder\galleri")	Set filesys = CreateObject("Scripting.FileSystemObject") 	Set demofolder = filesys.GetFolder(folderspec) 	Set folcoll = demofolder.SubFolders	For Each subfol in folcoll  folsize = left((subfol.size/1000000), 3)     folist = folist & "<a href='?side=bilder&galleri=" & subfol.name & "'>" & subfol.Name & " </a><small> (" & folsize & " MB)</small>" & vbcrlf     folist = folist & "<BR>"  	Next	set filesys = nothing	Response.Write "<center>" & folist & "</center>"elsefilepath = server.mappath("bilder\galleri") & "\" & qfolderSet filesys = CreateObject("Scripting.FileSystemObject")Dim SomeArray()'folder part	Set demofolder = filesys.GetFolder(filepath) 	Set filecoll = demofolder.Files	filecount = 0	i         = 0%><h2><%=qfolder%></h2><table width="400" cellpadding="3" cellspacing="0"> <tr><%	For Each file in filecoll  Ext = UCase(Right(File.Path, 3))   If Ext = "JPG" OR Ext = "GIF" Then  on error resume next  data = SomeArray(filecount)  on error goto 0  hrefpath = "bilder\galleri\" & qfolder & "/" & file.name%>  <td align="center">   <a href="<%=hrefpath%>">    <img src="<%=hrefpath%>" width="80" border="0" alt="Bilde">   </a>  </td><% i=i+1IF i=4 THENi=0 %> </tr> <tr><%end if  filecount = filecount + 1  data = ""  end if	Next%> </tr></table><%	set filesys = Nothing	 end if %>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...