⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 powereasy.product.asp

📁 个人网站比较简短
💻 ASP
📖 第 1 页 / 共 5 页
字号:
            strPic = strPic & "<tr><td align='center'>" & GetButtons(ShowButtonType, ButtonStyle, rsPic("ProductID"), strLink) & "</td></tr>"
        Case 8  '图片+名称:上下排列
            strPic = strPic & "<tr><td align='center' class='productpic'>" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "</a></td></tr>"
            strPic = strPic & "<tr><td align='center'>" & strLink & TitleStr & "</a></td></tr>"
        Case 9  '图片+按钮:上下排列
            strPic = strPic & "<tr><td align='center' class='productpic'>" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "</a></td></tr>"
            strPic = strPic & "<tr><td align='center'>" & GetButtons(ShowButtonType, ButtonStyle, rsPic("ProductID"), strLink) & "</td></tr>"
        Case 10  '只显示图片
            strPic = strPic & "<tr><td align='center' class='productpic'>" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "</a></td></tr>"
        Case 11  '输出DIV格式
            strPic = strPic & "<div class=""pic_product_img"">" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "</a></div>" & vbCrLf
            strPic = strPic & "<div class=""pic_product_title"">" & strLink & TitleStr & "</a></div>" & vbCrLf
            strPic = strPic & "<div class=""pic_product_price"">" & GetProductPrice(ShowPriceType, ShowDiscount, rsPic("ProductType"), rsPic("Price_Original"), rsPic("Price"), rsPic("Price_Market"), rsPic("Price_Member"), rsPic("BeginDate"), rsPic("EndDate"), rsPic("Discount")) & "</div>" & vbCrLf
            strPic = strPic & "<div class=""pic_product_button"">" & GetButtons(ShowButtonType, ButtonStyle, rsPic("ProductID"), strLink) & "</div>" & vbCrLf
        End Select
        If ShowType < 11 Then
            strPic = strPic & "</table></td>"
        Else
            strPic = strPic & "</div>" & vbCrLf
        End If
        rsPic.MoveNext
        iCount = iCount + 1
        If ProductNum = 0 And iCount >= MaxPerPage Then Exit Do
        If ((iCount Mod Cols = 0) And (Not rsPic.EOF)) And ShowType < 11 Then strPic = strPic & "</tr><tr valign='top'>"
    Loop

    If ShowType < 11 Then strPic = strPic & "</tr></table>"
    rsPic.Close
    Set rsPic = Nothing
    GetPicProduct = strPic
End Function

