📄 shopchannel.asp
字号:
End If
End If
rsClass.Close: Set rsClass = Nothing
Newasp.LoadTemplates ChannelID, 2, skinid
HtmlFilePath = Newasp.InstallDir & Newasp.ChannelDir & strFileDir
HtmlContent = Replace(Newasp.HtmlContent, "|||@@@|||", "")
HtmlContent = Replace(HtmlContent, "{$ChannelRootDir}", ChannelRootDir)
HtmlContent = Replace(HtmlContent, "{$InstallDir}", strInstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", ChannelID)
HtmlContent = Replace(HtmlContent, "{$ModuleName}", Newasp.ModuleName)
HtmlContent = Replace(HtmlContent, "{$ClassID}", ClassID)
HtmlContent = Replace(HtmlContent, "{$PageTitle}", strClassName)
HtmlContent = Replace(HtmlContent, "{$ShopIndex}", strIndexName)
HtmlContent = Replace(HtmlContent, "{$IndexTitle}", strIndexName)
ReplaceContent
maxparent = Newasp.ChkNumeric(Newasp.HtmlSetting(5))
maxperpage = CInt(Newasp.HtmlSetting(1))
If CLng(CurrentPage) = 0 Then CurrentPage = 1
TotalNumber = Newasp.Execute("SELECT COUNT(shopid) FROM NC_ShopList WHERE ChannelID = " & ChannelID & " And isAccept > 0 And ClassID in (" & ChildStr & ")")(0)
If maxparent > 0 And Child > 0 And TotalNumber > maxparent Then
strMaxParent = " TOP " & maxparent
TotalNumber = maxparent
Else
strMaxParent = ""
End If
TotalPageNum = CLng(TotalNumber / maxperpage) '得到总页数
If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
Set Rs = CreateObject("ADODB.Recordset")
SQL = "SELECT" & strMaxParent & " A.ShopID,A.ClassID,A.TradeName,A.Explain,A.PastPrice,A.NowPrice,A.star,A.ProductImage,A.addTime,A.AllHits,A.HtmlFileDate,A.isBest,C.ClassName,C.ParentID,C.ParentStr,C.skinid,C.HtmlFileDir,C.ChildStr,C.UseHtml FROM [NC_ShopList] A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID where A.ChannelID=" & ChannelID & " And A.isAccept > 0 And A.ClassID in (" & ChildStr & ") ORDER BY A.isTop DESC, A.addTime DESC ,A.shopid DESC"
If isSqlDataBase = 1 Then
Set Rs = Newasp.Execute(SQL)
Else
Rs.Open SQL, Conn, 1, 1
End If
If Err.Number <> 0 Then Response.Write "SQL 查询错误"
If Rs.BOF And Rs.EOF Then
HtmlContent = Replace(HtmlContent, "{$ReadListPage}", "还没有找到任何" & Newasp.ModuleName & "")
HtmlContent = Replace(HtmlContent, Newasp.CutFixContent(HtmlContent, "[ShowRepetend]", "[/ShowRepetend]", 1), "")
If CreateHtml <> 0 Then
Newasp.CreatPathEx (HtmlFilePath)
HtmlFileName = HtmlFilePath & ReadListPageName(ClassID, CurrentPage)
Newasp.CreatedTextFile HtmlFileName, HtmlContent
If IsShowFlush = 1 Then
Response.Write "<li style=""font-size: 12px;"">生成" & Newasp.ModuleName & "列表HTML完成... <a href=" & HtmlFileName & " target=_blank>" & Server.MapPath(HtmlFileName) & "</a></li>" & vbNewLine
Response.Flush
End If
End If
Else
TempListContent = Newasp.CutFixContent(HtmlContent, "[ShowRepetend]", "[/ShowRepetend]", 1)
If CreateHtml <> 0 Then
Call LoadShopHtmlList(n)
Else
Call LoadShopAspList
End If
End If
Rs.Close: Set Rs = Nothing
LoadShopList = HtmlContent
End Function
'================================================
'过程名:ReplaceContent
'作 用:替换模板内容
'================================================
Private Sub ReplaceContent()
HtmlContent = HTML.ReadCurrentStation(HtmlContent, ChannelID, ClassID, strClassName, ParentID, strParent, strFileDir)
HtmlContent = HTML.ReadAnnounceContent(HtmlContent, ChannelID)
HtmlContent = ReadClassMenubar(HtmlContent)
HtmlContent = ReadClassMenu(HtmlContent)
HtmlContent = HTML.ReadNewsPicAndText(HtmlContent)
HtmlContent = HTML.ReadPopularArticle(HtmlContent)
HtmlContent = HTML.ReadShopList(HtmlContent)
HtmlContent = HTML.ReadShopPic(HtmlContent)
HtmlContent = HTML.ReadStatistic(HtmlContent)
HtmlContent = Replace(HtmlContent, "{$SkinPath}", Newasp.SkinPath)
HtmlContent = Replace(HtmlContent, "{$InstallDir}", strInstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", ChannelID)
End Sub
'================================================
'过程名:LoadShopHtmlList
'作 用:装载商城列表HTML
'================================================
Private Sub LoadShopHtmlList(n)
Dim HtmlFileName
Dim Perownum,ii,w
Perownum = Newasp.ChkNumeric(Newasp.HtmlSetting(4))
If IsNull(TempListContent) Then Exit Sub
Newasp.CreatPathEx (HtmlFilePath)
For CurrentPage = n To TotalPageNum
Rs.MoveFirst
i = 0
If TotalPageNum > 1 Then Rs.Move (CurrentPage - 1) * maxperpage
ListContent = ""
j = (CurrentPage - 1) * maxperpage + 1
If Perownum > 1 Then
ListContent = Newasp.HtmlSetting(6)
w = FormatPercent(100 / Perownum / 100,0)
End If
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.end
If Perownum > 1 Then
ListContent = ListContent & "<tr valign=""top"">" & vbCrLf
For ii = 1 To Perownum
ListContent = ListContent & "<td width=""" & w & """ class=""shoplistrow"">"
If Not Rs.EOF Then
Call LoadListDetail
Rs.movenext
i = i + 1
j = j + 1
End If
ListContent = ListContent & "</td>" & vbCrLf
Next
ListContent = ListContent & "</tr>" & vbCrLf
Else
Call LoadListDetail
Rs.MoveNext
i = i + 1
j = j + 1
End If
If i >= maxperpage Then Exit Do
Loop
Dim strHtmlFront, strHtmlPage
strHtmlFront = Newasp.HtmlPrefix & Newasp.Supplemental(ClassID, 3) & "_"
strHtmlPage = ShowHtmlPage(CurrentPage, TotalPageNum, TotalNumber, maxperpage, strHtmlFront, Newasp.HtmlExtName, strClassName)
HtmlTemplate = HtmlContent
HtmlTemplate = Replace(HtmlTemplate, TempListContent, ListContent)
HtmlTemplate = Replace(HtmlTemplate, "{$ReadListPage}", strHtmlPage)
HtmlTemplate = Replace(HtmlTemplate, "[ShowRepetend]", "")
HtmlTemplate = Replace(HtmlTemplate, "[/ShowRepetend]", "")
'开始生成子分类的HTML页
HtmlFileName = HtmlFilePath & ReadListPageName(ClassID, CurrentPage)
Newasp.CreatedTextFile HtmlFileName, HtmlTemplate
If IsShowFlush = 1 Then
Response.Write "<li style=""font-size: 12px;"">生成" & Newasp.ModuleName & "列表HTML完成... <a href=" & HtmlFileName & " target=_blank>" & Server.MapPath(HtmlFileName) & "</a></li>" & vbNewLine
Response.Flush
End If
Next
End Sub
'================================================
'过程名:LoadShopAspList
'作 用:装载商城列表ASP
'================================================
Private Sub LoadShopAspList()
Dim Perownum,ii,w
If IsNull(TempListContent) Then Exit Sub
Perownum = Newasp.ChkNumeric(Newasp.HtmlSetting(4))
i = 0
Rs.MoveFirst
If TotalPageNum > 1 Then Rs.Move (CurrentPage - 1) * maxperpage
ListContent = ""
j = (CurrentPage - 1) * maxperpage + 1
If Perownum > 1 Then
ListContent = Newasp.HtmlSetting(6)
w = FormatPercent(100 / Perownum / 100,0)
End If
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.end
If Perownum > 1 Then
ListContent = ListContent & "<tr valign=""top"">" & vbCrLf
For ii = 1 To Perownum
ListContent = ListContent & "<td width=""" & w & """ class=""shoplistrow"">"
If Not Rs.EOF Then
Call LoadListDetail
Rs.movenext
i = i + 1
j = j + 1
End If
ListContent = ListContent & "</td>" & vbCrLf
Next
ListContent = ListContent & "</tr>" & vbCrLf
Else
Call LoadListDetail
Rs.MoveNext
i = i + 1
j = j + 1
End If
If i >= maxperpage Then Exit Do
Loop
If Perownum > 1 Then ListContent = ListContent & "</table>" & vbCrLf
Dim strPagination
strPagination = ShowListPage(CurrentPage, TotalPageNum, TotalNumber, maxperpage, ASPCurrentPage(PageType), strClassName)
HtmlContent = Replace(HtmlContent, TempListContent, ListContent)
HtmlContent = Replace(HtmlContent, "[ShowRepetend]", "")
HtmlContent = Replace(HtmlContent, "[/ShowRepetend]", "")
HtmlContent = Replace(HtmlContent, "{$ReadListPage}", strPagination)
End Sub
'================================================
'过程名:LoadListDetail
'作 用:装载子级软件列表细节
'================================================
Private Sub LoadListDetail()
Dim sTitle, sTopic, TradeName, ListStyle
Dim ShopUrl, ShopTime, sClassName,strProductImage
Dim ProductImageUrl, ProductImage,ProductIntro
Dim strlen
strlen = Newasp.ChkNumeric(Newasp.HtmlSetting(9))
ListContent = ListContent & TempListContent
If (i Mod 2) = 0 Then
ListStyle = 1
Else
ListStyle = 2
End If
If strlen > 0 Then
sTitle = Newasp.GotTopic(Rs("TradeName"),strlen)
Else
sTitle = Rs("TradeName")
End If
On Error Resume Next
If CInt(CreateHtml) <> 0 Then
ShopUrl = ChannelRootDir & Rs("HtmlFileDir") & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.HtmlPath) & ReadPagination(0)
sClassName = ChannelRootDir & Rs("HtmlFileDir")
Else
ShopUrl = ChannelRootDir & "show.asp?id=" & Rs("shopid")
sClassName = ChannelRootDir & "list.asp?classid=" & Rs("ClassID")
End If
If Not IsNull(Rs("ProductImage")) Then
strProductImage = Rs("ProductImage")
End If
ProductImageUrl = Newasp.GetImageUrl(strProductImage, Newasp.ChannelDir)
ProductImage = Newasp.GetFlashAndPic(ProductImageUrl, CInt(Newasp.HtmlSetting(7)), CInt(Newasp.HtmlSetting(8)))
ProductImage = "<a href='" & ShopUrl & "' title='" & Rs("TradeName") & "'>" & ProductImage & "</a>"
sClassName = "<a href='" & sClassName & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</a>"
TradeName = "<a href='" & ShopUrl & "' title='" & Rs("TradeName") & "' class=showtopic>" & sTitle & "</a>"
ProductIntro = Newasp.CutString(Rs("Explain"), CInt(Newasp.HtmlSetting(3)))
ShopTime = Newasp.ShowDateTime(Rs("addTime"), CInt(Newasp.HtmlSetting(2)))
ListContent = Replace(ListContent, "{$ClassifyName}", sClassName)
ListContent = Replace(ListContent, "{$TradeName}", TradeName)
ListContent = Replace(ListContent, "{$ShopTopic}", sTitle)
ListContent = Replace(ListContent, "{$ShopUrl}", ShopUrl)
ListContent = Replace(ListContent, "{$ProductImage}", ProductImage)
ListContent = Replace(ListContent, "{$ShopID}", Rs("shopid"))
ListContent = Replace(ListContent, "{$ShopHits}", Rs("AllHits"))
ListContent = Replace(ListContent, "{$Star}", Rs("star"))
ListContent = Replace(ListContent, "{$ShopDateTime}", ShopTime)
ListContent = Replace(ListContent, "{$ProductIntro}", ProductIntro)
ListContent = Replace(ListContent, "{$ListStyle}", ListStyle)
ListContent = Replace(ListContent, "{$PastPrice}", FormatNumber(Rs("PastPrice"),2,-1))
ListContent = Replace(ListContent, "{$NowPrice}", FormatNumber(Rs("NowPrice"),2,-1))
ListContent = Replace(ListContent, "{$IsTop}", Rs("IsTop"))
ListContent = Replace(ListContent, "{$IsBest}", Rs("IsBest"))
ListContent = Replace(ListContent, "{$Order}", j)
End Sub
'///---商城列表结束
'///----------------------------------------------
'///---购物车过程开始
'=================================================
'过程名:BuildShopping
'作 用:购物车
'=================================================
Public Sub BuildShopping()
Dim strContent,Action
Dim ProductIDList,ProductID,strProductID
Dim strProductList,i,StyleList
Dim Quantity,QuantityID,UnitPrice,TotalPrice
Dim ShoppingHint,MaxProduct
On Error Resume Next
Action = LCase(Newasp.CheckInfuse(Request("action"),8))
skinid = CLng(Newasp.ChannelSkin)
Newasp.LoadTemplates ChannelID, 6, skinid
MaxProduct = Newasp.ChkNumeric(Newasp.HtmlSetting(1))
If MaxProduct = 0 Then MaxProduct = 1
'--购物权限设置
If CInt(Newasp.GroupSetting(30)) = 0 Then
Call OutAlertScript(Newasp.CheckStr(Newasp.HtmlSetting(8)))
Exit Sub
End If
HtmlContent = Newasp.HtmlContent
HtmlContent = Replace(HtmlContent, "{$ChannelRootDir}", ChannelRootDir)
HtmlContent = Replace(HtmlContent, "{$InstallDir}", strInstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", ChannelID)
HtmlContent = Replace(HtmlContent, "{$ModuleName}", Newasp.ModuleName)
HtmlContent = Replace(HtmlContent, "{$ShopIndex}", strIndexName)
HtmlContent = Replace(HtmlContent, "{$PageTitle}", "我的购物车")
If Newasp.CheckStr(action) = "ok" Then
strProductList = Newasp.CheckRequest(Request("ProductID"),0)
Call ReformProduct(strProductList,MaxProduct)
ElseIf Newasp.CheckStr(action) = "del" Then
Response.Cookies("ProductIDList") = ""
ElseIf Newasp.CheckStr(action) = "add" Then
ProductID = Newasp.ChkNumeric(Request("id"))
If ProductID = 0 Then
Call OutAlertScript(Newasp.CheckStr(Newasp.HtmlSetting(6)))
Exit Sub
End If
ProductIDList = Newasp.CheckRequest(Request.Cookies("ProductIDList")("ProductID"),0)
Set Rs = CreateObject("ADODB.Recordset")
SQL = "SELECT AllHits,DayHits,WeekHits,MonthHits,HitsTime fROM NC_ShopList WHERE shopid = "& ProductID
Rs.Open SQL,Conn,1,3
If Not (Rs.BOF And Rs.EOF) Then
Rs("AllHits") = CCur(Rs("AllHits")) + 1
If DateDiff("Ww", Rs("HitsTime"), Now) <= 0 Then
Rs("WeekHits") = Rs("WeekHits") + 1
Else
Rs("WeekHits") = 1
End If
If DateDiff("M", Rs("HitsTime"), Now) <= 0 Then
Rs("MonthHits") = Rs("MonthHits") + 1
Else
Rs("MonthHits") = 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -