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

📄 powereasy.product.asp

📁 个人网站比较简短
💻 ASP
📖 第 1 页 / 共 5 页
字号:
                CssName = CssName1
            Else
                CssName = CssName2
            End If
        Case 5
            If Trim(rsProductList("ProducerName") & "") = "" Then
                iAuthor = "无"
            Else
                If Right(rsProductList("ProducerName"), 1) = "|" Then
                    iAuthor = xml_nohtml(Left(rsProductList("ProducerName"), Len(rsProductList("ProducerName")) - 1))
                Else
                    iAuthor = xml_nohtml(rsProductList("ProducerName"))
                End If
            End If
            If ShowClassName = True And Product_ClassID <> -1 Then
                strThisClass = rsProductList("ClassName")
            Else
                strThisClass = ""
            End If
            XMLDOM.appendChild (XMLDOM.createElement("item"))
            Set Node = XMLDOM.documentElement.appendChild(XMLDOM.createElement("title"))
            Node.Text = xml_nohtml(TitleStr)
            Set Node = XMLDOM.documentElement.appendChild(XMLDOM.createElement("link"))
            Node.Text = strLink
            Set Node = XMLDOM.documentElement.appendChild(XMLDOM.createElement("description"))
            If ContentLen > 0 Then
                Node.Text = Left(Replace(Replace(nohtml(rsProductList("ProductIntro")), ">", "&gt;"), "<", "&lt;"), ContentLen)
            End If
            Set Node = XMLDOM.documentElement.appendChild(XMLDOM.createElement("author"))
            Node.Text = iAuthor
            Set Node = XMLDOM.documentElement.appendChild(XMLDOM.createElement("category"))
            If strThisClass <> "" Then Node.Text = strThisClass
            Set Node = XMLDOM.documentElement.appendChild(XMLDOM.createElement("pubDate"))
            Node.Text = rsProductList("UpdateTime")
            strProductList = strProductList & XMLDOM.documentElement.xml
            iCount = iCount + 1
        End Select
        rsProductList.MoveNext
        If UsePage = True And iCount >= MaxPerPage Then Exit Do
    Loop
    If ShowType = 2 Or Cols > 1 Then
        strProductList = strProductList & "</table>"
    End If
    rsProductList.Close
    Set rsProductList = Nothing
    If ShowType = 5 And RssCodeType = False Then strProductList = unicode(strProductList)
    GetProductList = strProductList
End Function

'=================================================
'函数名:GetPicProduct
'作  用:显示商品图片
'参  数:
'0        arrClassID  ----栏目ID数组,0为所有栏目
'1        IncludeChild ----是否包含子栏目,仅当arrClassID为单个栏目ID时才有效,True----包含子栏目,False----不包含
'2        iSpecialID ---- 专题ID,0为所有产品(含非专题产品),如果为大于0,则只显示相应专题的产品
'3        ProductNum  ---- 最多显示多少个产品
'4        ProductType ---- 产品类型,1为正常销售商品,2为涨价商品,3为降价商品,4为促销礼品,5为正常销售和涨价商品,0为所有商品
'5        IsHot        ----是否是热门产品
'6        IsElite      ----是否是推荐产品
'7        DateNum ----日期范围,如果大于0,则只显示最近几天内更新的产品
'8        OrderType ----排序方式,1--按产品ID降序,2--按产品ID升序,3--按上市时间降序,4--按上市时间升序,5--按点击数降序,6--按点击数升序,7--按评论数降序,8--按评论数升序
'9        ShowType   ----显示方式。1为图片+名称+价格+按钮:上下排列
'                                  2为(图片+名称:上下排列)+(名称+价格+按钮):左右排列
'                                  3为图片+(名称+价格+按钮:上下排列):左右排列
'                                  4为图片+名称+价格:上下排列
'                                  5为(图片+名称:上下排列)+价格:左右排列
'                                  6为图片+(名称+价格:上下排列):左右排列
'                                  7为图片+名称+按钮:上下排列
'                                  8为图片+名称:上下排列
'                                  9为图片+按钮:上下排列
'                                 10为只显示图片
'                                 11为输出DIV格式
'10       ImgWidth   ----产品宽度
'11       ImgHeight  ----产品高度
'12       TitleLen   ----名称最多字符数,一个汉字=两个英文字符。若为0,则不显示名称;若为-1,则显示完整名称
'13       Cols       ----每行的列数。超过此列数就换行。

'14       UrlType ---- 链接地址类型,0为相对路径,1为带网址的绝对路径,注意此参数不对外公布

