%@ LANGUAGE="VBScript"%>
<%
Option Explicit
Sub ShowCredits() %>
<%
End Sub
'--------
'What's new in v2.0?
'1) Now this script allows comments.
' If you want to add comments for a pic, only put in the same folder of the pic a text file with your comments in it.
' The text file must have the same name of the picture and the extension : .txt.
' Ej: pic: bertin_in_the_beach.jpg; text file with comments (located in the same folder): bertin_in_the_beach.txt
'2) Cosmetic change
' Now with the folder icon
'What's new in v2.1?
'1) Allow visitor change number of pics per row.
'2) Allow visitor to enter comments (xml format)
'3) Cosmetic changes
'---------------------
'CONFIGURATION. EDIT ONLY THIS PART
'===========================================================================================================
Const cVirtualPath="/Galleries/Birds/" 'THIS IS THE IMAGES FOLDER TO EDIT
Const cPageTitle="Birds Gallery" 'THIS IS THE PAGE TITLE TO EDIT
'===========================================================================================================
Const cWidthThumbnails=100 '40 ' Thumbnail's width
Const cFirstPageText="Welcome to my Galleries.
Select a folder from the list above and the thumbnails will be displayed here. Clicking a thumbnail will open the main image to the right"
Const cNumberPicturesPerRowDefault=1 'set the default number of thumbails per row.
Const WritableXMLCommentsFolder="d:\html\users\iloirecom\xml\comments\"
Const cAllowUserEnterComments=false 'true 'allow visitor to add comments to the pics. You will need write access permit to comments file!
Const cAllowUserChangePicturePerRow=false 'allow visitor to change the number of pictures he visualize per row
'END CONFIGURATION
Dim strThispage
strThispage= Request.ServerVariables ("SCRIPT_NAME")
Sub UserCommentsEngine ()
Dim link,commentsList,objXML,comment,objXMLcomment,FileLocation
FileLocation=WritableXMLCommentsFolder & replace(request("Filename"), right(request("Filename"),4),".xml")
'FileLocation=Server.MapPath(replace(request("Item"), right(request("Item"),4),".xml"))
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
If objXML.load(Filelocation) = False Then
objXML.appendChild(objXML.createProcessingInstruction("xml","version=""1.0"""))
objXML.appendChild(objXML.createElement("comments"))
End If
link=strthispage & "?action=displayimage&Filename=" & request("Filename") & "&Item=" & request("Item")
'create html code to enter comments
if request("write")="yes" then
prt "
| " if cAllowUserChangePicturePerRow=true then Prt(" | ") if cAllowUserChangePicturePerRow=true then Prt("Pics per row:") Prt "
| Galleries Home | " ' EDIT THE URL HERE TO POINT TO THE FLASH VERSION IF NEEDED, IF IT'S ALWAYS INDEX.HTML THEN NO NEED TO EDIT '=========================================================================================================== Prt "Flash version | " '=========================================================================================================== Prt "
| ")
Prt(" ") Prt ("
File name: " & request("Filename") & " "
' MODIFIED TO ONLY DISPLAY Author Comments header IF IT ISN'T THE FOLDER INFO PAGE
if request("Filename") <> "00-folder_info_std.jpg" then
Prt (" | |
Author comments ")
Else
Prt (" | |
")
End If
Prt " " & GetComment (request("item")) & "" if cAllowUserEnterComments then Prt " Visitor Comments "
if cAllowUserEnterComments then Call UserCommentsEngine()
if cAllowUserEnterComments then Prt (" |