'=================================================
'函数名:GetSlidePicProduct
'作  用:显示幻灯效果商品
'参  数:
'0        arrClassID  ----栏目ID数组,0为所有栏目
'1        IncludeChild ----是否包含子栏目,仅当arrClassID为单个栏目ID时才有效,True----包含子栏目,False----不包含
'2        iSpecialID ----专题ID,0为所有商品(含非专题商品),如果为大于0,则只显示相应专题的商品
'3        ProductNum ----最多显示多少个商品
'4        IsHot        ----是否是热门商品
'5        IsElite      ----是否是推荐商品
'6        DateNum ----日期范围,如果大于0,则只显示最近几天内更新的商品
'7        OrderType ----排序方式,1--按商品ID降序,2--按商品ID升序,3--按更新时间降序,4--按更新时间升序,5--按点击数降序,6--按点击数升序,7--按评论数降序,8--按评论数升序
'8        ImgWidth   ----商品宽度
'9        ImgHeight  ----商品高度
'10       TitleLen  ----文章标题字数限制,0为不显示,-1为显示完整标题
'11       iTimeOut   ----效果变换间隔时间,以毫秒为单位
'12       effectID   ---- 图片转换效果,0至22指定某一种特效,23表示随机效果
'=================================================
Public Function GetSlidePicProduct(arrClassID, IncludeChild, iSpecialID, ProductNum, IsHot, IsElite, DateNum, OrderType, ImgWidth, ImgHeight, TitleLen, iTimeOut, effectID)
    Dim sqlPic, rsPic, i, strPic, trs, tmpChannelID
    Dim ProductThumb, TitleStr
    
    ProductNum = PE_CLng(ProductNum)
    ImgWidth = PE_CLng(ImgWidth)
    ImgHeight = PE_CLng(ImgHeight)
    tmpChannelID = 0

    If ProductNum <= 0 Or ProductNum > 100 Then
        ProductNum = 10
    End If
    If ImgWidth < 0 Or ImgWidth > 1000 Then
        ImgWidth = 150
    End If
    If ImgHeight < 0 Or ImgHeight > 1000 Then
        ImgHeight = 150
    End If
    If iTimeOut < 1000 Or iTimeOut > 100000 Then
        iTimeOut = 5000
    End If
    If effectID < 0 Or effectID > 23 Then effectID = 23
    
    
    sqlPic = "select top " & ProductNum & " P.ChannelID,P.ProductID,P.ClassID,P.ProductName,P.UpdateTime,P.ProductThumb"
    sqlPic = sqlPic & GetSqlStr(arrClassID, IncludeChild, iSpecialID, 0, IsHot, IsElite, DateNum, OrderType, True, True)

    Dim ranNum
    Randomize
    ranNum = Int(900 * Rnd) + 100
    strPic = "<script language=JavaScript>" & vbCrLf
    strPic = strPic & "<!--" & vbCrLf
    strPic = strPic & "var SlidePic_" & ranNum & " = new SlidePic_Product(""SlidePic_" & ranNum & """);" & vbCrLf
    strPic = strPic & "SlidePic_" & ranNum & ".Width    = " & ImgWidth & ";" & vbCrLf
    strPic = strPic & "SlidePic_" & ranNum & ".Height   = " & ImgHeight & ";" & vbCrLf
    strPic = strPic & "SlidePic_" & ranNum & ".TimeOut  = " & iTimeOut & ";" & vbCrLf
    strPic = strPic & "SlidePic_" & ranNum & ".Effect   = " & effectID & ";" & vbCrLf
    strPic = strPic & "SlidePic_" & ranNum & ".TitleLen = " & TitleLen & ";" & vbCrLf

    Set rsPic = Server.CreateObject("ADODB.Recordset")
    rsPic.Open sqlPic, Conn, 1, 1
    Do While Not rsPic.EOF
        If Left(rsPic("ProductThumb"), 1) <> "/" And InStr(rsPic("ProductThumb"), "://") <= 0 Then
            ProductThumb = ChannelUrl & "/" & UploadDir & "/" & rsPic("ProductThumb")
        Else
            ProductThumb = rsPic("ProductThumb")
        End If
        If TitleLen = -1 Then
            TitleStr = rsPic("ProductName")
        Else
            TitleStr = GetSubStr(rsPic("ProductName"), TitleLen, ShowSuspensionPoints)
        End If
        
        strPic = strPic & "var oSP = new objSP_Product();" & vbCrLf
        strPic = strPic & "oSP.ImgUrl         = """ & ProductThumb & """;" & vbCrLf
        strPic = strPic & "oSP.LinkUrl        = """ & GetProductUrl(rsPic("ParentDir"), rsPic("ClassDir"), rsPic("UpdateTime"), rsPic("ProductID")) & """;" & vbCrLf
        strPic = strPic & "oSP.Title         = """ & TitleStr & """;" & vbCrLf
        strPic = strPic & "SlidePic_" & ranNum & ".Add(oSP);" & vbCrLf
        
        rsPic.MoveNext
    Loop
    strPic = strPic & "SlidePic_" & ranNum & ".Show();" & vbCrLf
    strPic = strPic & "//-->" & vbCrLf
    strPic = strPic & "</script>" & vbCrLf
    
    rsPic.Close
    Set rsPic = Nothing
    GetSlidePicProduct = strPic
End Function

Private Function JS_SlidePic()
    Dim strJS, LinkTarget
    LinkTarget = XmlText_Class("SlidePicProduct/LinkTarget", "_blank")
    strJS = strJS & "<script language=""JavaScript"">" & vbCrLf
    strJS = strJS & "<!--" & vbCrLf
    strJS = strJS & "function objSP_Product() {this.ImgUrl=""""; this.LinkUrl=""""; this.Title="""";}" & vbCrLf
    strJS = strJS & "function SlidePic_Product(_id) {this.ID=_id; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.Url=null; this.Title=null; this.AllPic=new Array(); this.Add=SlidePic_Product_Add; this.Show=SlidePic_Product_Show; this.LoopShow=SlidePic_Product_LoopShow;}" & vbCrLf
    strJS = strJS & "function SlidePic_Product_Add(_SP) {this.AllPic[this.AllPic.length] = _SP;}" & vbCrLf
    strJS = strJS & "function SlidePic_Product_Show() {" & vbCrLf
    strJS = strJS & "  if(this.AllPic[0] == null) return false;" & vbCrLf
    strJS = strJS & "  document.write(""<div align='center'><a id='Url_"" + this.ID + ""' href='' target='" & LinkTarget & "'><img id='Img_"" + this.ID + ""' style='width:"" + this.Width + ""px; height:"" + this.Height + ""px; filter: revealTrans(duration=2,transition=23);' src='javascript:null' border='0'></a>"");" & vbCrLf
    strJS = strJS & "  if(this.TitleLen != 0) {document.write(""<br><span id='Title_"" + this.ID + ""'></span></div>"");}" & vbCrLf
    strJS = strJS & "  else{document.write(""</div>"");}" & vbCrLf
    strJS = strJS & "  this.Img = document.getElementById(""Img_"" + this.ID);" & vbCrLf
    strJS = strJS & "  this.Url = document.getElementById(""Url_"" + this.ID);" & vbCrLf
    strJS = strJS & "  this.Title = document.getElementById(""Title_"" + this.ID);" & vbCrLf
    strJS = strJS & "  this.LoopShow();" & vbCrLf
    strJS = strJS & "}" & vbCrLf
    strJS = strJS & "function SlidePic_Product_LoopShow() {" & vbCrLf
    strJS = strJS & "  if(this.PicNum<this.AllPic.length-1) this.PicNum++ ; " & vbCrLf
    strJS = strJS & "  else this.PicNum=0; " & vbCrLf
    strJS = strJS & "  this.Img.filters.revealTrans.Transition=this.Effect; " & vbCrLf
    strJS = strJS & "  this.Img.filters.revealTrans.apply(); " & vbCrLf
    strJS = strJS & "  this.Img.src=this.AllPic[this.PicNum].ImgUrl;" & vbCrLf
    strJS = strJS & "  this.Img.filters.revealTrans.play();" & vbCrLf
    strJS = strJS & "  this.Url.href=this.AllPic[this.PicNum].LinkUrl;" & vbCrLf
    strJS = strJS & "  if(this.Title) this.Title.innerHTML=""<a href=""+this.AllPic[this.PicNum].LinkUrl+"" target='" & LinkTarget & "'>""+this.AllPic[this.PicNum].Title+""</a>"";" & vbCrLf
    strJS = strJS & "  this.Img.timer=setTimeout(this.ID+"".LoopShow()"",this.TimeOut);" & vbCrLf
    strJS = strJS & "}" & vbCrLf
    strJS = strJS & "//-->" & vbCrLf
    strJS = strJS & "</script>" & vbCrLf
    JS_SlidePic = strJS