'14       ShowPriceType ---- 显示价格方式,只有当ShowType参数设为含价格方式时才有效,0为自动显示,1为只显示原价,2为只显示当前价,3为只显示市场价与原价,4为只显示市场价与当前价,5为只显示原价与当前价,6为只显示原价与会员价,7为显示市场价、原价和当前价,8为显示市场价、原价和会员价,9为显示市场价、当前价和会员价,10为显示市场价、原价、当前价和会员价
'15       ShowDiscount  ---- 是否显示折扣率,只有当ShowType参数设为含价格方式时才有效
'16       ShowButtonType ---- 按钮显示方式,只有当ShowType参数设为含按钮方式时才有效,1为显示购买按钮,2为显示详细按钮,3为收藏按钮,4为显示购买+详细按钮,5为显示购买+收藏按钮,6为详细+收藏按钮,7为三个都显示
'17       ButtonStyle ----  按钮样式
'18       OpenType ---- 打开方式,0为原窗口打开,1为新窗口打开
'=================================================
Public Function GetPicProduct(arrClassID, IncludeChild, iSpecialID, ProductNum, ProductType, IsHot, IsElite, DateNum, OrderType, ShowType, ImgWidth, ImgHeight, TitleLen, Cols, UrlType, ShowPriceType, ShowDiscount, ShowButtonType, ButtonStyle, OpenType)
    Dim sqlPic, rsPic, iCount, TitleStr, strPic, strLink, trs

    iCount = 0
    ProductNum = PE_CLng(ProductNum)
    ShowType = PE_CLng(ShowType)
    ImgWidth = PE_CLng(ImgWidth)
    ImgHeight = PE_CLng(ImgHeight)
    Cols = PE_CLng(Cols)
    UrlType = PE_CLng(UrlType)

    If ProductNum < 0 Or ProductNum >= 100 Then ProductNum = 10
    If ImgWidth < 0 Or ImgWidth > 500 Then ImgWidth = 150
    If ImgHeight < 0 Or ImgHeight > 500 Then ImgHeight = 150
    If Cols <= 0 Then Cols = 5
    
    If ProductNum > 0 Then
        sqlPic = "select top " & ProductNum
    Else
        sqlPic = "select "
    End If
    sqlPic = sqlPic & " P.ProductID,P.ClassID,P.ProductName,P.ProductType,P.Price,Price_Original,P.Price_Market,P.Price_Member,BeginDate,EndDate,P.Discount,P.UpdateTime,P.ProductThumb"
    sqlPic = sqlPic & GetSqlStr(arrClassID, IncludeChild, iSpecialID, ProductType, IsHot, IsElite, DateNum, OrderType, False, False)

    Set rsPic = Server.CreateObject("ADODB.Recordset")
    rsPic.Open sqlPic, Conn, 1, 1
    If ShowType < 11 Then strPic = "<table cellpadding='0' cellspacing='5' border='0' width='100%'><tr valign='top'>"
    If rsPic.BOF And rsPic.EOF Then
        If ProductNum = 0 Then totalPut = 0
        If ShowType < 11 Then
            strPic = strPic & "<td align='center'><img class='pic5' src='" & strInstallDir & "images/nopic.gif' width='" & ImgWidth & "' height='" & ImgHeight & "' border='0'><br>" & R_XmlText_Class("PicProduct/NoFound", "没有任何图片{$ChannelShortName}") & "</td></tr></table>"
        Else
            strPic = "<div class=""pic_product""><img class=""pic5"" src=""" & strInstallDir & "images/nopic.gif"" width=""" & ImgWidth & """ height=""" & ImgHeight & """ border=""0""><br>" & R_XmlText_Class("PicProduct/NoFound", "没有任何图片{$ChannelShortName}") & "</div>"
        End If
        rsPic.Close
        Set rsPic = Nothing
        GetPicProduct = strPic
        Exit Function
    End If

    If ProductNum = 0 Then
        totalPut = rsPic.RecordCount
        If totalPut > 0 Then
            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
                If (CurrentPage - 1) * MaxPerPage < totalPut Then
                    iMod = 0
                    If CurrentPage > UpdatePages Then
                        iMod = totalPut Mod MaxPerPage
                        If iMod <> 0 Then iMod = MaxPerPage - iMod
                    End If
                    rsPic.Move (CurrentPage - 1) * MaxPerPage - iMod
                Else
                    CurrentPage = 1
                End If
            End If
        End If
    End If
    Do While Not rsPic.EOF
        If TitleLen <> 0 Then
            If TitleLen > 0 Then
                TitleStr = GetSubStr(rsPic("ProductName"), TitleLen, ShowSuspensionPoints)
            ElseIf TitleLen = -1 Then
                TitleStr = rsPic("ProductName")
            End If
        End If
        
        If UrlType = 0 Or Left(ChannelUrl, 1) <> "/" Then
            strLink = "<a href="""
        Else
            strLink = "<a href=""http://" & Trim(Request.ServerVariables("HTTP_HOST"))
        End If
        
        If UseCreateHTML > 0 Then
            strLink = strLink & GetProductUrl(rsPic("ParentDir"), rsPic("ClassDir"), rsPic("UpdateTime"), rsPic("ProductID")) & """"
        Else
            strLink = strLink & GetProductUrl("", "", "", rsPic("ProductID")) & """"
        End If
        strLink = strLink & " title=""" & rsPic("ProductName") & """"
        If OpenType = 0 Then
            strLink = strLink & " target=""_self"">"
        Else
            strLink = strLink & " target=""_blank"">"
        End If
        If ShowType < 11 Then
            strPic = strPic & "<td><table width='100%' cellspacing='2' border='0'>"
        Else
            strPic = strPic & "<div class=""pic_product"">" & vbCrLf
        End If
        
        Select Case PE_CLng(ShowType)
        Case 1  '图片+名称+价格+按钮:上下排列
            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>"
            strPic = strPic & "<tr><td align='left'>" & GetProductPrice(ShowPriceType, ShowDiscount, rsPic("ProductType"), rsPic("Price_Original"), rsPic("Price"), rsPic("Price_Market"), rsPic("Price_Member"), rsPic("BeginDate"), rsPic("EndDate"), rsPic("Discount")) & "</td></tr>"
            strPic = strPic & "<tr><td align='center'>" & GetButtons(ShowButtonType, ButtonStyle, rsPic("ProductID"), strLink) & "</td></tr>"
        Case 2  '(图片+名称:上下排列)+(名称+价格+按钮):左右排列
            strPic = strPic & "<tr><td align='center' class='productpic'>" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "</a></td>"
            strPic = strPic & "<td align='left'>" & strLink & TitleStr & "</a><br>" & GetProductPrice(ShowPriceType, ShowDiscount, rsPic("ProductType"), rsPic("Price_Original"), rsPic("Price"), rsPic("Price_Market"), rsPic("Price_Member"), rsPic("BeginDate"), rsPic("EndDate"), rsPic("Discount")) & "</td></tr>"
            strPic = strPic & "<tr><td align='center'>" & strLink & TitleStr & "</a></td>"
            strPic = strPic & "<td align='left'>" & GetButtons(ShowButtonType, ButtonStyle, rsPic("ProductID"), strLink) & "</td></tr>"
        Case 3  '图片+(名称+价格+按钮:上下排列):左右排列
            strPic = strPic & "<tr><td align='center' rowspan='2'>" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "</a></td>"
            strPic = strPic & "<td align='left'>" & strLink & TitleStr & "</a><br>" & GetProductPrice(ShowPriceType, ShowDiscount, rsPic("ProductType"), rsPic("Price_Original"), rsPic("Price"), rsPic("Price_Market"), rsPic("Price_Member"), rsPic("BeginDate"), rsPic("EndDate"), rsPic("Discount")) & "</td></tr>"
            strPic = strPic & "<tr><td align='left' valign='bottom'>" & GetButtons(ShowButtonType, ButtonStyle, rsPic("ProductID"), strLink) & "</td></tr>"
        Case 4  '图片+名称+价格:上下排列
            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>"
            strPic = strPic & "<tr><td align='left'>" & GetProductPrice(ShowPriceType, ShowDiscount, rsPic("ProductType"), rsPic("Price_Original"), rsPic("Price"), rsPic("Price_Market"), rsPic("Price_Member"), rsPic("BeginDate"), rsPic("EndDate"), rsPic("Discount")) & "</td></tr>"
        Case 5  '(图片+名称:上下排列)+价格:左右排列
            strPic = strPic & "<tr><td align='center' class='productpic'>" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "<br>" & TitleStr & "</a></td>"
            strPic = strPic & "<td align='left'>" & GetProductPrice(ShowPriceType, ShowDiscount, rsPic("ProductType"), rsPic("Price_Original"), rsPic("Price"), rsPic("Price_Market"), rsPic("Price_Member"), rsPic("BeginDate"), rsPic("EndDate"), rsPic("Discount")) & "</td></tr>"
        Case 6  '图片+(名称+价格:上下排列):左右排列
            strPic = strPic & "<tr><td align='center'>" & strLink & GetProductThumb(rsPic("ProductThumb"), ImgWidth, ImgHeight, UrlType) & "</a></td>"
            strPic = strPic & "<td align='left'>" & strLink & TitleStr & "</a><br>" & GetProductPrice(ShowPriceType, ShowDiscount, rsPic("ProductType"), rsPic("Price_Original"), rsPic("Price"), rsPic("Price_Market"), rsPic("Price_Member"), rsPic("BeginDate"), rsPic("EndDate"), rsPic("Discount")) & "</td></tr>"
        Case 7  '图片+名称+按钮:上下排列
            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>"

⌨️ 快捷键说明

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