Best way to add a bunch of photos to a cell of a table?

R

Richard

Hi All,

I thought I read somewhere the M.S. had add some tool expressly for
this purpose to F.P. 2003, though I can't find it now. It's name was
something like ws_???? and runs client-side I think.

If I can't find that, I'll have to resort to putting the pictures in
an image file on the server and writing come C# to loop through the
image file and take it from there.

Any ideas, links to sites that deal with this question?

TIA,
Richard
 
N

Nicholas Savalas - http://savalas.tv

Dear Richard,

Running on a Windows server? Consider using the FileSystem Object. I
haven't got time for a groovy long explanation; I'll just give you some
code.

Let's say you wanted to show every picture inside every folder inside a
folder you named: 'gallery'. OK - create the folder /gallery, and
underneath it, make several folders, say, January, February, etc...

Inside your top folder '/gallery', make a page called 'photoalbum.asp'.
Here is the code for that page:

--------------------------------

<%
Dim CurFile, PopFileShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath
Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage,
strPicArray()
intPicsPerRow = 2 'change to # of pics per row you want
intPicsPerPage = 4 'change to # of pics you want per page
intPage = CInt(Request.QueryString("Page"))
If intPage = 0 Then
intPage = 1
End If
CurFile = "photoalbum.asp"
PopFile = "showpicture.asp"
%>

<html>

<head>
<title>blablabla</title>
<meta name="keywords" content="blablabla">
<meta name="description" content="blablabla">

<script language="JavaScript">
function jumppage(sel)
{
var i = sel.selectedIndex
self.location.href = sel.options.value
}
</script>
<script language="JavaScript">
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 = 320, yMax=240;
var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
var xOffset = 100, yOffset = 100;

popupWin =
window.open(url,'new_page','width=100,height=100,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=no,toolbars=no,menubar=no,resizable=no')
}
</script>

</head>

<body>

<table>
<tr>
<td>
<form action="<%=PopFile%>" method="POST">
<p>
<font face="<%= strDefaultFontFace %>" size="<%
=strFooterFontSize %>" color="<% =strBaseFontColor %>">
<br>
</font><font face="Arial,Helvetica"><b>Select a Photo Gallery to
view:</b></font><font face="<%= strDefaultFontFace %>" size="<%
=strFooterFontSize %>" color="<% =strBaseFontColor %>">
<select name="go" onChange="jumppage(this);" size="1"
style="font-family: Arial,Helvetica; font-size: 10pt">
<%
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></p>
<h3></h3>
</form>
</font></td>
</tr>
</table>
<%
If ShowPic > " " then
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<font face=""Arial,Helvetica"" size=""1""><b><a
href='JavaScript:history.go(-1)'><img src='" & ShowPic & "'><BR><BR>Go
Back</b></a>"
Else
%>
<table>
<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
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
If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then
intTotPages = int(intTotPics/intPicsPerPage)
Else
intTotPages = int(intTotPics/intPicsPerPage)+1
End If
Redim strPicArray(2,intTotPics)

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

