Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    ho bisogno di aiuto

    codice:
    <% 
    
    ' PhotoAlbum 
    
    Dim CurFile, PopFileShowSub, ShowPic, PictureNo 
    Dim strPathInfo, strPhysicalPath 
    
    
    Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage, strPicArray() 
    intPicsPerRow = 4 
    intPicsPerPage = 4 
    
    intPage = CInt(Request.QueryString("Page")) 
    If intPage = 0 Then 
    intPage = 1 
    End If 
    
    
    CurFile = "PhotoAlbum.asp" 
    PopFile = "ShowPicture.asp" 
    %> 
    <link rel="stylesheet" type="text/css" href="style.css"> 
    <script language="JavaScript"> 
    <!-- 
    function jumppage(sel) 
    { 
    var i = sel.selectedIndex 
    self.location.href = sel.options[i].value 
    } 
    // --> 
    </script> 
    <script language="JavaScript"> 
    <!-- hide from JavaScript-challenged browsers 
    function openGalleryWindow(url) { 
    if (document.all) 
    var xMax = screen.width, yMax = screen.height; 
    else 
    if (document.layers) 
    var xMax = window.outerWidth, yMax = window.outerHeight; 
    else 
    var xMax = 800, yMax=600; 
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2; 
    var xOffset = 100, yOffset = 100; 
    
    popupWin = window. open(url,'new_page','width=700,height=53
    5,screenX='+xOffset+',screenY='+yOffset+
    ',top='+yOffset+',left='+xOffset+',scrol
    lbars=auto,toolbars=no,menubar=no,resiza
    ble=yes') 
    } 
    // done hiding --> 
    </script> 
    
    <center> 
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="100%" id="AutoNumber1"> 
    <tr> 
    
    <td align="center" width="25%"> 
    <form action=<%=PopFile%> method="POST"> 
    <font face="<%= strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strBaseFontColor %>">Photo Album: 
    <select name="go" onChange="jumppage(this);" size=1> 
    <% 
    ShowSub = request("ShowSub") 
    ShowPic = request("ShowPic") 
    strPathInfo = Request.ServerVariables("PATH_INFO") 
    strPhysicalPath = Server.MapPath(strPathInfo) 
    
    Set objFSO = CreateObject("Scripting.FileSystemObject") 
    Set objFile = objFSO.GetFile(strPhysicalPath) 
    Set objFolder = objFile.ParentFolder 
    Set objFolderContents = objFolder.Files 
    For each Folder in objFolder.SubFolders 
    If Left(Folder.Name,1)<>"_" Then 
    Response.write "<option " 
    If ShowSub=Folder.Name Then 
    Response.Write "selected " 
    End if 
    Response.Write"value='" & CurFile & "?ShowSub=" 
    Response.Write(Replace(Folder.Name, " ", "%20")) 
    response.write "'>" 
    Response.Write(Folder.Name & "</option>") 
    If ShowSub <= " " Then 
    ShowSub = Folder.Name 
    End if 
    End if 
    Next 
    Set objFSO = Nothing 
    %> 
    </select></h3> 
    </form> 
    </td> 
    </tr> 
    </table> 
    
    
    <% 
    If ShowPic > " " then 
    ShowPic = Replace(ShowPic, " ", "%20") 
    Response.Write "<a href='java script:history.go(-1)'>[img]" & ShowPic & "[/img]
    
    <font face=""verdana"" size=""1"">Go Back</a>" 
    Else 
    %> 
    <table border="0" cellpadding="0" cellspacing="5" style="border-collapse: collapse" bordercolor="#000000" width="100%" id="AutoNumber1"> 
    <tr> 
    <% 
    strPhysicalPath = Server.MapPath(".\" & ShowSub) 
    If ShowSub > " " then 
    ShowSub = Replace(ShowSub, " ", "%20") 
    Set objFSO = CreateObject("Scripting.FileSystemObject") 
    Set objFolder = objFSO.GetFolder(strPhysicalPath) 
    Set objFolderContents = objFolder.Files 
    
    
    
    'Get the number of pictures in the subdirectory 
    intTotPics = 0 
    For Each objFileItem in objFolderContents 
    If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN 
    intTotPics = intTotPics + 1 
    End if 
    Next 
    
    'Get the total number of pages in the subdirectory 
    If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then 
    intTotPages = int(intTotPics/intPicsPerPage) 
    Else 
    intTotPages = int(intTotPics/intPicsPerPage)+1 
    End If 
    Redim strPicArray(2,intTotPics) 
    
    'Store picture file names in an array 
    x = 0 
    For Each objFileItem in objFolderContents 
    If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN 
    strPicArray(0,x) = objFileItem.Name 
    strPicArray(1,x) = Cstr(int(x/intPicsPerPage)+1) 
    x = x + 1 
    End if 
    Next 
    
    'Determine if there are multiple pages and if so, display page numbers. 
    If intTotPages > 1 Then 
    Response.Write "<td colspan='" & intPicsPerRow & "' align='center'><font face='Verdana,Arial' size='1'>Page: " 
    For x = 1 to intTotPages 
    If x = intPage Then 
    Response.Write "</font><font face='Arial' size='2'>" & x & "</font><font face='Arial' size='1'> " 
    Else 
    Response.Write "" & x & " " 
    End If 
    Next 
    Response.Write "</font></td>" 
    Response.Write "</tr><tr><td> </td></tr><tr>" 
    End If 
    
    
    For x = 0 to UBound(strPicArray,2)-1 
    If CInt(strPicArray(1,x)) = intPage Then 
    ShowPic = Replace(strPicArray(0,x), " ", "%20") 
    Response.write "<td align='center' width='25%'><a href=""java script:openGalleryWindow('" & PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')""" 
    Response.write "
    " 
    Response.Write("[img]" & ShowSub & "/" & strPicArray(0,x) & "[/img] ") 
    Response.Write("
    <font color=""" & strBaseFontColor & """>" & Mid(strPicArray(0,x),1,Len(strPicArray(0
    ,x))-4) & "</font>") 
    Response.write "</a></td>" & vbcrlf 
    
    PictureNo = PictureNo + 1 
    If PictureNo=intPicsPerRow Then 
    Response.write "</tr><tr>" 
    PictureNo = 0 
    End if 
    End If 
    Next 
    
    
    
    Set objFSO = Nothing 
    End if 
    %> 
    </tr> 
    </table> 
    <% 
    End if 
    %> 
    </center> 
    </html>
    mettendo molte immagini questo script visualizza l'elenco di tutte le pagine disponibili, in questo modo:

    1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 etc etc

    Io vorrei che fosse visualizzato in questo modo:

    << - 4 - 5 - 6 - >> dove 5 è la pagina in cui mi trovo

    chi sa come modificarlo?

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Complimenti per il titolo.
    Fortuna che non sei un novizio...

    Roby

  3. #3
    No, davvero... che senso ha quel titolo? Tutti quelli che scrivono qui hanno bisogno di aiuto!

  4. #4
    non so come racchiudere in un titolo breve con termini tecnici ciò che richiedo.. quindi metto un titolo generico

    ma anche le vostre risposte sono totalmente "fuori tema"..


  5. #5
    Potevi anche intitolarla "Paginazione record".
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  6. #6
    ok.
    Ormai però non posso cambiarlo io.. non so i moderatori.

  7. #7
    Cambia questo
    codice:
    'Determine if there are multiple pages and if so, display page numbers. 
    If intTotPages > 1 Then 
    Response.Write "<td colspan='" & intPicsPerRow & "' align='center'><font face='Verdana,Arial' size='1'>Page: " 
    For x = 1 to intTotPages 
    If x = intPage Then 
    Response.Write "</font><font face='Arial' size='2'>" & x & "</font><font face='Arial' size='1'> " 
    Else 
    Response.Write "" & x & " " 
    End If 
    Next 
    Response.Write "</font></td>" 
    Response.Write "</tr><tr><td> </td></tr><tr>" 
    End If
    in
    codice:
    'Determine if there are multiple pages and if so, display page numbers.
    Dim iMargin
    iMargin = 1
    If intTotPages > 1 Then 
      Response.Write "<td colspan='" & intPicsPerRow & "' align='center'><font face='Verdana,Arial' size='1'>Page: " 
      For x = intPage - iMargin to intPage + iMargin
        If x>0 and x<=intTotPages Then
          If x = intPage Then 
            Response.Write "</font><font face='Arial' size='2'>" & x & "</font><font face='Arial' size='1'> " 
          Else 
            Response.Write "" & x & " " 
          End If
        End If 
      Next 
      Response.Write "</font></td>" 
      Response.Write "</tr><tr><td> </td></tr><tr>" 
    End If
    Edit: aumenta o diminuisci "iMargin" per variare il numero di pagine visualizzate prima e dopo quella corrente

  8. #8
    ok.. va bene, però mancherebbero le << e >> prima e dopo i numeri, che siano sempre cliccabili, per far capire che ci sono anche altre pagine.

    In oltre gli sfondi vengono visualizzati con uno sfondo color blu che vorrei eliminare.

    Se potete aiutarmi..
    Cmq sia grazie mille della modifica!!!

  9. #9
    codice:
    'Determine if there are multiple pages and if so, display page numbers.
    Dim iMargin
    iMargin = 1
    If intTotPages > 1 Then 
      Response.Write "<td colspan='" & intPicsPerRow & "' align='center'><font face='Verdana,Arial' size='1'>Page: " 
      If (intPage - iMargin)>1 Then
        Response.Write "&lt;&lt; "
      End If
      For x = intPage - iMargin to intPage + iMargin
        If x>0 and x<=intTotPages Then
          If x = intPage Then 
            Response.Write "</font><font face='Arial' size='2'>" & x & "</font><font face='Arial' size='1'> " 
          Else 
            Response.Write "" & x & " " 
          End If
        End If 
      Next 
      If (intPage + iMargin)<intTotPages Then
        Response.Write "&gt;&gt; "
      End If
      Response.Write "</font></td>" 
      Response.Write "</tr><tr><td> </td></tr><tr>" 
    End If
    Per i colori devi cambiare gli attributi di stile HTML.

  10. #10
    ciao,

    ora va bene come visualizzazione, però cliccandoci sopra alle << o >> mi fa avanzare di una sola pagina.
    Mentre l'idea era quella di portare più pagine avanti.
    Es: <<-5-6-7-8-9->>
    in questo caso cliccando le freccine dovrebbe portare rispettivamente alla pag 4 e alla 10.

    In oltre se possibile modificare il modo in cui vengono elencate le foto. Ora sono dal nome più piccolo al più grande.. mi piacerebbe, per questioni di aggiornamento, elencarle dal più grande al più piccolo (101-100-099-098-...-050.. etc)

    Se ti va di modificarlo altrimente GRAZIE per quello fatto finora.

    Invece per i colori dei bordi degli sfondi, questi assumono il colore che attribuisco ai link, in quanto anche le anteprime hanno un link. Credo basterebbe diminuire il size di quei bordi.. sto andando a tentativi senza ottenere risultati..

    ciao.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.