ASP Source Code:
<!--#include file="GetPixWidth.inc"-->
<%
Dim PixNameArray(9,9)
Dim PixIDArray(9,9)
Dim PixWidthArray(9,9)
Dim PixBGcolorArray(9,9)
Dim PixHAlignArray(9,9)
Dim PixVAlignArray(9,9)
Dim BGtemp,Atemp
Dim intLastPage
DIM ADOcn,ADOrs,rows,row,col,cols,PixWidth,temp1,strPixFile
DIM strPixPath,bolFileFound,MinPixWidth
set ADOcn=Server.CreateObject("ADODB.Connection")
ADOcn.Open "dsnPixMatrix" ' *** Update line as required ***
set ADOrsPix = Server.CreateObject("ADODB.recordset")
set ADOrsPage = Server.CreateObject("ADODB.recordset")
set ADOrsTemp = Server.CreateObject("ADODB.recordset")
strPixPath = "C:\Dan\PixMatrix\" ' *** Update line as required ***
%>
<HTML>
<HEAD>
<%
DIM strSearch,strSort,strSQL,strSQLpage,file,strWhere,strOrder
'Dim w, h, c, strType
strPage = Request.QueryString("page")
IF (strPage = "") THEN strPage = "1"
strWhere = "WHERE fldPageNo = '" & strPage & "'"
strOrder = " ORDER BY fldPageOrder"
strSQL = "Select * from tblCollection " & strWhere & strOrder
ADOrsPix.Open strSQL, ADOcn
strSQLpage = "Select * from tblPages " & strWhere
ADOrsPage.Open strSQLpage, ADOcn
strSQL = "SELECT MAX(fldPageNo) FROM tblPages"
ADOrsTemp.Open strSQL, ADOcn
intLastPage = cInt(ADOrsTemp(0))
rows = cInt(ADOrsPage.Fields("fldRows").Value)
cols = cInt(ADOrsPage.Fields("fldCols").Value)
intCellSpacing = ADOrsPage.Fields("fldCellSpacing").Value
intCellPadding = ADOrsPage.Fields("fldCellPadding").Value
BGtemp = ADOrsPage.Fields("fldBGcolor").Value
IF BGtemp = "*" THEN
TableBGcolor = ""
ELSE
TableBGcolor = "bgcolor='" & BGtemp & "'"
END IF
%>
</HEAD>
<BODY>
<font size="4"><%=ADOrsPage.Fields("fldPageTitle").Value%>
<font size="2">(Click on Picture to Enlarge)
<%
Dim intPage,intNextPage,intPreviousPage
intPage = cInt(strPage)
intNextPage = intPage + 1
intPreviousPage = intPage - 1
%>
<%IF (intPage > 1) THEN%>
<a href='pix_page.asp?page=<%=intPreviousPage%>'>
<img border="0" src='icons\previous.gif'></a>
<%END IF%>
Page <%=intPage%> of <%=intLastPage%>
<%IF (intPage < intLastPage) THEN%>
<a href='pix_page.asp?page=<%=intNextPage%>'>
<img border="0" src='icons\next.gif'></a>
<%END IF%>
</font><br>
<%for row = 1 to rows
for col = 1 to cols
IF NOT ADOrsPix.EOF THEN
temp1 = "\images\sm" & ADOrsPix.Fields("fldPixFile").Value
PixNameArray(row,col) = temp1
PixIDArray(row,col)= ADOrsPix.Fields("fldID").Value
PixWidthArray(row,col)= ADOrsPix.Fields("fldThumbnailSize").Value
BGtemp = ADOrsPix.Fields("fldBGcolor").Value
IF TableBGcolor= "" THEN
PixBGcolorArray(row,col)= "bgcolor='" & BGtemp & "'"
ELSE
PixBGcolorArray(row,col)= ""
END IF
Atemp = ADOrsPix.Fields("fldH-align").Value
IF Atemp <> "*" THEN
PixHAlignArray(row,col)= "align='" & Atemp & "'"
ELSE
PixHAlignArray(row,col)= ""
END IF
Atemp = ADOrsPix.Fields("fldV-align").Value
IF Atemp <> "*" THEN
PixVAlignArray(row,col)= "valign='" & Atemp & "'"
ELSE
PixVAlignArray(row,col)= ""
END IF
strPixFile = strPixPath & PixNameArray(row,col)
bolFileFound = gfxSpex(strPixFile, w, h, c, strType)
ADOrsPix.MoveNext
End IF
next
next
ADOrsPix.close
Set ADOrsPix = Nothing
ADOcn.close
Set ADOcn = Nothing
%>
<TABLE Align="Center"
cellspacing='<%=intCellSpacing%>'
cellpadding='<%=intCellPadding%>'
<%=TableBGcolor%>
BORDER="2">
<%for row = 1 to rows%>
<tr>
<%for col = 1 to cols%>
<td
<%=PixHAlignArray(row,col)%>
<%=PixVAlignArray(row,col)%>
<%=PixBGcolorArray(row,col)%> >
<a href='detail.asp?ID=<%=PixIDArray(row,col)%>'>
<img border="0" src='<%=PixNameArray(row,col)%>'
width='<%=PixWidthArray(row,col)%>'
></a>
</td>
<%next%>
</tr>
<%next%>
</TABLE>
</BODY>
</HTML>