End Function

Private Function GetProductPrice(ShowPriceType, ShowDiscount, ProductType, Price_Original, Price, Price_Market, Price_Member, BeginDate, EndDate, Discount)
    Dim strPrice
    Select Case ShowPriceType
    Case 0
        Select Case PE_CLng(ProductType)
        Case 0, 1, 2
            strPrice = strPrice & strPrice_Market & "<font class=""price""><STRIKE>" & GetPrice_Market(Price_Market) & "</STRIKE></font>"
            strPrice = strPrice & "<br>" & strPrice_Shop & "<font class=""price"">" & GetPrice_FilterZero(Price) & "</font>"
            strPrice = strPrice & "<br>" & strPrice_Member & "<font class=""price"">" & GetPrice_Member(Price_Member) & "</font>"
        Case 3
            If Date >= BeginDate And Date <= EndDate Then
                strPrice = strPrice & strPrice_Original & "<font class=""price""><STRIKE>" & GetPrice_FilterZero(Price_Original) & "</STRIKE></font>"
                strPrice = strPrice & "<br>" & strPrice_Te & "<font class=""price"">" & GetPrice_FilterZero(Price) & "</font>"
                strPrice = strPrice & "<br>" & strPrice_Time & "" & Month(BeginDate) & "/" & Day(BeginDate) & "-" & Month(EndDate) & "/" & Day(EndDate)
            Else
                strPrice = strPrice & strPrice_Market & "<font class=""price""><STRIKE>" & GetPrice_Market(Price_Market) & "</STRIKE></font>"
                strPrice = strPrice & "<br>" & strPrice_Shop & "<font class=""price"">" & GetPrice_FilterZero(Price_Original) & "</font>"
            End If
        Case 4, 5
            strPrice = strPrice & strPrice_Original & "<font class=""price""><STRIKE>" & GetPrice_FilterZero(Price_Original) & "</STRIKE></font>"
            strPrice = strPrice & "<br>" & strPrice_Te & "<font class=""price"">" & GetPrice_FilterZero(Price) & "</font>"
        Case Else
            strPrice = strPrice & strPrice_Shop & "<font class=""price"">" & GetPrice_FilterZero(Price) & "</font>"
        End Select

    Case 1  '只显示原价
        strPrice = strPrice & strPrice_Original & "<font class=""price"">" & GetPrice_FilterZero(Price_Original) & "</font>"
    Case 2  '只显示当前价
        If ProductType = 3 And Date >= BeginDate And Date <= EndDate Then
            strPrice = strPrice & strPrice_Te & "<font class=""price"">" & GetCurrentPrice(ProductType, BeginDate, EndDate, Price_Original, Price) & "</font><br>"
        Else
            strPrice = strPrice & strPrice_Now & "<font class=""price"">" & GetCurrentPrice(ProductType, BeginDate, EndDate, Price_Original, Price) & "</font><br>"
        End If
    Case 3  '只显示市场价与原价
        strPrice = strPrice & strPrice_Market & "<font class=""price"">" & GetPrice_Market(Price_Market) & "</font><br>"
        strPrice = strPrice & strPrice_Original & "<font class=""price"">" & GetPrice_FilterZero(Price_Original) & "</font>"
    Case 4  '只显示市场价与当前价
        strPrice = strPrice & strPrice_Market & "<font class=""price"">" & GetPrice_Market(Price_Market) & "</font><br>"
        If ProductType = 3 And Date >= BeginDate And Date <= EndDate Then
            strPrice = strPrice & strPrice_Te & "<font class=""price"">" & GetCurrentPrice(ProductType, BeginDate, EndDate, Price_Original, Price) & "</font><br>"
        Else
            strPrice = strPrice & strPrice_Now & "<font class=""price"">" & GetCurrentPrice(ProductType, BeginDate, EndDate, Price_Original, Price) & "</font><br>"
        End If
    Case 5  '只显示原价与当前价
        strPrice = strPrice & strPrice_Original & "<font class=""price"">" & GetPrice_FilterZero(Price_Original) & "</font><br>"
        If ProductType = 3 And Date >= BeginDate And Date <= EndDate Then
            strPrice = strPrice & strPrice_Te & "<font class=""price"">" & GetCurrentPrice(ProductType, BeginDate, EndDate, Price_Original, Price) & "</font><br>"
        Else
            strPrice = strPrice & strPrice_Now & "<font class=""price"">" & GetCurrentPrice(ProductType, BeginDate, EndDate, Price_Original, Price) & "</font><br>"
        End If
    Case 6  '只显示原价与会员价
        strPrice = strPrice & strPrice_Original & "<font class=""price"">" & GetPrice_FilterZero(Price_Original) & "</font><br>"
        strPrice = strPrice & strPrice_Member & "<font class=""price"">" & GetPrice_Member(Price_Member) & "</font>"
    Case 7  '显示市场价、原价和当前价
    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -