DBPix Sample Source Code: catalogue_.asp Back to sample
<%@ LANGUAGE = VBScript %>
<%
if Request("catid") = "" then
Response.Redirect("index.asp")
end if
' Ensure that the client-browser doesn't cache
' In a production system you may wish to allow a short time here, depending on the frequency of updates
' and how you assign Id's
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.AddHeader "cache-control", "private"
Response.AddHeader " pragma", "no-cache"
Dim ImageId
Dim ImageH
Dim ImageW
Dim ThumbW
Dim ThumbH
ImageId = 0
ImageH = 0
ImageW = 0
%>
<html>
<head>
<title>DBPix Photo Catalogue Sample</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<!-- *** Defines various constants for VBScipt database operations *** -->
<!--#include file="adovbs.inc" -->
<!-- *** App specifig configuration, connect strings, database locations/DSN's etc *** -->
<!--#include file="config.inc" -->
</head>
<body background="images/backgrnd.gif" topmargin="0" leftmargin="0">
<div align="center"><center>
<table CELLPADDING="0" CELLSPACING="0" BORDER="0">
<tr>
<td width="5"></td>
<td ALIGN="CENTER" VALIGN="TOP"><p><a href="http://www.ammara.com" target="_blank"><img src="images/ammara.gif" width="311" height="34" alt="Ammara.gif (8056 bytes)" border="0" target="_blank"></a></p>
<p align="center"><font face="Arial" size="4" color="#003366"><strong>DBPix Photo Catalogue Sample</strong><br></font></p>
<%
Set cn = Server.CreateObject("ADODB.Connection")
Set picsset = Server.CreateObject("ADODB.Recordset")
cn.Open GetConnectString
sqlselect = "SELECT tcatalogs.* " &_
"FROM tcatalogs " &_
"WHERE tcatalogs.Id=" & Request("catid")
picsset.Open sqlselect, cn, adOpenForwardOnly, adLockReadOnly, adCmdText
if not picsset.EOF then
%>
<p align="center"><font face="Arial" size="4" color="#003366"><strong><%=picsset("summary")%></strong><br></font></p>
<%
end if
picsset.Close
%>
<p align="center"><font face="Arial" color="#003366" size="2"><strong><a href="./" border="0">Catalogue List</a></strong></font></p>
<p align="center"><font face="Arial" size="2" color="#003366"><strong><em>Click on images for a larger version.</em></strong></font></p>
</td>
</tr>
</table>
</center></div>
<br>
<div align="center"><center>
<table border="0" cellpadding="10" background="images/backgrnddk.gif">
<tr>
<td><div align="center"><center>
<%
sqlselect = "SELECT tphotos.* " &_
"FROM tcatalogs INNER JOIN tphotos ON tcatalogs.Id = tphotos.catalogid " &_
"WHERE (((tphotos.catalogid)=" & Request("catid") & ")) " &_
"ORDER BY tphotos.Id"
picsset.Open sqlselect, cn, adOpenForwardOnly, adLockReadOnly, adCmdText
while not picsset.EOF
ImageId = picsset("Id")
ImageH = picsset("detailh") + 250
ImageW = picsset("detailw") + 110
ThumbW = picsset("thumbw")
ThumbH = picsset("thumbh")
picsset.MoveNext
%>
<a href="./detail_.asp?itemid=<%=ImageId%>&Height=<%=ImageH%>&Width=<%=ImageW%>" target="_blank"><img src="thumb_.asp?imgid=<%=ImageId%>" width="<%=ThumbW%>" height="<%=ThumbH%>" alt="Click thumbnail for large picture" border="0"></a>
<%
wend
picsset.close
set picsset = nothing
set cn = nothing
%></center></div>
<p align="left"><font face="Arial" size="2" color="#003366"><strong>Database Integration with <a href="http://www.ammara.com" target="_blank">DBPix</a></strong></font></p>
<p align="center"> </p>
<p align="center"> </td>
</tr>
</table>
</center></div></div>
</body>
</html>
Back to sample
|