Salve,
studiando il problema ho trovato la soluzione ma non sono riuscito nell'impresa di modificare il codice perche non conosco bene le variabili e le funzioni di asp.
Sareste gentilissimi se potreste fornirmi il piccolo aiuto di modificare il seguente codice.
In pratica il seguente codice:
serve per visualizzare l'ultima immagine inserita in una cartella web riconosciuta ultima dalla datacodice:<% set custRs = Server.CreateObject("ADODB.Recordset") custRs.Fields.Append "nome", 200, 300 ' adVarChar custRs.Fields.Append "dimensione", 2, 4 ' smallint custRs.Fields.Append "data", 7 ' Date custRs.Open ' popolamento Set FileObject = Server.CreateObject("Scripting.FileSystemObject") Set f = FileObject.GetFolder(strPath) For Each f1 in f.Files custRs.AddNew custRs("nome") = f1.name custRs("data") = f1.DateCreated Next Set f = Nothing Set FileObject = Nothing custRs.Sort = "data DESC" If Not custRS.EOF AND Not custRS.BOF Then nomefile = custRs("nome") Set FileObject = Server.CreateObject("Scripting.FileSystemObject") Set f = FileObject.getfile(StrPath&"\"&nomefile) he = ImageHeight(StrPathShort & nomefile) wi = ImageWidth(StrPathShort & nomefile) resized = ImageResize(StrPathShort & nomefile, 80, 80, "center") Response.Write "<tr><td align=""center"">Ultima immagine inserita: " & f.DateCreated & "</td></tr>" Response.Write "<tr><td align=""center"">" & vbcrlf & "<table width=""100%""><tr><td align=""center""><table cellspacing=""0"" cellpadding=""0"" style=""border: 1 solid #6699CC""><tr><td>" & resized & "</td></tr></table></td></tr><tr><td align=""center"">" & nomefile & " " & wi & "x" & he & "-" & f.size & "byte</td></tr></table></td></tr>" & vbcrlf Set f = Nothing Set FileObject = Nothing Else %> <tr><td align="center">Ultima immagine inserita</td></tr> <tr><td align="center"></td></tr> <tr><td align="center">Non ci sono immagini</td></tr> <tr><td align="center"></td></tr> <% End If %>
mentre il seguente codice visualizza a 4 a 4 tutte le immagini però in ordine inverso
quindi in definitiva mi servirebbe inserire il primo pezzo di codice nel secondo in modo che non vengano visualizzate tutte le immagini ordinate secondo la data.codice:<% Dim objFSO, objFolder, objFile Set objFSO = server.createobject("scripting.filesystemobject") Set objFolder = objFSO.getfolder(strpath) fileMAX = 8 intTotalFiles = objFolder.Files.Count If objFolder.Files.Count MOD fileMAX = 0 Then intTotalPages = Int(objFolder.Files.Count/fileMAX) Else intTotalPages = Int(objFolder.Files.Count/fileMAX)+1 End If %> <table border="0" width="550" cellspacing="0" cellpadding="0" bgcolor="#6699CC"> <tr> <td width="20">[img]images/angolosx.gif[/img]</td> <td width="510" align="center"><font size="2" face="Tahoma" color="#F7F7F7">Archivio (Immagini totali: <%=intTotalFiles%>)</font></td> <td width="20" align="right">[img]images/angolodx.gif[/img]</td> </tr> </table> <table border="0" width="550" cellspacing="0" cellpadding="0" bgcolor="#f7f7f7" style="border: 1 solid #6699CC"> <tr> <td> <table width="540" cellspacing="0" cellpadding="0"> <% If intTotalFiles > 0 Then col = 0 imagecounter = 1 If Request.QueryString("page").Count > 0 Then intPageNum = CInt(Request.QueryString("page")) Else intPageNum = 1 End If For Each objFile in objFolder.Files 'Response.Write imagecounter & "-" & (intPageNum*4)-3 & "-" & (intPageNum*4) &" " If (imagecounter >= (intPageNum*fileMAX)-(fileMAX-1)) And (imagecounter <= (intPageNum*fileMAX)) Then col = col + 1 If col = 1 Then Response.Write "<tr>" & vbcrlf he = ImageHeight(StrPathShort & objfile.name) wi = ImageWidth(StrPathShort & objfile.name) resized = ImageResize(StrPathShort & objfile.name, 100, 100, "center") Response.Write "<td align=""center"" width=""135"">" & vbcrlf & "<table width=""100%""><tr><td align=""center"" height=""110""><table cellspacing=""0"" cellpadding=""0"" style=""border: 1 solid #6699CC""><tr><td>" & resized & "</td></tr></table></td></tr><tr><td align=""center"">" & objfile.name & " " & wi & "x" & he & " " & objfile.size & "byte " & objFile.DateCreated & "</td></tr></table> " & vbcrlf & "</td>" & vbcrlf If col = 4 Then Response.Write "</tr>" & vbcrlf col = 0 End If 'If col > 4 Then col = 1 End If imagecounter = imagecounter + 1 'If imagecounter > fileMAX Then Exit For Next If col > 0 AND col < 4 Then For colonne = col+1 To 4 Response.Write "<td width=""135""></td>" & vbcrlf Next Response.Write "</tr>" & vbcrlf End If Else %> <tr><td align="center"></td></tr> <tr><td align="center">Non ci sono immagini</td></tr> <tr><td align="center"></td></tr> <% End If %>
Io ho fatto svariate prove sempre senza riuscirci perche non conosco le variabili e le funzioni di asp
Grazie in anticipo

Rispondi quotando
