uus元素:请各位专家们帮帮忙,关于购物程序的列表问题

来源:百度文库 编辑:中科新闻网 时间:2024/05/15 05:18:52
我想把http://shop.100u.net.cn/cat.asp?catid=310 里的列表里的商品名称:百货模板
商品品牌:网上经典作品
商品简介:百货模板
会 员 价:¥15元 折扣:7.5折

这些去掉后,只留图片,但是我想把商品一行排两个,现在是一行一个的,不知道如何弄?

这一段的代码如下,谢谢,我的QQ:151468 如果可以的请加我!

<%
Const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(SafeRequest("page",1)) then
currentPage=Cint(SafeRequest("page",1))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select prename,company,mark,intro,name,id,introduce,price1,price2,discount,pic,stock from product where categoryid in ("& CatList&") and stock >= 0 order by adddate desc",conn,1,1

if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,此分类暂时还没有商品!</p>"
else
totalPut=rs.recordcount

if currentpage<1 then
currentpage=1
end if

if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if

if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"cat.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"cat.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"cat.asp"
end if
end if
end if

sub showContent
dim i
i=0

%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
do while not rs.eof%>

<%response.write"<TABLE border=0 align=center width=""100%"" bgcolor="&tablebodycolor2&">"&_
"<TR><TD align=center height=170><TABLE border=0 width=""100%"">"
if request("OrderBy")="uptime" or request("OrderBy")="commentcount" then
order=request("OrderBy")
else
order="picid"
end if

Set rs = server.CreateObject("ADODB.Recordset")

sql="select filename,title,picid,name,uptime,filesize,width,height,depth,visitcount,remark,commentcount "&_
"from photo where classid="&clsid&" order by "&order&" desc"

rs.open sql,conn,1,1

if rs.eof and rs.bof then
response.write "  您的班级还没有任何照片:("
response.write "</td></tr></table>"
else

rs.pagesize=12
totalpages=rs.pagecount
currentpage=request("Page")
if currentpage="" then currentpage=1
if not isInteger(currentpage) then
currentpage=1
elseif Cint(currentpage)>totalpages then
currentpage=totalpages
end if
currentpage=Cint(currentpage)
rs.absolutepage=currentpage

picthid=(currentpage-1)*12+1
total=0
do until total=12 or rs.eof

if total mod 4=0 then response.write "<TR>"
response.write "<TD bgcolor=#F7F7F7 align=center width=""25%"" height=""160"">"

if rs(8)<=8 then depth=2^(rs(8)) else depth=rs(8)&"b"

altinfo="序  号:"&picthid&" "&vbcrlf&""&_
"文件名:"&upfile&" "&vbcrlf&""&_
"上传者:"&getrealname(rs(3))&""&vbcrlf&""&_
"说  明:"&htmlencode(CutStr(rs(10),16))&" "&vbcrlf&""&_
"时  间:"&formatdatetime(rs(4),2)&" "&vbcrlf&""&_
"大  小:"&rs(5)&"B "&vbcrlf&""&_
"点击数:"&rs(9)&" "&vbcrlf&""&_
"属  性:"&rs(6)&"x"&rs(7)&"x"&depth&""

response.write "<TABLE bgcolor=#D9D6B8 cellSpacing=1 cellPadding=3 width=120 border=0>"&_
"<TBODY><TR>"&_
"<TD bgcolor=#EBEADF height=105 onmouseover=""this.style.cursor='hand'"" onclick=""document.location.href='class_album.asp?action=showphoto&photoid="&rs(2)&"'"""&_
"align=middle height=86>"&_
"<table border=0 cellspacing=0 cellpadding=0>"&_
"<tr><td><IMG src="&PhotoPath&rs(0)&" "&sizeadjust(rs(6),rs(7),100)&" border='0' title='"&altinfo&"')""></td></tr></table></TD>"&_
"</TR></TBODY></TABLE>"&_
"<TABLE cellspacing=1><TR><TD></TD></TR></TABLE>"&_
"<TABLE cellSpacing=0 cellPadding=2 width=120 height=64 border=0 bgcolor="&tablebordercolor&" class=t><TBODY>"&_
"<TR><TD align=middle bgcolor="&tablebodycolor1&">说 明:"&htmlencode(CutStr(rs(10),10))&"</TD></TR>"&_
"<TR><TD align=middle bgcolor="&tablebodycolor1&"><input type=checkbox name=photoid value="&rs(2)&"> 评论数:"&rs(11)&"</TD></TR>"&_
"<TR><TD align=middle bgcolor="&tablebodycolor1&">上传者:"&getrealname(rs(3))&"</TD></TR>"&_
"</TBODY></TABLE>"&_
"</TD>"
picthid=picthid+1
total=total+1
rs.movenext
if rs.eof or total mod 4=0 then response.write "</TR>"
loop
response.write "</TABLE>"
end if
response.write "</td></tr></table>"
%>
这段是我相册的代码,意思是四张照片一行
你要的就是
total=0
if total mod 4=0 then response.write "<TR>"
定义个total,如果被四整除就换行
当然要和rs.eof结合考虑噢
楼主把四改成二就行了
另外楼主的代码好像不是很规范
祝楼主很快搞定问题