标题:[求助]新手请教如何一行两图 [得到阳光白雪帮助,结束]
只看楼主
szmxcz
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-3-8
 问题点数:0 回复次数:3 
[求助]新手请教如何一行两图 [得到阳光白雪帮助,结束]

我现在是一行一图.我想改成一行两图(包括介绍文字)

请问有热心人完整的告诉我如何修改么




无资料时候的显示和分页.我目前设定是一页五个产品

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,Price,Spec,Unit,Memo,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 & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=45% rowspan=7>"
strTemp= strTemp & "<div align=center><a target=_new href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">"

fileExt=lcase(getFileExtName(rsArticle("DefaultPicUrl")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
strTemp= strTemp & "<img border=1 src=" & rsArticle("DefaultPicUrl") & " width=180 height=180>"
else
if fileext="swf" then
strTemp= strTemp & "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>"
strTemp= strTemp &"<param name=movie value='"&rsArticle("DefaultPicUrl")&"'>"
strTemp= strTemp &"<param name=quality value=high>"
strTemp= strTemp &"<param name='Play' value='-1'>"
strTemp= strTemp &"<param name='Loop' value='0'>"
strTemp= strTemp &"<param name='Menu' value='-1'>"
strTemp= strTemp &"<param name='wmode' value='transparent'>"
strTemp= strTemp &"<embed src='"&rsArticle("DefaultPicUrl")&"' width='180' height='180' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"
end if
end if

strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=25% height=12>"
strTemp= strTemp & "产品名称:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a target=_new href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"

strTemp= strTemp & "</tr><tr>"

strTemp= strTemp & "<td width=25% height=12>"
strTemp= strTemp & "产品规格:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & rsArticle("Spec") & ""
strTemp= strTemp & "</a></td>"

strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=12>"
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=1 colspan=2 bgcolor=#FB9F47>"
strTemp= strTemp & "产品备注:" & rsArticle("Memo") & "</td>"


strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"

response.write strTemp
rsArticle.movenext
i=i+1

if i>=MaxPerPage then exit do
loop
end sub

我找一天了.都没有人帮我

[此贴子已经被作者于2007-3-9 10:15:18编辑过]

搜索更多相关主题的帖子: 白雪 阳光 结束 
2007-03-08 18:12
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
得分:0 
[QUOTE]sub ArticleContent(intTitleLen)
dim i,strTemp
i = 0
Response.Write("<table width=100% border=0 cellspacing=3 cellpadding=0>")
do while not rsArticle.eof
Response.Write("<tr>")
For TdCount = 0 To 3 ''定义每行显示三个
If rsArticle.eof Then Exit For ''当到记录尾时跳出For循环
Response.Write("<td width=33%>")
strTemp=""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=45% rowspan=7>"
strTemp= strTemp & "<div align=center><a target=_new href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">"

fileExt=lcase(getFileExtName(rsArticle("DefaultPicUrl")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
strTemp= strTemp & "<img border=1 src=" & rsArticle("DefaultPicUrl") & " width=180 height=180>"
else
if fileext="swf" then
strTemp= strTemp & "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>"
strTemp= strTemp &"<param name=movie value='"&rsArticle("DefaultPicUrl")&"'>"
strTemp= strTemp &"<param name=quality value=high>"
strTemp= strTemp &"<param name='Play' value='-1'>"
strTemp= strTemp &"<param name='Loop' value='0'>"
strTemp= strTemp &"<param name='Menu' value='-1'>"
strTemp= strTemp &"<param name='wmode' value='transparent'>"
strTemp= strTemp &"<embed src='"&rsArticle("DefaultPicUrl")&"' width='180' height='180' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"
end if
end if

strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=25% height=12>"
strTemp= strTemp & "产品名称:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a target=_new href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td width=25% height=12>"
strTemp= strTemp & "产品规格:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & rsArticle("Spec") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=12>"
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=1 colspan=2 bgcolor=#FB9F47>"
strTemp= strTemp & "产品备注:" & rsArticle("Memo") & "</td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
Response.Write("</td>")
rsArticle.movenext
i=i+1
Next
Response.Write("</tr>")
if i>=MaxPerPage then exit do
loop
Response.Write("</table>")
end sub [/QUOTE]

[此贴子已经被作者于2007-3-9 8:36:59编辑过]


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-03-09 08:35
szmxcz
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-3-8
得分:0 

感谢 阳光白雪 的热心帮助.好人好报

2007-03-09 10:14
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
得分:0 
自己要从中学会举一反三才对
这样才是对版主的支持~~

http://www./
2007-03-09 10:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-123131-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.411872 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved