Author |
Topic |
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 29 March 2002 : 20:05:12
|
Thanks - I updated my demo site and zipfile with a few changes to your code - thanks again... |
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
|
suhern
Junior Member
186 Posts |
Posted - 30 March 2002 : 00:25:54
|
Just to share this, I simplify the popup (ShowPictureShow.asp) to:
<html> <head> <title>Selected Photo</title> </head> <body>
<center> <% ShowPic = request("ShowPic") %> <font face="<%= strDefaultFontFace %>" size="<% =strFooterFontSize %>"><b><%=ShowPic %></b><br><br> <% ShowPic = Replace(ShowPic, " ", "%20") Response.Write "<img src='" & ShowPic & "' border=2><BR>" response.write "<br><br><font size='2'><a href='JavaScript:onClick= window.close()'><font color='#800080'>Close Window</font></A></font>" %> </center> </body> </html>
I ommitted the inclusion of the inc_files since the pop is going to be closed after viewing.
|
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 30 March 2002 : 11:34:15
|
More simple, the better - demo and zipfile updated (with minor changes)
Thanks...
Edited by - wii on 30 March 2002 11:34:46 |
|
|
Sblue
Starting Member
USA
15 Posts |
Posted - 31 March 2002 : 20:13:37
|
How would you go about changing the file so that the file mname does not appear? I would just like to have the pic, and no title on the main screen. The title is fine on the popup.
Great job on this guys. I would love to see this integrated with the Links Mod to allow an administrable gallery with a full ratings system and all the bells. We can alway wish, can't we?
Blue Skies, Shawn
|
|
|
Sblue
Starting Member
USA
15 Posts |
Posted - 04 April 2002 : 16:19:50
|
I would like to remove the name from displaying next to the pics on the main page. Can anyone help with this?
Thanks, Shawn
Nevermind....I figures it out myself, and made it 4 pics wide per page. Thanks for this MOD, it rocks.
Edited by - sblue on 04 April 2002 22:17:46 |
|
|
fgenus
Starting Member
12 Posts |
Posted - 16 April 2002 : 16:16:28
|
quote:
It is great script. Is there a way to have pagination since in my usage I envisage that I may have many photos in a folder.
I've just completed modifications to showpicture.asp to support multiple pages. To change the number of pictures per row, just modify the variable intPicsPerRow. To change the number of pictures per page, modify the variable intPicsPerPage. I've tried this with the pics in the "Images" folder (which has close to 300 images) and it works great.
For those interested, Here are the code changes...
First, Just below the line CurFile = "ShowPictureShow.asp" (around line 11) insert the following code...
'********** BEGIN Pagination Modifications ************** ' ** This is new code to be inserted into the script **
Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage, strPicArray() intPicsPerRow = 4 intPicsPerPage = 8
intPage = CInt(Request.QueryString("Page")) If intPage = 0 Then intPage = 1 End If
'********** END Pagination Modifications **************
Next, Just below the line Set objFolderContents = objFolder.Files (around line 106 once you've added the above lines of code) insert the following code...
'********** BEGIN Pagination Modifications ************** ' ** This is new code to be inserted into the script **
'Get the number of pictures in the subdirectory & set the dimensions of the array 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 Redim strPicArray(2,intTotPics)
'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
'Store picture file names along with their page numbers in a two dimensional 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='Arial' size='1'>PAGE: " For x = 1 to intTotPages Response.Write "<a href='ShowPicture.asp?Page=" & x & "&ShowSub=" & ShowSub & "'>" & x & "</a> " Next Response.Write "</font></td>" Response.Write "</tr><tr><td> </td></tr><tr>" End If
'********** END Pagination Modifications **************
Finally, Look for the line For Each objFileItem in objFolderContents (around line 147 once you've added the above lines of code) and replace everything from the "For" statement through the "Next" statement with the following code...
'********** BEGIN Pagination Modifications ************** ' ** This is modified code that replaces existing code in the script **
For x = 0 to UBound(strPicArray,2)-1 ' Only display pictures that match the memvar "intPage" 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 "<br>" Response.Write("<img src='" & ShowSub & "/" & strPicArray(0,x) & "' width=150> ") Response.Write("<br><font color=""" & strBaseFontColor & """><b>" & Mid(strPicArray(0,x),1,Len(strPicArray(0,x))-4) & "</b></font>") Response.write "</a></td>" & vbcrlf
PictureNo = PictureNo + 1 If PictureNo=intPicsPerRow Then Response.write "</tr><tr>" PictureNo = 0 End if End If Next
'********** END Pagination Modifications **************
Hope it works as well for you as it does for me. Good luck!
- Frank
Edited by - fgenus on 16 April 2002 16:31:00 |
|
|
suhern
Junior Member
186 Posts |
Posted - 17 April 2002 : 01:54:18
|
Thanks for the pagination. It is great and very useful. thanks..
|
|
|
Sblue
Starting Member
USA
15 Posts |
Posted - 22 May 2002 : 10:52:02
|
I have had this up and running and love this MOD. There is one thing that I cannot however get to work (besides pagination). I can not get the inc_top to fuction withing the gallery. I have the Gallery folder withing the Forum folder, and have showpicture set up with the following at the top:
<!--#INCLUDE VIRTUAL="/Forum/config.asp" --> <!--#INCLUDE VIRTUAL="/Forum/inc_functions.asp" --> <!--#INCLUDE VIRTUAL="/Forum/inc_top.asp" -->
The page displays, but none of the graphics files load, and all of the links have incorrect addresses such that /Gallery/ is inserted into the address.
I am sure that this is something simple that I am just overlooking. I am using version 3.0.3 and not a portalized site.
Thanks in advance, Shawn
|
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 22 May 2002 : 13:11:27
|
Try using this instead:
<!--#INCLUDE FILE="/Forum/config.asp" --> <!--#INCLUDE FILE="/Forum/inc_functions.asp" --> <!--#INCLUDE FILE="/Forum/inc_top.asp" --> |
|
|
Sblue
Starting Member
USA
15 Posts |
Posted - 22 May 2002 : 16:36:50
|
No luck....
Get the error message:
Active Server Pages error 'ASP 0130'
Invalid File attribute
/Forum/Gallery/showpicture.asp, line 1
File attribute '/Forum/config.asp' cannot start with forward slash or back slash.
|
|
|
fgenus
Starting Member
12 Posts |
Posted - 26 May 2002 : 22:48:43
|
Try downloading this version of it...
http://216.119.80.53/downloads/PhotoAlbum.zip
I've made changes to allow you to put it in a subdirectory under the /forums directory (such as /forums/photos/). Then create subdirectories under that to store each group of pictures.
This version also includes mods to support pagination.
Peace,
- Frank.
Edited by - fgenus on 26 May 2002 22:54:12 |
|
|
nealc
Starting Member
USA
11 Posts |
Posted - 29 May 2002 : 02:56:19
|
It looks great. See the picture gallery in action at: http://www.nealc.com
This is an awesome script.
nealc
|
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 29 May 2002 : 06:34:48
|
I edited my code with the new changes - thanks for the help.
|
|
|
realprotek
Starting Member
USA
11 Posts |
Posted - 05 June 2002 : 12:09:54
|
Can anyone lend a hand with this? url to forum http://www.merebagofshells.com/forum/
url to photo script http://www.merebagofshells.com/forum/gallery/PhotoAlbum.asp
photo files are /web/forum/gallery/ (2 folders-photo1 and photo2)
script files /web/forum/gallery/
snitz directory /web/forum/
root directory /web/
Code in photoalbum
quote: <!--#INCLUDE FILE="..\config.asp" --> <!--#INCLUDE FILE="..\inc_functions.asp" --> <% strImageURL = "..\gallery\" & strImageURL %> <% strTitleImage = "" & strTitleImage %> <% strTitleImage800 = "..\" & strTitleImage800 %> <% strForumPATH = "..\" %> <% strCookieURL = left(strCookieURL,len(strCookieURL)-1) %> <% strCookieURL = left(strCookieURL,InStrRev(strCookieURL,"/")-1) & "/" %> <% intSideMenu = "0" %> <!--#INCLUDE FILE="..\inc_top.asp" -->
I am on an NT Machine. The Forum itself is running fine, but having probs with the album. All the links in the Album at the top are not correct. The "top" and "login, logout images" aren't showing up.
Trying to teach myself asp and hitting "the wall". I would greatly appreciate a hand.
Edited by - realprotek on 05 June 2002 20:17:11 |
|
|
Topic |
|