📄 classsight.asp
字号:
<%
Class ClassSight
Private HTML, CommonRegExp, EL_Channel
Private EL_Flag, CurrentPage, URLParameters, ReplaceKeyType
Private Sight_TravelDate, Sight_Person
Private Sub Class_Initialize
Set CommonRegExp = New RegExp
CommonRegExp.IgnoreCase = True
CommonRegExp.Global = True
EL_Flag = True
ReplaceKeyType = 0 '内容页字符替换模式 0:站内链接 1:字符过滤 2:两者
Set EL_Channel = New ClassChannel
EL_Channel.GetChannelConfig()
If EL_Channel.ErrorCode = 1 Or EL_Channel.ChannelType = 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelError", "频道参数错误"))
Call ApplicationTerminate()
End If
If EL_Channel.ChannelModule <> 5 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelModuleError", "频道模块错误"))
Call ApplicationTerminate()
End If
If EL_Channel.Disabled Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.Disabled", "该频道已被禁用"))
Call ApplicationTerminate()
End If
CurrentPage = EL_Common.ELRequest("page", 2)
URLParameters = request.ServerVariables("QUERY_STRING")
If CurrentPage<1 Then
CurrentPage = 1
Else
URLParameters = EL_Common.ReplaceText(URLParameters, "\&{0,}page=[0-9]*", "")
If URLParameters <> "" And Left(URLParameters, 1) = "&" Then URLParameters = Right(URLParameters, Len(URLParameters)-1)
End If
Sight_TravelDate = EL_Common.GetCookie(EL_Sn, "Sight_TravelDate")
Sight_Person = EL_Common.ELClng(EL_Common.GetCookie(EL_Sn, "Sight_Person"))
If Not IsDate(Sight_TravelDate) Then Sight_TravelDate = DateAdd("d", 1, Date())
If DateDiff("d", Date(), Sight_TravelDate)<1 Then Sight_TravelDate = DateAdd("d", 1, Date())
Sight_TravelDate = EL_Common.FormatDate(Sight_TravelDate)
If Sight_Person<1 Then Sight_Person = 1
Call EL_Common.SetCookie(EL_Sn, "Sight_TravelDate", Sight_TravelDate, 7)
Call EL_Common.SetCookie(EL_Sn, "Sight_Person", Sight_Person, 7)
End Sub
Private Sub Class_Terminate
Set CommonRegExp = Nothing
Set EL_Channel = Nothing
End Sub
Private Function ChannelCommonLabels(ByVal HTML)
'频道通用标签
Dim TempHTML
TempHTML = HTML
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelID}", ChannelID)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelName}", EL_Channel.ChannelName)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelPictrue}", EL_Channel.ChannelPictrue)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelDir}", EL_Channel.ChannelDir)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ItemName}", EL_Channel.ItemName)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ItemUnit}", EL_Channel.ItemUnit)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ClassItemName}", EL_Channel.ClassItemName)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$UploadDir}", EL_Channel.UploadDir)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$MetaKeywords}", "<meta name=""keywords"" content="""& EL_Channel.MetaKeywords &""" />")
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$MetaDescription}", "<meta name=""description"" content="""& EL_Channel.MetaDescription &""" />")
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Sight_TravelDate}", Sight_TravelDate)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Sight_Person}", Sight_Person)
ChannelCommonLabels = TempHTML
End Function
Public Sub CreateIndex()
HTML = EL_Common.Template(ChannelID, 1, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(EL_Channel.ChannelName, SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
EL_Common.ShowPath = EL_Common.ShowPath & EL_Common.Lang("BaseConfig.Path", " >> ") & EL_Channel.ChannelName
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = Label_GetSightList(HTML)
HTML = Label_GetSightPhoto(HTML)
Response.Write HTML
End Sub
Public Sub ShowCommend()
Dim StrCommend
StrCommend = EL_Common.Lang("BaseConfig.Commend", "推荐{$ItemName}")
StrCommend = EL_Common.RegExpStaticLabel(StrCommend, "{$ItemName}", EL_Channel.ItemName)
HTML = EL_Common.Template(ChannelID, 4, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(EL_Common.Join2String(StrCommend, EL_Channel.ChannelName, EL_Common.TitleDivide), SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
EL_Common.ShowPath = EL_Common.ShowPath & EL_Common.Lang("BaseConfig.Path", " >> ") &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/'>"& EL_Channel.ChannelName &"</a>"& EL_Common.Lang("BaseConfig.Path", " >> ") & StrCommend
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowCommendList}", SightList(ChannelID, 0, 8, 90, 3, 1, True, True, 4, 0, 1, 1, 5, True, True, "", "", ""))
HTML = Label_GetSightList(HTML)
HTML = Label_GetSightPhoto(HTML)
Response.Write HTML
End Sub
Public Sub Search()
Dim SearchCmd, rsSearch, RowCount, i, StrPath
Dim PageSizes, PageCounts, TotalRowCount
Dim PriceArea, MinPrice, MaxPrice
Dim Search_SightName, Search_AroundHotel, Search_AroundSight, Search_Address, Search_Price
Dim Search_Province, Search_City, Search_Area
If IsDate(Session("EL_LastSearchDateTime")) Then
If DateDiff("s", Session("EL_LastSearchDateTime"), Now()) < SearchInterval Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("Search.Error1", "为节省系统资源,请在{$SearchInterval}秒后再执行搜索……"), "{$SearchInterval}", SearchInterval))
Exit Sub
End If
End If
Search_SightName = EL_Common.ELRequest("SightName", 3)
Search_AroundHotel = EL_Common.ELRequest("AroundHotel", 3)
Search_AroundSight = EL_Common.ELRequest("AroundSight", 3)
Search_Address = EL_Common.ELRequest("Address", 3)
Search_Price = EL_Common.ELRequest("Price", 2)
Search_Province = EL_Common.ELRequest("sProvince", 3)
Search_City = EL_Common.ELRequest("sCity", 3)
Search_Area = EL_Common.ELRequest("sArea", 3)
PriceArea = EL_Common.Lang("Sight.SearchField.PriceArea.a"& Search_Price &".value", "0-1000")
If PriceArea = "" Then PriceArea = "0-1000"
PriceArea = Split(PriceArea, "-")
If UBound(PriceArea)=1 Then
MinPrice =EL_Common.ELClng(PriceArea(0))
MaxPrice = EL_Common.ELClng(PriceArea(1))
Else
MinPrice = 0
MaxPrice = 1000
End If
If MinPrice<0 Then MinPrice = 0
If MaxPrice<=0 Then MaxPrice = 1000
Call EL_Common.InitCommand(SearchCmd, "EL_SP_SearchSight")
With SearchCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@Province", 200, 1, 30, Search_Province)
.Parameters.Append .CreateParameter("@City", 200, 1, 30, Search_City)
.Parameters.Append .CreateParameter("@Area", 200, 1, 30, Search_Area)
.Parameters.Append .CreateParameter("@SightName", 200, 1, 255, Search_SightName)
.Parameters.Append .CreateParameter("@AroundHotel", 200, 1, 255, Search_AroundHotel)
.Parameters.Append .CreateParameter("@AroundSight", 200, 1, 255, Search_AroundSight)
.Parameters.Append .CreateParameter("@Address", 200, 1, 255, Search_Address)
.Parameters.Append .CreateParameter("@MinPrice", 6, 1, 8, MinPrice)
.Parameters.Append .CreateParameter("@MaxPrice", 6, 1, 8, MaxPrice)
.Parameters.Append .CreateParameter("@OrderType", 3, 1, 4, 9)
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSizes", 3, 2, 4)
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@RowCount", 3, 2, 4)
Set rsSearch = .Execute()
End With
rsSearch.Close()
PageSizes = SearchCmd(13)
TotalRowCount = SearchCmd(14)
PageCounts = SearchCmd(15)
RowCount = SearchCmd(16)
HTML = EL_Common.Template(ChannelID, 5, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
Dim SearchTitle
SearchTitle = EL_Common.RegExpStaticLabel(EL_Common.Lang("Search.Title", "{$ItemName}搜索"), "{$ItemName}", EL_Channel.ItemName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(SearchTitle, SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
StrPath = EL_Common.Lang("BaseConfig.Path", " >> ")
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/Index.asp'>"& EL_Channel.ChannelName &"</a>"& StrPath & SearchTitle
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_SightName}", Search_SightName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_AroundHotel}", Search_AroundHotel)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_AroundSight}", Search_AroundSight)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_Address}", Search_Address)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_Price}", Search_Price)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_Province}", Search_Province)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_City}", Search_City)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_Area}", Search_Area)
Dim Match, Matches, ReturnString
Dim TempString, MatchString, NoList, PriceIcon
PriceIcon = EL_Common.Lang("BaseConfig.PriceIcon", "¥")
CommonRegExp.Pattern = "\[ArrSearchResult\][\w\W]*\[\/ArrSearchResult\]"
Set Matches = CommonRegExp.Execute(HTML)
NoList = EL_Common.RegExpStaticLabel(EL_Common.Lang("Search.NoList", "<p> </p>搜索不到任何{$ItemName}<p> </p>"), "{$ItemName}", EL_Channel.ItemName)
If RowCount = 0 Then
For Each Match in Matches
HTML = Replace(HTML, Match.Value, NoList)
Next
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPage}", "")
Else
rsSearch.Open()
For Each Match in Matches
rsSearch.MoveFirst
MatchString = Match.Value
MatchString = EL_Common.ReplaceText(MatchString, "\[ArrSearchResult\]", "")
MatchString = EL_Common.ReplaceText(MatchString, "\[\/ArrSearchResult\]", "")
ReturnString = ""
Dim ItemHTML
For i = 1 To RowCount
ItemHTML = MatchString
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_SightID}", rsSearch("SightID"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Province}", EL_Common.HTMLEncode(rsSearch("Province")))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_City}", EL_Common.HTMLEncode(rsSearch("City")))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Area}", EL_Common.HTMLEncode(rsSearch("Area")))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_SightName}", EL_Common.HTMLEncode(rsSearch("SightName")))
If rsSearch("Commended") Then
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Commend}", "<img src='"& InstallDir & EL_Channel.ChannelDir &"/Images/Commend.gif' border=0>")
Else
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Commend}", "")
End If
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_BookPrice}", PriceIcon & rsSearch("BookPrice"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_OpenTime}", rsSearch("OpenTime"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Address}", rsSearch("Address"))
If Trim(rsSearch("DefaultPictrue")) = "" Then
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_DefaultPictrue}", "")
Else
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_DefaultPictrue}", "<img src='"& EL_Common.PictrueURL(rsSearch("DefaultPictrue"), EL_Channel.FilePath) &"' width=110 height=80 border=0>")
End If
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_TravelHint}", EL_Common.GetTopic(EL_Common.RemoveHTML(rsSearch("TravelHint")), EL_Common.Lang("Sight.ContentLen", 250)))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Content}", EL_Common.GetTopic(EL_Common.RemoveHTML(rsSearch("Content")), EL_Common.Lang("Sight.ContentLen", 250)))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_AroundSight}", AroundInfoURL(rsSearch("AroundSight")))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_AroundHotel}", AroundInfoURL(rsSearch("AroundHotel")))
ReturnString = ReturnString & ItemHTML
If i<RowCount Then rsSearch.MoveNext
Next
HTML = Replace(HTML, Match.Value, ReturnString)
Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -