找回密码
 注册
广告投放 虚位以待【阿里云】2核2G云新老同享 99元/年,续费同价做网站就用糖果主机-sugarhosts.comJtti.com-新加坡服务器,美国服务器,香港服务器
查看: 392|回复: 2

精ASP代码的高手请进..过程名:ShowProduct 产品展示横排

[复制链接]
发表于 2007 年 10 月 22 日 13:31:40 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
精ASP代码的高手请进..过程名:ShowProduct 产品展示横排,请高人帮帮忙.感激不尽......

以下是良精2007版的产品展示程序,但是这个是竖着的,能不能改成4排,每排4个,计16个产品.谢谢,程序如下:  
(如果难的话,像产品规格,产品数量都不要,只要一张图片,然后底下有个产品名称就行了,点后进入大图片)



'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(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
        sqlProduct="select top " & MaxPerPage       
        else
                sqlProduct="select "
        end if

        sqlProduct=sqlProduct & " ID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
       
        if BigClassName<>"" then
                sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
                if SmallClassName<>"" then
                        sqlProduct=sqlProduct & " and SmallClassName='" & SmallClassName & "' "
                end if
        end if
        sqlProduct=sqlProduct & " order by UpdateTime desc"
        Set rsProduct= Server.CreateObject("ADODB.Recordset")
        rsProduct.open sqlProduct,conn,1,1
        if rsProduct.bof and  rsProduct.eof then
                response.Write("<br><li>没有任何产品</li>")
        else
                if currentPage=1 then
                        call ProductContent(TitleLen)
                else
                        if (currentPage-1)*MaxPerPage<totalPut then
                            rsProduct.move  (currentPage-1)*MaxPerPage
                         dim bookmark
                           bookmark=rsProduct.bookmark
                    call ProductContent(TitleLen)
                else
                        currentPage=1
                           call ProductContent(TitleLen)
                    end if
                end if
        end if
        rsProduct.close
        set rsProduct=nothing
end sub

sub ProductContent(intTitleLen)
           dim i,strTemp
    i=0
        do while not rsProduct.eof
                strTemp=""               
                strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=25% rowspan=6>"
                strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ID=" & rsProduct("ID") & ">"
                               
                                fileExt=lcase(getFileExtName(rsProduct("DefaultPicUrl")))
                                if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
                strTemp= strTemp & "<img style='BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-COLOR: #cccccc; BORDER-TOP-COLOR: #cccccc; BORDER-RIGHT-COLOR: #cccccc' src=" & rsProduct("DefaultPicUrl") & " width=105 height=80 onload='javascriptrawImage(this);'>"
                                else
                                 if fileext="swf" then
                                    strTemp= strTemp & "<object  classid='clsid27CDB6E-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='"&rsProduct("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 &"<embed  src='"&rsProduct("DefaultPicUrl")&"' width='105' height='84' 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=12% height=12>"
                strTemp= strTemp & "产品名称:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("ID") & ">" & rsProduct("Title") & ""
                strTemp= strTemp & "</a></td>"                                               
                               
                                'strTemp= strTemp & "</tr><tr>"
                'strTemp= strTemp & "<td width=12% height=12>"
                'strTemp= strTemp & "产品售价:</td>"
                'strTemp= strTemp & "<td>" & rsProduct("rice") & "元</td>"       
                               
                                strTemp= strTemp & "</tr><tr>"
                                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "产品型号:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsProduct("Spec") & ""
                strTemp= strTemp & "</a></td>"
                               
                                strTemp= strTemp & "</tr><tr>"
                                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "产品备注:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsProduct("Memo") & ""
                strTemp= strTemp & "</a></td>"                       
                               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=12>"
                strTemp= strTemp & "产品类别:</td>"
                strTemp= strTemp & "<td><a href=Product.asp?BigClassName="& rsProduct("BigClassName")&">"&rsProduct("BigClassName")&"</a> → "
                strTemp= strTemp & "<a href=Product.asp?BigClassName=" & rsProduct("BigClassName") & "&SmallClassName=" & rsProduct("SmallClassName") & ">" & rsProduct("SmallClassName") & ""
                strTemp= strTemp & "</a></td>"
                strTemp= strTemp & "</tr><tr>"                                

                          
                strTemp= strTemp & "<td height=12>产品信息:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("ID") & " target=_blank><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=12>"
                strTemp= strTemp & "<div align=center></div></td>"
               
                                strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "<div align=center><input name='Product_Id' type='checkbox'    id='Product_Id' value="&cstr(rsProduct("roduct_Id"))&"> 选取"
                strTemp= strTemp & "</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
                rsProduct.movenext
                i=i+1
                if i>=MaxPerPage then exit do       
        loop
end sub
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
发表于 2007 年 10 月 22 日 13:37:51 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
可以改的啊...........
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2007 年 10 月 22 日 15:00:42 | 显示全部楼层
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2025 年 2 月 10 日 23:29 , Processed in 0.026401 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表