If intTotPages > 1 Then
Response.Write "<td colspan='" & intPicsPerRow & "'
align='center'><b><font face='Arial,Helvetica,Helvetica' size='2'
color='00ff00'>Pages:&nbsp;&nbsp;&nbsp;</font>"
For x = 1 to intTotPages
If x = intPage Then
Response.Write "<font face='Arial,Helvetica' size='2'>" & x &
"</font>&nbsp;&nbsp;&nbsp;&nbsp;"
Else
Response.Write "<font face='Arial,Helvetica,Helvetica' size='2'><a
href='photoalbum.asp?Page=" & x & "&ShowSub=" & ShowSub & "'>" & x &
"</a>&nbsp;&nbsp;&nbsp;&nbsp;"
End If
Next
Response.Write "</font></b></td>"
Response.Write "</tr><tr></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 style=font-size: 8pt; font-family:
Arial,Helvetica; color: #FF0000; background-color:#000000
align='center' width='25%'><a href=""Javascript:eek:penGalleryWindow('" &
PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')"""
Response.write "<br>"
Response.Write("<img src='" & ShowSub & "/" & strPicArray(0,x) & "'
height=100> ")
Response.Write("<br><font color=""" & strBaseFontColor & """
size='1'><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



Set objFSO = Nothing
End if
%>
</tr>
</table>
<%
End if
%> </center></td>
</tr>
</table>

</body>
</html>

----------------------------------

Then, in that same /gallery folder, create a page called
'showpicture.asp' - here is the code for that page:

----------------------------------

<html>
<head>
<title>View Picture</title>

<script LANGUAGE="JavaScript">

<!-- Begin
var isNav4, isIE4;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
function fitWindowSize() {
if (isNav4) {
window.innerWidth = document.layers[0].document.images[0].width;
window.innerHeight = document.layers[0].document.images[0].height;
}
if (isIE4) {
window.resizeTo(320, 240);
width = (320 - (document.body.clientWidth - document.images[0].width))
+ 10;
height = (240 - (document.body.clientHeight -
document.images[0].height)) + 25;
window.resizeTo(width, height);
}
}
// End -->
</script>

</head>

<body onLoad="fitWindowSize()">

<center>
<%
ShowPic = request("ShowPic")
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<img src='" & ShowPic & "' border=0><BR>"
response.write "<b><font style='Verdana' size='1'><a
href='JavaScript:eek:nClick= window.close()'><font color='#FF0000'>Close
Window</font></b></A></font>"
%> </center>

</body>

</html>

-----------------------------

Customize as you'd like. Now go look at it in a browser. Here is my
example:

http://savalas.tv/gallery/photoalbum.asp

OK - my code is a bit sloppy, but you get the idea - just add photos to
the sub folders of /gallery, and they appear -like magic! All of the
names in the drop down menu is just THE NAMES OF THE FOLDERS under
/gallery, and the names of the titles are THE NAMES OF THE PICTURES
THEMSELVES. Cool, huh?

Someone gave me this code when I was starting out, on the promise that
I pass it along to the next person who asked. Promise kept. Good luck,
Richard.

Nicholas Savalas - http://savalas.tv

-------------------------------
 
R

Richard

Hi Nicholas,

Someone gave me this code when I was starting out, on the promise that
I pass it along to the next person who asked. Promise kept. Good luck,

Sending the code was very kind of you. It reminds me of the movie, Pay
It Forward, whose theme I really like.
OK - my code is a bit sloppy ...

Sloppy or not (and I just glanced at it a moment ago), it will do for
me what Chairman Mao tried to do for China: take a great leap forward.
:)

So, please accept my heartfelt thanks for your code and comments.
I'll try to pass some code along to someone in the future to keep the
spirit alive.

I did visit your website and like the effects you created. I assume
from your name that Telly (sp?) was your (grand-) father/uncle. I
enjoyed his cops-and-robbers work when it orignally aired.

Best wishes,
Richard

Dear Richard,

Running on a Windows server? Consider using the FileSystem Object. I
haven't got time for a groovy long explanation; I'll just give you some
code.

Let's say you wanted to show every picture inside every folder inside a
folder you named: 'gallery'. OK - create the folder /gallery, and
underneath it, make several folders, say, January, February, etc...

Inside your top folder '/gallery', make a page called 'photoalbum.asp'.
Here is the code for that page:

--------------------------------

<%
Dim CurFile, PopFileShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath
Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage,
strPicArray()
intPicsPerRow = 2 'change to # of pics per row you want
intPicsPerPage = 4 'change to # of pics you want per page
intPage = CInt(Request.QueryString("Page"))
If intPage = 0 Then
intPage = 1
End If
CurFile = "photoalbum.asp"
PopFile = "showpicture.asp"
%>

<html>

<head>
<title>blablabla</title>
<meta name="keywords" content="blablabla">
<meta name="description" content="blablabla">

<script language="JavaScript">
function jumppage(sel)
{
var i = sel.selectedIndex
self.location.href = sel.options.value
}
</script>
<script language="JavaScript">
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 = 320, yMax=240;
var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
var xOffset = 100, yOffset = 100;

popupWin =
window.open(url,'new_page','width=100,height=100,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=no,toolbars=no,menubar=no,resizable=no')
}
</script>

</head>

<body>

<table>
<tr>
<td>
<form action="<%=PopFile%>" method="POST">
<p>
<font face="<%= strDefaultFontFace %>" size="<%
=strFooterFontSize %>" color="<% =strBaseFontColor %>">
<br>
</font><font face="Arial,Helvetica"><b>Select a Photo Gallery to
view:</b></font><font face="<%= strDefaultFontFace %>" size="<%
=strFooterFontSize %>" color="<% =strBaseFontColor %>">
<select name="go" onChange="jumppage(this);" size="1"
style="font-family: Arial,Helvetica; font-size: 10pt">
<%
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></p>
<h3></h3>
</form>
</font></td>
</tr>
</table>
<%
If ShowPic > " " then
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<font face=""Arial,Helvetica"" size=""1""><b><a
href='JavaScript:history.go(-1)'><img src='" & ShowPic & "'><BR><BR>Go
Back</b></a>"
Else
%>
<table>
<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
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
If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then
intTotPages = int(intTotPics/intPicsPerPage)
Else
intTotPages = int(intTotPics/intPicsPerPage)+1
End If
Redim strPicArray(2,intTotPics)

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

If intTotPages > 1 Then
Response.Write "<td colspan='" & intPicsPerRow & "'
align='center'><b><font face='Arial,Helvetica,Helvetica' size='2'
color='00ff00'>Pages:&nbsp;&nbsp;&nbsp;</font>"
For x = 1 to intTotPages
If x = intPage Then
Response.Write "<font face='Arial,Helvetica' size='2'>" & x &
"</font>&nbsp;&nbsp;&nbsp;&nbsp;"
Else
Response.Write "<font face='Arial,Helvetica,Helvetica' size='2'><a
href='photoalbum.asp?Page=" & x & "&ShowSub=" & ShowSub & "'>" & x &
"</a>&nbsp;&nbsp;&nbsp;&nbsp;"
End If
Next
Response.Write "</font></b></td>"
Response.Write "</tr><tr></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 style=font-size: 8pt; font-family:
Arial,Helvetica; color: #FF0000; background-color:#000000
align='center' width='25%'><a href=""Javascript:eek:penGalleryWindow('" &
PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')"""
Response.write "<br>"
Response.Write("<img src='" & ShowSub & "/" & strPicArray(0,x) & "'
height=100> ")
Response.Write("<br><font color=""" & strBaseFontColor & """
size='1'><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



Set objFSO = Nothing
End if
%>
</tr>
</table>
<%
End if
%> </center></td>
</tr>
</table>

</body>
</html>

----------------------------------

Then, in that same /gallery folder, create a page called
'showpicture.asp' - here is the code for that page:

----------------------------------

<html>
<head>
<title>View Picture</title>

<script LANGUAGE="JavaScript">

<!-- Begin
var isNav4, isIE4;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
function fitWindowSize() {
if (isNav4) {
window.innerWidth = document.layers[0].document.images[0].width;
window.innerHeight = document.layers[0].document.images[0].height;
}
if (isIE4) {
window.resizeTo(320, 240);
width = (320 - (document.body.clientWidth - document.images[0].width))
+ 10;
height = (240 - (document.body.clientHeight -
document.images[0].height)) + 25;
window.resizeTo(width, height);
}
}
// End -->
</script>

</head>

<body onLoad="fitWindowSize()">

<center>
<%
ShowPic = request("ShowPic")
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<img src='" & ShowPic & "' border=0><BR>"
response.write "<b><font style='Verdana' size='1'><a
href='JavaScript:eek:nClick= window.close()'><font color='#FF0000'>Close
Window</font></b></A></font>"
%> </center>

</body>

</html>

-----------------------------

Customize as you'd like. Now go look at it in a browser. Here is my
example:

http://savalas.tv/gallery/photoalbum.asp

OK - my code is a bit sloppy, but you get the idea - just add photos to
the sub folders of /gallery, and they appear -like magic! All of the
names in the drop down menu is just THE NAMES OF THE FOLDERS under
/gallery, and the names of the titles are THE NAMES OF THE PICTURES
THEMSELVES. Cool, huh?

Someone gave me this code when I was starting out, on the promise that
I pass it along to the next person who asked. Promise kept. Good luck,
Richard.

Nicholas Savalas - http://savalas.tv

-------------------------------

Hi All,

I thought I read somewhere the M.S. had add some tool expressly for
this purpose to F.P. 2003, though I can't find it now. It's name was
something like ws_???? and runs client-side I think.

If I can't find that, I'll have to resort to putting the pictures in
an image file on the server and writing come C# to loop through the
image file and take it from there.

Any ideas, links to sites that deal with this question?

TIA,
Richard
 
N

Nicholas Savalas - http://savalas.tv

Dear Richard,

I am looking over my original post, and like Mao Zedong, my code was a
bit Marxist (read: minimalist & idealistic). Here are some clean-up
tips:

1) Change all of the:

<script language="JavaScript">

to read:

<script type="text/javascript">

...because as any leader of revolutionary struggle and guerrilla warfare
will tell you, there is no such thing as 'language' without also
defining it's meaning - or 'type'.

2) Alter any lines like:

var xMax = 320, yMax=240;

to represent the values, in pixels, that you wish, like

var xMax = 640, yMax=480;

....because, like any cultural revolution, you never know how big it is
going to get.

3) Change all of the idiot code resembling:

<td style=font-size: 8pt; font-family: Arial,Helvetica; color: #FF0000;
background-color:#000000 align='center' width='25%'>

to read more like:

<td class='whatever'>

....and create a '.whatever' class in your attendant .css file, because,
like any "Great Leap Forward", there are bound to be 30 million dead of
starvation unless you recognize the different classes of things, and
accept as a given that the only way to control anything is to let it
control itself. True revolutionary webmasters call this use of .css
(stylesheets) as 'Representative Capitalism'.

4) Introduce a declaration of intent, like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

....before you start your Great HTML Struggle, like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >

....or else no browser will understand what you are talking about, and
your Leap Forward will be a Leap Backward, like what happened to the
good people of China.

Mao Zedong's thought is the reason that the people of China survived
the invasion by Japan, but also why they have the least amount of water
per capita of any nation on earth. The great people of China are a
world power now only because they have embraced, in an incomplete way,
the idea that power is communication. United States President Richard
Nixon told them that. Remember that the Internet, as introduced by
Vice-President Al Gore, is socialism at it's purest (notice the
association between tongue and cheek there?). Good luck in your
struggles, Richard, and remember to watch out for the possibility of a
'Autumn Harvest Uprising' when considering any 'Great Leap Forward'.

P.S.: Thank you for your kind comments about my beloved Uncle Telly.

Nicholas Savalas - http://savalas.tv

---------------------------------------------------------------
 
R

Richard

Hi Nicholas,

I started to work on this photo display but my high-speed internet
service was down, so I couldn't download your at the moment. So I
poked around in Front Page 2003 again. This time I found photo-gallery
and wound up generating code for .NET that worked pretty nicely for my
purposes. After studying your code and Microsoft's, I should be
pretty well up to speed.

Just wanted you to tell you about this alternative in case you decide
to upgrade your site in the future.

Best wishes,
Richard
Dear Richard,

Running on a Windows server? Consider using the FileSystem Object. I
haven't got time for a groovy long explanation; I'll just give you some
code.

Let's say you wanted to show every picture inside every folder inside a
folder you named: 'gallery'. OK - create the folder /gallery, and
underneath it, make several folders, say, January, February, etc...

Inside your top folder '/gallery', make a page called 'photoalbum.asp'.
Here is the code for that page:

--------------------------------

<%
Dim CurFile, PopFileShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath
Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage,
strPicArray()
intPicsPerRow = 2 'change to # of pics per row you want
intPicsPerPage = 4 'change to # of pics you want per page
intPage = CInt(Request.QueryString("Page"))
If intPage = 0 Then
intPage = 1
End If
CurFile = "photoalbum.asp"
PopFile = "showpicture.asp"
%>

<html>

<head>
<title>blablabla</title>
<meta name="keywords" content="blablabla">
<meta name="description" content="blablabla">

<script language="JavaScript">
function jumppage(sel)
{
var i = sel.selectedIndex
self.location.href = sel.options.value
}
</script>
<script language="JavaScript">
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 = 320, yMax=240;
var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
var xOffset = 100, yOffset = 100;

popupWin =
window.open(url,'new_page','width=100,height=100,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=no,toolbars=no,menubar=no,resizable=no')
}
</script>

</head>

<body>

<table>
<tr>
<td>
<form action="<%=PopFile%>" method="POST">
<p>
<font face="<%= strDefaultFontFace %>" size="<%
=strFooterFontSize %>" color="<% =strBaseFontColor %>">
<br>
</font><font face="Arial,Helvetica"><b>Select a Photo Gallery to
view:</b></font><font face="<%= strDefaultFontFace %>" size="<%
=strFooterFontSize %>" color="<% =strBaseFontColor %>">
<select name="go" onChange="jumppage(this);" size="1"
style="font-family: Arial,Helvetica; font-size: 10pt">
<%
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></p>
<h3></h3>
</form>
</font></td>
</tr>
</table>
<%
If ShowPic > " " then
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<font face=""Arial,Helvetica"" size=""1""><b><a
href='JavaScript:history.go(-1)'><img src='" & ShowPic & "'><BR><BR>Go
Back</b></a>"
Else
%>
<table>
<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
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
If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then
intTotPages = int(intTotPics/intPicsPerPage)
Else
intTotPages = int(intTotPics/intPicsPerPage)+1
End If
Redim strPicArray(2,intTotPics)

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

If intTotPages > 1 Then
Response.Write "<td colspan='" & intPicsPerRow & "'
align='center'><b><font face='Arial,Helvetica,Helvetica' size='2'
color='00ff00'>Pages:&nbsp;&nbsp;&nbsp;</font>"
For x = 1 to intTotPages
If x = intPage Then
Response.Write "<font face='Arial,Helvetica' size='2'>" & x &
"</font>&nbsp;&nbsp;&nbsp;&nbsp;"
Else
Response.Write "<font face='Arial,Helvetica,Helvetica' size='2'><a
href='photoalbum.asp?Page=" & x & "&ShowSub=" & ShowSub & "'>" & x &
"</a>&nbsp;&nbsp;&nbsp;&nbsp;"
End If
Next
Response.Write "</font></b></td>"
Response.Write "</tr><tr></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 style=font-size: 8pt; font-family:
Arial,Helvetica; color: #FF0000; background-color:#000000
align='center' width='25%'><a href=""Javascript:eek:penGalleryWindow('" &
PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')"""
Response.write "<br>"
Response.Write("<img src='" & ShowSub & "/" & strPicArray(0,x) & "'
height=100> ")
Response.Write("<br><font color=""" & strBaseFontColor & """
size='1'><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



Set objFSO = Nothing
End if
%>
</tr>
</table>
<%
End if
%> </center></td>
</tr>
</table>

</body>
</html>

----------------------------------

Then, in that same /gallery folder, create a page called
'showpicture.asp' - here is the code for that page:

----------------------------------

<html>
<head>
<title>View Picture</title>

<script LANGUAGE="JavaScript">

<!-- Begin
var isNav4, isIE4;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
function fitWindowSize() {
if (isNav4) {
window.innerWidth = document.layers[0].document.images[0].width;
window.innerHeight = document.layers[0].document.images[0].height;
}
if (isIE4) {
window.resizeTo(320, 240);
width = (320 - (document.body.clientWidth - document.images[0].width))
+ 10;
height = (240 - (document.body.clientHeight -
document.images[0].height)) + 25;
window.resizeTo(width, height);
}
}
// End -->
</script>

</head>

<body onLoad="fitWindowSize()">

<center>
<%
ShowPic = request("ShowPic")
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<img src='" & ShowPic & "' border=0><BR>"
response.write "<b><font style='Verdana' size='1'><a
href='JavaScript:eek:nClick= window.close()'><font color='#FF0000'>Close
Window</font></b></A></font>"
%> </center>

</body>

</html>

-----------------------------

Customize as you'd like. Now go look at it in a browser. Here is my
example:

http://savalas.tv/gallery/photoalbum.asp

OK - my code is a bit sloppy, but you get the idea - just add photos to
the sub folders of /gallery, and they appear -like magic! All of the
names in the drop down menu is just THE NAMES OF THE FOLDERS under
/gallery, and the names of the titles are THE NAMES OF THE PICTURES
THEMSELVES. Cool, huh?

Someone gave me this code when I was starting out, on the promise that
I pass it along to the next person who asked. Promise kept. Good luck,
Richard.

Nicholas Savalas - http://savalas.tv

-------------------------------

Hi All,

I thought I read somewhere the M.S. had add some tool expressly for
this purpose to F.P. 2003, though I can't find it now. It's name was
something like ws_???? and runs client-side I think.

If I can't find that, I'll have to resort to putting the pictures in
an image file on the server and writing come C# to loop through the
image file and take it from there.

Any ideas, links to sites that deal with this question?

TIA,
Richard
 
R

Richard

Hi Nicholas,

As happened often in the Old World of Snail Mail, our missives crossed
in the Ether, er, net. I had complosed an addendum to my last
response, went off to watch a French Open rerun, and then dispatched
the document. Following that, I discovered your newest post on this
thread.
Running on a Windows server?

I forgot to answer this original ques.: Yes, Win2006Srvr/SP1.
Mao Zedong

I'm retrograde: I still use the old transliteration: Mao tse Tung :)
my code was a bit Marxist (read: minimalist & idealistic)

Minimalism is good, given that bloated code is universally denegrated.
And idealistic is, well, ideal :)
Change all of the ...

I'm in sync with you on your improvements. And your tounge-in-cheek
asides are admirable. As I said in my other response, I'll be looking
at your code and what Front Page 2003 generates to work out my approach
in this area.

I'm a retired software engineer with a career primarily focused on
repairing/extending applications in business and government
environments. But I had no 'Net development experience. Now I've got
the hubris to dust off my consulting shingle by providing web training
and development services to small/medium businesses. I've got one
seminar lined up this month just to train people on how to put up a
personal webpage for family pictures/ whatever.

So most of my time is spent on coming up to speed in this technology.
Another is tutoring my wonderful, truly gifter, 13-yo grandson in
Mathematics 2.5 hrs/week. He goes along with this in good humor
because I pay for his cell phone usage.
Mao Zedong's thought is the reason that the people of China survived the invasion by Japan,

Yeah, but I'd give a lot of credit to the Americans who piloted all
those P-38s, if memory serves.
but also why they have the least amount of water per capita of any nation on earth.

I don't get that. Did he deforest the country or commit some other
ecological blunder?
Remember that the Internet, as introduced by Vice-President Al Gore, is socialism at it's purest (notice the association between tongue and cheek there?).

I see the humor, but I've always thought Gore was inartful in the way
he boasted of role in the Internet explosion. I think he was a major
force in the Senate's funding of DOD's Arpanet, etc. But I could be
all wet on this.
Good luck in your struggles, Richard, and remember to watch out for the possibility of a 'Autumn Harvest Uprising' when considering any 'Great Leap Forward'.
Thanks.

P.S.: Thank you for your kind comments about my beloved Uncle Telly.

You're welcome, and my condolences now that I learned that he, like
my mother, died of dreaded cancer. My mom had chemo and radiation
along with a mastectomy, and thought she beat it. But the C
matastisized to her liver a few years later. I was at her side in NYC
when she passed away. The one consolation was that she was ready and
at peace with the inevitable, or so it appeared to me.

Again, thanks for your guidance.

Best wishes,
Richard
 
N

Nicholas Savalas - http://savalas.tv

Dear Richard,

Actually, to clarify (so I am not chastized for lack of full disclosure
by the MVP-POWERS-THAT-BE), the code that I sent you is just the web
manipulation of the File.System Object, which has been used for years
(see http://microsoft.com/scripting ) and is presented in ASP script,
and not ASP.NET at all. FP-MVP's can get kind of touchy about this;
better to confess, up front, than face the wrath of their all-seeing
eyeball.

In response to: "I don't get that. Did he deforest the country or
commit some other ecological blunder?" that referred to my statement,
"...but also why they (the Chinese people) have the least amount of
water per capita of any nation on earth....", let me clarify.

Yes, the water issue in China was a shocker to me, too. Mao did turn a
great deal of forest into farmland, in a nation that already had one of
the smallest available quantities of fresh water per person.

China has 22 per cent of the world's population but only 7 per cent of
all freshwater runoff. China's freshwater supplies have been estimated
to be capable of supporting 650 million people on a sustainable basis -
far less than half the country's population. Despite periodic flooding,
particularly in the southern part of the country, China faces chronic
water shortages in the northern part. (please see:
http://www.nature.org/wherewework/greatrivers/asiapacific/art16184.html
and http://www.unep.org/vitalwater/ for more information). Watch for
news on how the coming Beijing Olympiad will be affected by this
incredible statistic. Actually, in the spirit of bi-partisanism, Al
Gore is a leader in alerting the public to this impending calamity.

You should NOT teach young people, like your Grandson, to use
FrontPage, by the way. They are inherently far more intelligent than we
are, and destined to take over the world anyway. Mark my words. Show a
13 year-old how to use FrontPage, and we'll all (MVP's included) be out
of a job within a month.

OK - all kidding aside, I am grateful that you mentioned the major role
of the heroic American pilots who risked, and often lost, their lives
in their valiant defense of China. My father served in that theater
during World War Two.

May I also extend, from myself and my family, our deepest and most
sincere condolences on the passing of your mother from that monster,
Cancer. My father, George Savalas, also died of Leukemia (blood cancer)
in 1985. We, as citizens of the world, should perhaps concentrate more
efforts on fighting the real killers - Cancer being the first on my
list - than on killing each other.

Good luck and God bless, Richard. You are on a very good track, and I
am proud to have chatted with you. Until I hear from you again, I
remain,

Most Sincerely,

Nicholas Savalas - http://savalas.tv

---------------------------------------------------
 
K

KatWoman

I survived breast cancer so far since 1989, I am one of the lucky ones. My
neighbor died from it around the same time.

I live in fear of it's return, such a silent and deadly illness....but we
are the lucky ones, the treatments for breast cancer have some of the best
survival rates. One of my good friends just died from colon cancer.

EVERYONE please get checked regularly.

and
just FYI, the Bushies are expert at spinning lies and Americans are finally
beginning to see them for what they are....(liars, hypocites and theives).
Too bad for us and Gore, this really decent, honest, hard-working and
intelligent man was denied the presidency.

http://www.perkel.com/politics/gore/internet.htm
But the real question is what, if anything, did Gore actually do to create
the modern Internet? According to Vincent Cerf, a senior vice president with
MCI Worldcom who's been called the Father of the Internet, "The Internet
would not be where it is in the United States without the strong support
given to it and related research areas by the Vice President in his current
role and in his earlier role as Senator."

The inventor of the Mosaic Browser, Marc Andreesen, credits Gore with making
his work possible. He received a federal grant through Gore's High
Performance Computing Act. The University of Pennsylvania's Dave Ferber says
that without Gore the Internet "would not be where it is today."

Joseph E. Traub, a computer science professor at Columbia University, claims
that Gore "was perhaps the first political leader to grasp the importance of
networking the country. Could we perhaps see an end to cheap shots from
politicians and pundits about inventing the Internet?"
 
R

Richard

Hi KatWoman,
I survived breast cancer so far since 1989, I am one of the lucky ones.

Congratulations. I know it couldn't have been easy.
But the real question is what, if anything, did Gore actually do to create the modern Internet?

Thanks a lot for all the references. I've often supported Gore's
reputation on this matter more with passion than with facts.
Hopefully, I'll do a better job next time, since I'll be better
"armed."

Regards,
Richard
 
K

KatWoman

re: Hopefully, I'll do a better job next time, since I'll be better
"armed."

Knowledge is POWER
keep up the good work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top