28. maj 2001 - 17:36Der er
12 kommentarer og 2 løsninger
paging af billeder
Jeg har en del billeder som jeg gerne vil have viset 6 af på hver side. På en slags admin del, skal jeg bare skrive f.eks. 0022.jpg også er mappen angivet også skal de nyeste listes først og jeg uploader billederne via ftp så der skal ikke laves upload komponent eller lign.
Brug af AI afslører de svagheder, virksomheder allerede har opbygget gennem års cloud-transformation, nye SaaS-løsninger og fragmenterede sikkerhedssystemer.
netsrac >> har kigget lidt på det samme. det virker efter hensigten og så\'n - men kan man på en eller anden måde gå ind og sortere efter en dato der (.date)?
<table width=\"100%\" border=\"0\"> <% antal = 0 start = request.querystring(\"start\") if start = \"\" then start = 0 end if
Set fs = CreateObject(\"Scripting.FileSystemObject\") Set f = fs.GetFolder(server.mappath(\"\" & kat(\"mappen\") & \"\")) Set fc = f.Files For Each billed in fc arrayBuild = arrayBuild & billed.name & \"|\" next arrayBuild = left(arrayBuild, (len(arrayBuild) - 1)) myArray = Split(arrayBuild, \"|\")
Antalsider = int(ubound(myarray) / 10)
for i = start to (start + 9) if not i >= ubound(myarray) then
if antal = 0 then Response.Write \"<TR>\" end if %> <td width=\"50%\"><center> <IMG SRC=\"<%=kat(\"mappen\")%>/<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br> </center></td> <% end if
if antal = 1 then Response.Write \"</TR>\" antal = 0 else antal = antal + 1 end if next
%> </table> <% if nesteside <> 1 then response.write(\"<a href=\'postkort.asp?trin=\" & request(\"trin\") & \"&kat=\" & request(\"kat\") & \"&start=\" & (start + 10) & \"\' style=\'color: #000000\'>Næste side</a>\") end if
if start <> 0 then response.write(\"<a href=\'postkort.asp?trin=\" & request(\"trin\") & \"&kat=\" & request(\"kat\") & \"&start=\" & (start - 10) & \"\' style=\'color: #000000\'>Forrige side</a>\") end if %>
<IMG SRC=\"<%=kat(\"mappen\")%>/<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br>
skal laves om til
<IMG SRC=\"<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br>
<table width=\"100%\" border=\"0\"> <% antal = 0 start = request.querystring(\"start\") if start = \"\" then start = 0 end if
Set fs = CreateObject(\"Scripting.FileSystemObject\") Set f = fs.GetFolder(server.mappath(\"\" & kat(\"mappen\") & \"\")) Set fc = f.Files
myArray = fc
Antalsider = int(ubound(myarray) / 10)
for i = start to (start + 9) if not i >= ubound(myarray) then
if antal = 0 then Response.Write \"<TR>\" end if %> <td width=\"50%\"><center> <IMG SRC=\"<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br> </center></td> <% end if
if antal = 1 then Response.Write \"</TR>\" antal = 0 else antal = antal + 1 end if next
%> </table> <% if nesteside <> 1 then response.write(\"<a href=\'postkort.asp?start=\" & (start + 10) & \"\' style=\'color: #000000\'>Næste side</a>\") end if
if start <> 0 then response.write(\"<a href=\'postkort.asp?start=\" & (start - 10) & \"\' style=\'color: #000000\'>Forrige side</a>\") end if %>
<table width=\"100%\" border=\"0\"> <% antal = 0 start = request.querystring(\"start\") if start = \"\" then start = 0 end if
Set fs = CreateObject(\"Scripting.FileSystemObject\") Set f = fs.GetFolder(server.mappath(\"\" & kat(\"mappen\") & \"\")) Set myarray = f.Files
Antalsider = int(ubound(myarray) / 10)
for i = start to (start + 9) if not i >= ubound(myarray) then
if antal = 0 then Response.Write \"<TR>\" end if %> <td width=\"50%\"><center> <IMG SRC=\"<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br> </center></td> <% end if
if antal = 1 then Response.Write \"</TR>\" antal = 0 else antal = antal + 1 end if next
%> </table> <% if nesteside <> 1 then response.write(\"<a href=\'postkort.asp?start=\" & (start + 10) & \"\' style=\'color: #000000\'>Næste side</a>\") end if
if start <> 0 then response.write(\"<a href=\'postkort.asp?start=\" & (start - 10) & \"\' style=\'color: #000000\'>Forrige side</a>\") end if %>
Okay havde lige en sorterings metode i JAVA, har lige omskrevet den til asp, prøv med:
<table width=\"100%\" border=\"0\"> <%
function sortArr(myarr)
for k = 0 to ubound(myarr) - 1 minindex = k for j= k+1 to ubound(myarr) if myarr(j).DateLastModified > myarr(minindex).DateLastModified then minindex = j end if next tmp = myarr(k) myarr(k) = myarr(minindex) myarr(minindex) = tmp next end function
antal = 0 start = request.querystring(\"start\") if start = \"\" then start = 0 end if
Set fs = CreateObject(\"Scripting.FileSystemObject\") Set f = fs.GetFolder(server.mappath(\"\" & kat(\"mappen\") & \"\")) Set myarray = sortArr(f.Files)
Antalsider = int(ubound(myarray) / 10)
for i = start to (start + 9) if not i >= ubound(myarray) then
if antal = 0 then Response.Write \"<TR>\" end if %> <td width=\"50%\"><center> <IMG SRC=\"<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br> </center></td> <% end if
if antal = 1 then Response.Write \"</TR>\" antal = 0 else antal = antal + 1 end if next
%> </table> <% if nesteside <> 1 then response.write(\"<a href=\'postkort.asp?start=\" & (start + 10) & \"\' style=\'color: #000000\'>Næste side</a>\") end if
if start <> 0 then response.write(\"<a href=\'postkort.asp?start=\" & (start - 10) & \"\' style=\'color: #000000\'>Forrige side</a>\") end if %>
for k = 0 to ubound(myarr) - 1 minindex = k for j= k+1 to ubound(myarrdato) if myarrdato(j) > myarrdato(minindex) then minindex = j end if next tmp = myarr(k) myarr(k) = myarr(minindex) myarr(minindex) = tmp tmp2 = myarrdato(k) myarrdato(k) = myarrdato(minindex) myarrdato(minindex) = tmp2 next
end function
antal = 0 start = request.querystring(\"start\") if start = \"\" then start = 0 end if
Set fs = CreateObject(\"Scripting.FileSystemObject\") Set f = fs.GetFolder(server.mappath(\".\")) Set fc = f.Files For Each billed in fc arrayBuild = arrayBuild & billed.name & \"|\" arraybuild2 = arraybuild2 & billed.datelastmodified & \"|\" next arrayBuild = left(arrayBuild, (len(arrayBuild) - 1)) myArray = Split(arrayBuild, \"|\") myArray2 = Split(arrayBuild2, \"|\")
call sortArr(myArray, myarray2)
Antalsider = int(ubound(myarray) / 6)
for i = start to (start + 5) if not i >= ubound(myarray) then
if antal = 0 then Response.Write \"<TR>\" end if %> <td><center> <IMG SRC=\"<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br> </center></td> <% end if
if antal = 2 then Response.Write \"</TR>\" antal = 0 else antal = antal + 1 end if next
%> </table> <% if ubound(myarray) > start + 6 then response.write(\"<a href=\'\"&request.servervariables(\"script_name\")&\"?start=\" & (start + 6) & \"\' style=\'color: #000000\'>Næste side</a>\") end if
if start <> 0 then response.write(\"<a href=\'\"&request.servervariables(\"script_name\")&\"?start=\" & (start - 6) & \"\' style=\'color: #000000\'>Forrige side</a>\") end if %> </body>
for k = 0 to ubound(myarr) - 1 minindex = k for j= k+1 to ubound(myarrdato) if myarrdato(j) > myarrdato(minindex) then minindex = j end if next tmp = myarr(k) myarr(k) = myarr(minindex) myarr(minindex) = tmp tmp2 = myarrdato(k) myarrdato(k) = myarrdato(minindex) myarrdato(minindex) = tmp2 next
end function
antal = 0 start = request.querystring(\"start\") if start = \"\" then start = 0 end if
Set fs = CreateObject(\"Scripting.FileSystemObject\") Set f = fs.GetFolder(server.mappath(\".\")) Set fc = f.Files thisfile = right(request.servervariables(\"script_name\"), len(request.servervariables(\"script_name\")) - instrrev(request.servervariables(\"script_name\"), \"/\")) For Each billed in fc
if billed.name <> thisfile then arrayBuild = arrayBuild & billed.name & \"|\" arraybuild2 = arraybuild2 & billed.datelastmodified & \"|\" end if next arrayBuild = left(arrayBuild, (len(arrayBuild) - 1)) myArray = Split(arrayBuild, \"|\") myArray2 = Split(arrayBuild2, \"|\")
call sortArr(myArray, myarray2)
Antalsider = int(ubound(myarray) / 6)
for i = start to (start + 5) if not i >= ubound(myarray) then
if antal = 0 then Response.Write \"<TR>\" end if %> <td><center> <IMG SRC=\"<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"><br> </center></td> <% end if
if antal = 2 then Response.Write \"</TR>\" antal = 0 else antal = antal + 1 end if next
%> </table> <% if ubound(myarray) > start + 6 then response.write(\"<a href=\'\"&request.servervariables(\"script_name\")&\"?start=\" & (start + 6) & \"\' style=\'color: #000000\'>Næste side</a>\") end if
if start <> 0 then response.write(\"<a href=\'\"&request.servervariables(\"script_name\")&\"?start=\" & (start - 6) & \"\' style=\'color: #000000\'>Forrige side</a>\") end if %> </body>
<body> <% if request.querystring(\"action\") = \"viewbig\" then %> <img src=\"<%=request.querystring(\"billede\") %>\"> <%else %> <table border=\"0\">
<% function sortArr(myarr, myarrdato)
for k = 0 to ubound(myarr) - 1 minindex = k for j= k+1 to ubound(myarrdato) if myarrdato(j) > myarrdato(minindex) then minindex = j end if next tmp = myarr(k) myarr(k) = myarr(minindex) myarr(minindex) = tmp tmp2 = myarrdato(k) myarrdato(k) = myarrdato(minindex) myarrdato(minindex) = tmp2 next
end function
antal = 0 start = request.querystring(\"start\") if start = \"\" then start = 0 end if
Set fs = CreateObject(\"Scripting.FileSystemObject\") Set f = fs.GetFolder(server.mappath(\".\")) Set fc = f.Files thisfile = right(request.servervariables(\"script_name\"), len(request.servervariables(\"script_name\")) - instrrev(request.servervariables(\"script_name\"), \"/\")) For Each billed in fc
if billed.name <> thisfile then arrayBuild = arrayBuild & billed.name & \"|\" arraybuild2 = arraybuild2 & billed.datelastmodified & \"|\" end if next arrayBuild = left(arrayBuild, (len(arrayBuild) - 1)) myArray = Split(arrayBuild, \"|\") myArray2 = Split(arrayBuild2, \"|\")
call sortArr(myArray, myarray2)
Antalsider = int(ubound(myarray) / 6)
for i = start to (start + 5) if not i >= ubound(myarray) then
if antal = 0 then Response.Write \"<TR>\" end if %> <td><center> <a href=\"<%=request.servervariables(\"script_name\")%>?action=viewbig&pic=<%=myarray(i)%>\"><IMG SRC=\"<%=myarray(i)%>\" alt=\"Klik på billedet for at se den i den størrelse som det bliver sendt i...\" WIDTH=\"150\" HEIGHT=\"150\" border=\"0\"></a><br> </center></td> <% end if
if antal = 2 then Response.Write \"</TR>\" antal = 0 else antal = antal + 1 end if next
%> </table> <% if ubound(myarray) > start + 6 then response.write(\"<a href=\'\"&request.servervariables(\"script_name\")&\"?start=\" & (start + 6) & \"\' style=\'color: #000000\'>Næste side</a>\") end if
if start <> 0 then response.write(\"<a href=\'\"&request.servervariables(\"script_name\")&\"?start=\" & (start - 6) & \"\' style=\'color: #000000\'>Forrige side</a>\") end if %> <%end if%> </body>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.