I have a link directory and photo gallery that are giving me problems with xhtml transitional validation problems.
They both are directory structured(categorized), where I have 2 columns of categories. I use 2 different methods to get it to have 2 columns, and both work to display how I need it too, however neither one validates.
http://www.portalfanatic.com/links/
http://www.portalfanatic.com/gallery/
are the 2 pages.
There are other included files, the functions that do the work. SelectDB is an array of records where (x,y) x=field#, y=row
/links/ code is:
<!--#include virtual="/includes/header.
asp"-->
<h2>Our Link Directory</h2>
<!--Content Starts Here-->
<%
if not adminCheck() then
x = "lVerified = 1 AND "
end if
if pCat = "" OR ISNULL(pCat) OR pCat = "0" then
pCat = 0
catSQL="gcID <> 0 AND parentID = 0"
else
pCat = pCat
catSQL="parentID = "&pCat
end if
cPerPage = 100000
pageNum=request.querystrin
g("page")
if pageNum = "" OR ISNULL(pageNum) then
pageNum = 1
else
pageNum = cint(pageNum)
end if
Call SelectDB(inrsConn, "gcID, parentID, gCat", "ModLinksCats", catSQL, "gCat", cPerPage, 1, lCats, strError, isEOF, lngRecordCount1)
If Not IsArray(lCats) Then
write("There are no categories yet.")
write(strError)
else
Dim intColNo
Dim strCellContent
intColNo = 0
strCellContent = "<img src='/storage/images/comme
nt.gif' alt='Category' /> <a href='?pCat=##PCID##'>##PN
AME##</a>"
Dim strHtml
For row = 0 To UBound(lCats, 2) - 1
If intColNo < 2 Then
intColNo = intColNo + 1
Else
strHtml = strHtml & "</tr>"
intColNo = 1
strHtml = strHtml & "<tr>"
End If
strHtml = strHtml & "<td width='50%' valign='top'><div style='width:75%;'><strong
>" & Replace(Replace(strCellCon
tent, "##PCID##", lCats(0,row)), "##PNAME##", lCats(2,row)) & " ("&getCount(inrsConn,"ModL
inksLinks"
," WHERE lVerified = 1 AND lcID = "&lCats(0,row))&" links)</strong></div>"
%>
<!--#include virtual="/links/scats.asp"
-->
<%
strHtml = strHtml & "</td>"
Next
If intColNo < 2 Then
strHtml = strHtml & "<td> </td></tr>"
Else
strHtml = strHtml & "</tr>"
End If
Response.Write "<table style='width:100%'>" & strHtml & "</table>"
end if%>
<br /><br />
<%if pCat > 0 then%>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><h2>Links</h2></td>
</tr>
<tr>
<td style="padding-left:15px;"
>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td> </td>
<%if pCat = "" OR ISNULL(pCat) OR pCat = "0" then
lPerPage = 5
lSQL="lVerified = 1 AND topCat = 1"
else
lPerPage = 25
lSQL="lVerified = 1 AND lcID = "&pCat
end if
Call SelectDB(inrsConn, "linkID, lcID, lName, lDesc, lURL, lPosted, lHits, uID", "ModLinksLinks", lSQL, "lHits DESC, lPosted DESC", lPerPage, pageNum, lLinks, strError, isEOF, lngRecordCount2)
pages = RoundUp(lngRecordCount2 / lPerPage)
if nxtPage >= pages then
nxtPage = pages
else
if pages = pageNum then
nxtPage = pageNum
else
nxtPage = pageNum + 1
end if
end if
if pageNum <= 1 then
prevPage = 1
else
prevPage = pageNum - 1
end if
write "<td align='right' style='padding-right:25px;
'><strong>
PAGING:</s
trong> <a name='First Page' href='default.asp?page=1&a
mp;pCat="&
pCat&"'>&l
t;<</a>
| <a name='Previous Page' href='/links/?page="&prevP
age&"&
pCat="&pCa
t&"'><<
/a> | <a name='Next Page' href='/links/?page="&nxtPa
ge&"&p
Cat="&pCat
&"'>></a> | <a name='Last Page' href='/links/?page="&pages
&"&pCa
t="&pCat&"
'>>></a></
td></tr></
table>"
If Not IsArray(lLinks) Then
write("There are no links in this category yet.")
else
For lrow = 0 To UBound(lLinks, 2) - 1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td><h2><a href="/links/lhit.asp?lID=
<%=lLinks(
0,lrow)%>"
target="_blank"><%=lLinks(
2,lrow)%><
/a></h2></
td>
</tr>
<tr>
<td style="padding-left:15px;"
><%=lLinks
(3,lrow)%>
</td
>
</tr>
</table>
<%
Next
End if
%> </td>
</tr>
</table><%end if%>
<!--Content Ends Here-->
scats.asp is just a loop through 10 or so records, and displays them under the parent category and is in the same <td></td> as is the parent category.
/gallery/ code is:
<!--Content Starts Here-->
<h2>Our Photo Gallery</h2>
<%
if pCat = "" OR ISNULL(pCat) OR pCat = "0" then
pCat = 0
catSQL="gcID <> 0 AND parentID = 0"
else
pCat = pCat
catSQL="parentID = "&pCat
end if
if not userCheck() then
catSQL = catSQL &" AND gcPriv = 0"
else
catSQL = catSQL &" AND gcPriv = 0 OR (gcPriv = 1 AND uID = "&uID&")"
end if
cPerPage = 10000
pageNum=request.querystrin
g("page")
if pageNum = "" OR ISNULL(pageNum) then
pageNum = 1
else
pageNum = cint(pageNum)
end if
Call SelectDB(inrsConn, "gcID, parentID, gCat", "ModPicCats", catSQL, "gcPriv DESC, gcOrder, gCat", cPerPage, 1, gCats, strError, isEOF, lngRecordCount1)
If Not IsArray(gCats) Then
write("There are no albums yet.")
else
%>
<table width="100%" border="0" cellspacing="0"><tr>
<%
recPerRow = 2
For row = 0 To UBound(gCats, 2) - 1
If row mod recPerRow = 0 Then
Call SelectDB(inrsConn, "gID", "ModPicPics", "gcID = "&gCats(0,row), "", cPerPage, 1, gp, strError, isEOF, lngRecordCountpp)
if lngRecordCountpp = "" OR ISNULL(lngRecordCountpp) then
pc=0
else
pc=lngRecordCountpp
end if
write "<td width='50%' style='padding:5px;' valign='top'><div style='padding:2px;width:7
5%;'><img src='/storage/images/comme
nt.gif' alt='Category' /> <a href='/gallery/?pCat="&gCa
ts(0,row)&
"'><strong
>"&gCats(2
,row)&"</s
trong></a>
<span class='footer' style='font-weight:bold;'>
("&pc&" pics)</span></div>"
%>
<div style='width:75%;padding-l
eft:15px;'
><%respons
e.cookies(
"k")=gCats
(0,row)%><
!--#includ
e virtual="/gallery/picsCats
.asp"--><%
response.c
ookies("k"
)=""%></di
v>
<%write "</td>"
Else
Call SelectDB(inrsConn, "gID", "ModPicPics", "gcID = "&gCats(0,row), "", cPerPage, 1, gp, strError, isEOF, lngRecordCountpl)
if lngRecordCountpl = "" OR ISNULL(lngRecordCountpl) then
pl=0
else
pl=lngRecordCountpl
end if
write "<td width='50%' style='padding:5px;' valign='top'><div style='padding:2px;width:7
5%;'><img src='/storage/images/comme
nt.gif' alt='Category' /> <a href='/gallery/?pCat="&gCa
ts(0,row)&
"'><strong
>"&gCats(2
,row)&"</s
trong></a>
<span class='footer' style='font-weight:bold;'>
("&pl&" pics)</span></div>"
%>
<div style='width:75%;padding-l
eft:15px;'
><%respons
e.cookies(
"k")=gCats
(0,row)%><
!--#includ
e virtual="/gallery/picsCats
.asp"--><%
response.c
ookies("k"
)=""%></di
v>
<%write "</td>"
End If
If row mod recPerRow = 0 Then
write ""
Else
write "</tr><tr>"
End If
Next
%>
</table>
<%end if%>
<%if pCat <> 0 then%><br />
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><h2>Photos</h2></td>
</tr>
<tr>
<td style="padding-left:15px;"
><!--#incl
ude virtual="/gallery/pics.asp
"--></td>
</tr>
</table>
<%end if%>
<!--Content Ends Here-->
pics.asp displays the thumbnails if there are any, picsscats.asp displays the child categories, as listed under the parent category
neither one of these methods validates, and thoughts as to why?
ASKER
i mainly use a stylesheet. I would rather use tables than divs, as for the most part I am displaying tabular data. I've noticed that using divs makes the site all inline when using FireFox