■■■企业产品网站高分征解■■■

moffatt 2004-09-20 05:50:34
■■■企业产品网站高分征解■■■

从网站下载了一个产品发布的源文件(良精修改版),修改后产品发布如下网页所示:
http://www.lightingcapital.net/Product.asp

源文件产品的排列是纵向排列,每页10个,现在我想更改为横向排列,只显示图片,并将那些产品名称等说明

移到图片下方,每页显示3行3列,我看了源文件,定义产品发布纵向排列的是下面的asp语句,现在怎样修改

才能横向排列且每页显示3行3列呢?请高手指点!

'=================================================
'过程名:ShowArticle
'=================================================
sub ShowArticle(TitleLen)
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
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
sqlArticle="select top " & MaxPerPage
else
sqlArticle="select "
end if

sqlArticle=sqlArticle & "

ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,DefaultPicUrl,UpdateTime,Hits

from Product where Passed=True "

if BigClassName<>"" then
sqlArticle=sqlArticle & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlArticle=sqlArticle & " and SmallClassName='" & SmallClassName & "' "
end if
else
if SpecialName<>"" then
sqlArticle=sqlArticle & " and SpecialName='" & SpecialName & "' "
end if
end if
sqlArticle=sqlArticle & " order by articleid desc"
Set rsArticle= Server.CreateObject("ADODB.Recordset")
rsArticle.open sqlArticle,conn,1,1
if rsArticle.bof and rsArticle.eof then
response.Write("<br><li>没有任何产品</li>")
else
if currentPage=1 then
call ArticleContent(TitleLen)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsArticle.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsArticle.bookmark
call ArticleContent(TitleLen)
else
currentPage=1
call ArticleContent(TitleLen)
end if
end if
end if
rsArticle.close
set rsArticle=nothing
end sub

sub ArticleContent(intTitleLen)
dim i,strTemp
i=0
do while not rsArticle.eof
strTemp=""
'strTemp = strTemp & ""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=25% rowspan=5>"
strTemp= strTemp & "<div align=center><a href=" & rsArticle("DefaultPicUrl") & "

target=_blank>"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & "

width=100 height=120>"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=12% height=18>"
strTemp= strTemp & "产品名称:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid")

& ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>"
strTemp= strTemp & "产品类别:</td>"
strTemp= strTemp & "<td><a href=Product.asp?BigClassName=" & rsArticle

("BigClassName") & ">" & rsArticle("BigClassName") & "</a> → "
strTemp= strTemp & "<a href=Product.asp?BigClassName=" & rsArticle

("BigClassName") & "&SmallClassName=" & rsArticle("SmallClassName") & ">" & rsArticle

("SmallClassName") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>"
strTemp= strTemp & "产品编号:</td>"
strTemp= strTemp & "<td>" & rsArticle("Product_Id") & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>产品信息:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid")

& "><img src=Img/arrow_7.gif border=0></a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td colspan=2>"
strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=50% height=18>"
strTemp= strTemp & "<div align=center></div></td>"
strTemp= strTemp & "<td width=50% height=18>"
strTemp= strTemp & "<div align=center><a href='javascript:eshop(" & rsArticle

("Product_Id") & ")'>"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
strTemp= strTemp & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end sub
...全文
78 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
moffatt 2004-09-21
  • 打赏
  • 举报
回复
???
moffatt 2004-09-21
  • 打赏
  • 举报
回复
谢谢你的指点,但经测试,第14行出错了,是什么原因呢?
strTemp= strTemp & "<div align=center><a href=" & rsArticle("DefaultPicUrl") & "


错误类型:
Microsoft VBScript 编译器错误 (0x800A0409)
未结束的字符串常量
/Test/Lightingcapital/Inc/syscode.asp, line 249, column 80
strTemp= strTemp & "<div align=center><a href=" & rsArticle("DefaultPicUrl") & "
-------------------------------------------------------------------------------^
guoweidong 2004-09-20
  • 打赏
  • 举报
回复
sub ArticleContent(intTitleLen)
dim isRow
dim i,strTemp
i=0
do while not rsArticle.eof
strTemp=""
'strTemp = strTemp & ""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
if (isRow mod 3)=0 then
strTemp= strTemp & "<tr>"
end if
strTemp= strTemp & "<td width=25% rowspan=5>"
strTemp= strTemp & "<div align=center><a href=" & rsArticle("DefaultPicUrl") & "

target=_blank>"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & "

width=100 height=120>"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=12% height=18>"
strTemp= strTemp & "产品名称:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid")

& ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>"
strTemp= strTemp & "产品类别:</td>"
strTemp= strTemp & "<td><a href=Product.asp?BigClassName=" & rsArticle

("BigClassName") & ">" & rsArticle("BigClassName") & "</a> → "
strTemp= strTemp & "<a href=Product.asp?BigClassName=" & rsArticle

("BigClassName") & "&SmallClassName=" & rsArticle("SmallClassName") & ">" & rsArticle

("SmallClassName") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>"
strTemp= strTemp & "产品编号:</td>"
strTemp= strTemp & "<td>" & rsArticle("Product_Id") & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>产品信息:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid")

& "><img src=Img/arrow_7.gif border=0></a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td colspan=2>"
strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
if (isRow mod 3)=0 then
strTemp= strTemp & "<tr>"
end if
strTemp= strTemp & "<td width=50% height=18>"
strTemp= strTemp & "<div align=center></div></td>"
strTemp= strTemp & "<td width=50% height=18>"
strTemp= strTemp & "<div align=center><a href='javascript:eshop(" & rsArticle

("Product_Id") & ")'>"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
strTemp= strTemp & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
isRow=isRow+1
i=i+1
if i>=MaxPerPage then exit do
loop
end sub

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