📄 powereasy.product.asp
字号:
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Dim ProductID, ProductName, ProductUrl
Dim rsProduct
Class Product
Private ChannelID
Private strPrice_Market, strPrice_Shop, strPrice_Member, strPrice_Original, strPrice_Te, strPrice_Time, strPrice_Now
'定义其它全局的变量
Private rsClass, NoPrice, NoPrice_Member, NoPrice_Market
Public Sub Init()
FoundErr = False
ErrMsg = ""
ChannelID = 1000
If XmlDoc.Load(Server.MapPath(InstallDir & "Language/Gb2312_Channel_" & ChannelID & ".xml")) = False Then XmlDoc.Load (Server.MapPath(InstallDir & "Language/Gb2312.xml"))
'*****************************
'读取语言包中的字符设置
ChannelShortName = XmlText_Class("ChannelShortName", "商品")
strListStr_Font = XmlText_Class("ProductList/UpdateTimeColor_New", "color=""red""")
strTop = XmlText_Class("ProductList/t4", "固顶")
strElite = XmlText_Class("ProductList/t3", "推荐")
strCommon = XmlText_Class("ProductList/t5", "普通")
strHot = XmlText_Class("ProductList/t7", "热点")
strNew = XmlText_Class("ProductList/t6", "最新")
strTop2 = XmlText_Class("ProductList/Top", " 顶")
strElite2 = XmlText_Class("ProductList/Elite", " 荐")
strHot2 = XmlText_Class("ProductList/Hot", " 热")
Character_Author = XmlText("Product", "Include/Author", "[{$Text}]")
Character_Date = XmlText("Product", "Include/Date", "[{$Text}]")
Character_Hits = XmlText("Product", "Include/Hits", "[{$Text}]")
Character_Class = XmlText("Product", "Include/ClassChar", "[{$Text}]")
SearchResult_Content_NoPurview = XmlText("BaseText", "SearchPurviewContent", "此内容需要有指定权限才可以预览")
SearchResult_ContentLenth = PE_CLng(XmlText_Class("ShowSearch/Content_Lenght", "200"))
strList_Content_Div = XmlText_Class("ProductList/Content_DIV", "style=""padding:0px 20px""")
strList_Title = R_XmlText_Class("ProductList/Title", "{$ChannelShortName}标题:{$Title}{$br}作 者:{$Author}{$br}更新时间:{$UpdateTime}")
strComment = XmlText_Class("ProductList/CommentLink", "<font color=""red"">评论</font>")
NoPrice = XmlText_Class("NoPrice", "0")
NoPrice_Member = XmlText_Class("NoPrice_Member", "—")
NoPrice_Market = XmlText_Class("NoPrice_Market", "—")
strPrice_Market = XmlText_Class("ProductPrice/Price_Market", "市场价:")
strPrice_Shop = XmlText_Class("ProductPrice/Price", "商城价:")
strPrice_Member = XmlText_Class("ProductPrice/Price_Member", "会员价:")
strPrice_Original = XmlText_Class("ProductPrice/Price_Original", "原 价:")
strPrice_Te = XmlText_Class("ProductPrice/Price_Te", "特 价:")
strPrice_Time = XmlText_Class("ProductPrice/Price_Time", "时 间:")
strPrice_Now = XmlText_Class("ProductPrice/Price_Now", "现 价:")
'*****************************
strPageTitle = SiteTitle
Call GetChannel(ChannelID)
HtmlDir = InstallDir & ChannelDir
If Trim(ChannelName) <> "" And ShowNameOnPath <> False Then
strNavPath = strNavPath & " " & strNavLink & " <a class='LinkPath' href='"
If UseCreateHTML > 0 Then
strNavPath = strNavPath & ChannelUrl & "/Index" & FileExt_Index
Else
strNavPath = strNavPath & ChannelUrl_ASPFile & "/Index.asp"
End If
strNavPath = strNavPath & "'>" & ChannelName & "</a>"
strPageTitle = strPageTitle & " >> " & ChannelName
End If
'response.write "ChannelID =" & ChannelID
'response.write "ChannelUrl =" & ChannelUrl
End Sub
'=================================================
'函数名:ShowChannelCount
'作 用:显示频道统计信息
'参 数:无
'=================================================
Private Function GetChannelCount()
Dim strCount
strCount = Replace(Replace(Replace(Replace(R_XmlText_Class("ChannelCount", "{$ChannelShortName}总数: {$ItemChecked_Channel} {$ChannelItemUnit}<br>评论总数: {$CommentCount_Channel} 条<br>专题总数: {$SpecialCount_Channel} 个<br>"), "{$ItemChecked_Channel}", ItemChecked_Channel), "{$ChannelItemUnit}", ChannelItemUnit), "{$CommentCount_Channel}", CommentCount_Channel), "{$SpecialCount_Channel}", SpecialCount_Channel)
GetChannelCount = strCount
End Function
Private Function GetSqlStr(arrClassID, IncludeChild, iSpecialID, ProductType, IsHot, IsElite, DateNum, OrderType, ShowClassName, IsPicUrl)
Dim strSql, IDOrder
iSpecialID = PE_CLng(iSpecialID)
If UseCreateHTML > 0 Or ShowClassName = True Then
strSql = ",C.ClassName,C.ParentDir,C.ClassDir,C.Readme,C.ClassPurview"
If iSpecialID > 0 Then
strSql = strSql & " from PE_InfoS I inner join (PE_Product P left join PE_Class C on P.ClassID=C.ClassID) on I.ItemID=P.ProductID"
Else
strSql = strSql & " from PE_Product P left join PE_Class C on P.ClassID=C.ClassID"
End If
Else
If iSpecialID > 0 Then
strSql = " from PE_InfoS I inner join PE_Product P on I.ItemID=P.ProductID"
Else
strSql = " from PE_Product P"
End If
End If
strSql = strSql & " where P.Deleted=" & PE_False & " and P.EnableSale=" & PE_True
If InStr(arrClassID, ",") > 0 Then
strSql = strSql & " and P.ClassID in (" & FilterArrNull(arrClassID, ",") & ") "
Else
arrClassID = PE_CLng(arrClassID)
If arrClassID > 0 Then
If IncludeChild = True Then
Dim trs
Set trs = Conn.Execute("select arrChildID from PE_Class where ChannelID=" & ChannelID & " and ClassID=" & arrClassID & "")
If trs.BOF And trs.EOF Then
arrClassID = 0
Else
If IsNull(trs(0)) Or Trim(trs(0)) = "" Then
arrClassID = 0
Else
arrClassID = trs(0)
End If
End If
Set trs = Nothing
End If
If InStr(arrClassID, ",") > 0 Then
strSql = strSql & " and P.ClassID in (" & arrClassID & ") "
Else
If PE_CLng(arrClassID) > 0 Then strSql = strSql & " and P.ClassID=" & PE_CLng(arrClassID)
End If
End If
End If
If iSpecialID > 0 Then
strSql = strSql & " and I.ModuleType=5 and I.SpecialID=" & iSpecialID
End If
Select Case PE_CLng(ProductType)
Case 1 '正常销售
strSql = strSql & " and (P.ProductType=1 or (P.ProductType=3 and (BeginDate>" & PE_Now & " or EndDate<" & PE_Now & ")))"
Case 2 '涨价商品
strSql = strSql & " and P.ProductType=2"
Case 3 '特价处理商品
strSql = strSql & " and (P.ProductType=3 and BeginDate<=" & PE_Now & " and EndDate>=" & PE_Now & ")"
Case 4 '或促销礼品
strSql = strSql & " and P.ProductType=4"
Case 5 '正常销售和涨价商品
strSql = strSql & " and P.ProductType<3"
Case 6 '降价促销商品
strSql = strSql & " and P.ProductType=5"
Case Else
'不指定商品类型
End Select
If IsHot = True Then
strSql = strSql & " and P.IsHot=" & PE_True & ""
End If
If IsElite = True Then
strSql = strSql & " And P.IsElite=" & PE_True & ""
End If
If DateNum > 0 Then
strSql = strSql & " and DateDiff(" & PE_DatePart_D & ",P.UpdateTime," & PE_Now & ")<" & DateNum
End If
If IsPicUrl = True Then
strSql = strSql & " and P.ProductThumb<>'' "
End If
strSql = strSql & " order by P.OnTop " & PE_OrderType & ","
Select Case PE_CLng(OrderType)
Case 1, 2
Case 3
strSql = strSql & "P.UpdateTime desc,"
Case 4
strSql = strSql & "P.UpdateTime asc,"
Case 5
strSql = strSql & "P.Hits desc,"
Case 6
strSql = strSql & "P.Hits asc,"
Case 7
strSql = strSql & "P.CommentCount desc,"
Case 8
strSql = strSql & "P.CommentCount asc,"
Case Else
End Select
If OrderType = 2 Then
IDOrder = "asc"
Else
IDOrder = "desc"
End If
If iSpecialID > 0 Then
strSql = strSql & "I.InfoID " & IDOrder
Else
strSql = strSql & "P.ProductID " & IDOrder
End If
GetSqlStr = strSql
End Function
'=================================================
'函数名:GetProductList
'作 用:显示产品名称等信息
'参 数:
'0 arrClassID ---栏目ID数组,0为所有栏目
'1 IncludeChild ----是否包含子栏目,仅当arrClassID为单个栏目ID时才有效,True----包含子栏目,False----不包含
'2 iSpecialID ------专题ID,0为所有产品(含非专题产品),如果为大于0,则只显示相应专题的产品
'3 ProductNum ---产品数,若大于0,则只查询前几个产品
'4 ProductType ---- 产品类型,1为正常销售商品,2为涨价商品,3为降价商品,4为促销礼品,5为正常销售和涨价商品,0为所有商品
'5 IsHot ------------是否是热门产品,True为只显示热门产品,False为显示所有产品
'6 IsElite ----------是否是推荐产品,True为只显示推荐产品,False为显示所有产品
'7 DateNum ----日期范围,如果大于0,则只显示最近几天内更新的产品
'8 OrderType ----排序方式,1--按产品ID降序,2--按产品ID升序,3--按上市时间降序,4--按上市时间升序,5--按点击数降序,6--按点击数升序,7--按评论数降序,8--按评论数升序
'9 ShowType -----显示方式,1为普通样式,2为表格式,3为各项独立式 4为输出DIV格式 5为输出RSS格式
'10 TitleLen ----名称最多字符数,一个汉字=两个英文字符,若为0,则显示完整名称
'11 ContentLen ---产品简介最多字符数,一个汉字=两个英文字符,为0时不显示。
'12 ShowClassName -----是否显示所属栏目名称,True为显示,False为不显示
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -