谁能帮修改下这段ASP代码 谢过了
本来产品图片是竖向排列的像改成横向排列一排四个每页9排改修改哪里底下是部分代码subShowArticle(TitleLen)ifTitleLen<0orTitleLen...
本来产品图片是竖向排列的 像改成横向排列 一排四个 每页9排 改修改哪里
底下是部分代码
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>No products</li>")
else 展开
底下是部分代码
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>No products</li>")
else 展开
2个回答
展开全部
楼主的代码是不是没发全啊?
要是发全了,这段代码的功能是分页而不是控制输出格式的。
-------------------------------------------------------------------
下面是同时显示图片和文字的,只要改变MaxPerPage的值就能控制每页显示的数量,用下面的代码替换原来的ArticleContent(intTitleLen)过程(就是最后那段sub),样式楼主自己做吧
sub ArticleContent(intTitleLen)
dim i,strTemp,perCol
perCol=4'每行显示的数量
i=0
'strTemp = strTemp & ""
response.Write("<table width=100% border=0 cellspacing=3 cellpadding=0>")
response.Write("<tr>")
do while not rsArticle.eof
strTemp=""
strTemp= strTemp & "<td width=25%>"
strTemp= strTemp & "<p align=center><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=200 height=200>"
strTemp= strTemp & "</a></p>"
strTemp= strTemp & "<p>"
strTemp= strTemp & "Product Name:"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></p>"
strTemp= strTemp & "<p>"
strTemp= strTemp & "Product Category:"
strTemp= strTemp & "<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></p>"
strTemp= strTemp & "<p>"
strTemp= strTemp & "Item No.:"
strTemp= strTemp & rsArticle("Product_Id")
strTemp= strTemp & "</p>"
strTemp= strTemp & "<p>Products:"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & "><img src=Img/arrow_7.gif border=0></a>"
strTemp= strTemp & "</p>"
response.write strTemp
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
if (i mod perCol)=0 then
response.Write("</tr><tr>");
loop
response.Write("</tr></table>")
end sub
要是发全了,这段代码的功能是分页而不是控制输出格式的。
-------------------------------------------------------------------
下面是同时显示图片和文字的,只要改变MaxPerPage的值就能控制每页显示的数量,用下面的代码替换原来的ArticleContent(intTitleLen)过程(就是最后那段sub),样式楼主自己做吧
sub ArticleContent(intTitleLen)
dim i,strTemp,perCol
perCol=4'每行显示的数量
i=0
'strTemp = strTemp & ""
response.Write("<table width=100% border=0 cellspacing=3 cellpadding=0>")
response.Write("<tr>")
do while not rsArticle.eof
strTemp=""
strTemp= strTemp & "<td width=25%>"
strTemp= strTemp & "<p align=center><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=200 height=200>"
strTemp= strTemp & "</a></p>"
strTemp= strTemp & "<p>"
strTemp= strTemp & "Product Name:"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></p>"
strTemp= strTemp & "<p>"
strTemp= strTemp & "Product Category:"
strTemp= strTemp & "<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></p>"
strTemp= strTemp & "<p>"
strTemp= strTemp & "Item No.:"
strTemp= strTemp & rsArticle("Product_Id")
strTemp= strTemp & "</p>"
strTemp= strTemp & "<p>Products:"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & "><img src=Img/arrow_7.gif border=0></a>"
strTemp= strTemp & "</p>"
response.write strTemp
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
if (i mod perCol)=0 then
response.Write("</tr><tr>");
loop
response.Write("</tr></table>")
end sub
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
问题补充
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=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=100 height=100>"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=12% height=18>"
strTemp= strTemp & "Product Name:</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 & "Product Category:</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 & "Item No.:</td>"
strTemp= strTemp & "<td>" & rsArticle("Product_Id") & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>Products:</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 & "</tr><tr>"
strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#E1F4EE></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end sub
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=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=100 height=100>"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=12% height=18>"
strTemp= strTemp & "Product Name:</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 & "Product Category:</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 & "Item No.:</td>"
strTemp= strTemp & "<td>" & rsArticle("Product_Id") & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>Products:</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 & "</tr><tr>"
strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#E1F4EE></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询