Photo Gallery
<%
xAlbumID = CheckSQL(request("AlbumID"))
'================ Connection to Gallery Albums
Dim rs, SQL
Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * From Gallery_Albums "
If xAlbumID <> "" Then
SQL = SQL & " WHERE ID = " & xAlbumID
End If
SQL = SQL & " order by DateCreated Desc"
rs.Open CheckSQL(SQL), Conn, 1, 3
Dim picCount
picCount = 1
If xAlbumID <> "" Then
Dim rs2, SQL2
Set rs2 = Server.CreateObject("ADODB.Recordset")
SQL2 = "SELECT * FROM Gallery_Photos where Album = " & xAlbumID
rs2.Open CheckSQL(SQL2), Conn, 1, 3
AlbumDir = rs("DirectoryName")%>
<%Else
'Display all of the Albums
%>
| Click on an Event Photo Album below to view pictures. |
<% If rs.recordcount = 0 Then%>
| There are no Albums Created at this time |
<% End If
Dim rs1, SQL1
Set rs1 = Server.CreateObject("ADODB.Recordset")
Do While Not rs.EOF
'Get Default Image
SQL1 = "SELECT * From Gallery_Photos "
If rs("DefaultPhoto") <> "" Then
SQL1 = SQL1 & " Where ID = " & rs("DefaultPhoto")
Else
SQL1 = SQL1 & " WHERE Album = " & rs("ID")
End if
SQL1 = SQL1 & " ORDER BY id"
rs1.Open CheckSQL(SQL1), Conn, 1, 3
If rs1.EOF Then
SQL1 = "SELECT * From Gallery_Photos WHERE Album = " & rs("ID") & " ORDER BY ID"
rs1.close
rs1.Open CheckSQL(SQL1), Conn, 1, 3
End if
If Not rs1.EOF Then
DefaultPhoto = rs("DirectoryName") & "/" & rs1("thumbnail")
Else
DefaultPhoto = "icon_noimage.gif"
End If
rs1.close
If piccount = 1 Then%>
<%End If%>
|
|
<%If picCount = 3 Then%>
| |
<% picCount = 1
Else
picCount = picCount + 1
End if
rs.MoveNext
Loop
%>
<%End if%>
|