Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di M@sE
    Registrato dal
    Oct 2001
    Messaggi
    488

    PhotoAlbum.asp (freeasp.html.it) problemi..

    Ciao a tutti ragazzi, mi chiedevo se qualcuno di voi sa dirmi come cambiare la mapPATH dell'esecuzione di questo script, in quanto è da alcune ore che tento con scarsi risultati.

    Vorrei che lo script non puntasse sulla root principale del sito, ma bensì su: public/gallerie

    Questo è lo script mi fate capire come faccio a cambiare la map path?

    ops sto su ARUBA IIS6 (win2003).

    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 = "default.asp?go=gallery"
    PopFile = "ShowPicture.asp"
    %>
    <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=640,height=480,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=yes,toolbars=no,menubar=no,resizable=yes')
    }
    // done hiding -->
    </script>
    
    <p align="center"><font color="#FF0000"><u>SEZIONE AL MOMENTO NON 
    DISPONIBILE</u></font></p>
    
    <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 %>">
      
    
    Selezionare Album Fotografico:
      <select name="go" onChange="jumppage(this);" size=1>
      <% 
      ShowSub = request("ShowSub")
      ShowPic = request("ShowPic")
      'strPathInfo = Request.ServerVariables("PATH_INFO") 
      
      strPathInfo = Request.ServerVariables("PATH_INFO") 
      strPhysicalPath = Server.MapPath(strPathInfo)
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      Set objFile = objFSO.GetFile(strPhysicalPath) 
      
    'Get this folder
    	'FolderPath=Request.ServerVariables("APPL_PHYSICAL_PATH") & "articles"
    	'Set objFolder = objFS.GetFolder(FolderPath)
    	'Set objFiles = objFolder.Files
    
    
      
      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(cartella & 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>
      </form>
      </td>
    </tr>
    </table>
    
    </p>
    <%
    If ShowPic > " " then
      ShowPic = Replace(ShowPic, " ", "%20")
      Response.Write "<a href='JavaScript:history.go(-1)'>[img]" & ShowPic & "[/img]
    
    <font face=""verdana"" size=""1"">Indietro</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'>Pagina:"
    		For x = 1 to intTotPages
    			If x = intPage Then
    				Response.Write "" & x & ""
    			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=""Javascript: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
      %>
    GRazie in anticipo

  2. #2
    basta fare

    codice:
    server.mappath("/public/gallerie/file.jpg")
    Purtroppo bisogna imparare che il computer non sbaglia...fa solo quello che gli dici di fare

    www.netpolaris.it

  3. #3
    Utente di HTML.it L'avatar di M@sE
    Registrato dal
    Oct 2001
    Messaggi
    488
    Grazie per la risposta, ma non si tratta di un singolo file ma di una dir, io ho provato a cambiare:

    strPathInfo = Request.ServerVariables("PATH_INFO")
    strPhysicalPath = Server.MapPath(strPathInfo)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.GetFile(strPhysicalPath)

    'mio

    Set objFolder = objFSO.GetFolder(Server.MapPath("public/gallerie/"))

    'script

    'Set objFolder = objFile.ParentFolder

    'ed anche

    Set objFolderContents = objFolder.Files
    For each Folder in objFolder.SubFolders

    (COSI' FUNZIONA MA HO QUALCHE PROBLEMA NELLA VISUALIZZAZIONE)

    se qualcuno ha fatto modifiche su questo script mi dia una mano :P

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.