📄 powereasy.supply.asp
字号:
rsClass.MoveNext
iClassID = iClassID + 1
If iClassID Mod iCols = 0 And Not rsClass.EOF Then
ArticleList_ChildClass2 = ArticleList_ChildClass2 & strTemp
If iCols > 1 Then ArticleList_ChildClass2 = ArticleList_ChildClass2 & "</tr><tr>"
Else
ArticleList_ChildClass2 = ArticleList_ChildClass2 & strTemp
If iCols > 1 Then ArticleList_ChildClass2 = ArticleList_ChildClass2 & "<td width='1'></td>"
End If
Loop
rsClass.Close
Set rsClass = Nothing
End If
Dim strPath
strPath = ChannelUrl
Call getInfoListLable
If InStr(strHtml, "{$ShowPage}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage}", ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, ChannelItemUnit & ChannelShortName, False))
If InStr(strHtml, "{$ShowPage_en}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage_en}", ShowPage_en(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, ChannelItemUnit & ChannelShortName, False))
End Sub
Public Sub GetHtml_List()
Call ReplaceCommon
strHtml = PE_Replace(strHtml, "{$SpecialName}", SpecialName)
Call getInfoListLable
If InStr(strHtml, "{$ShowPage}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage}", ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, ChannelItemUnit & ChannelShortName, False))
If InStr(strHtml, "{$ShowPage_en}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage_en}", ShowPage_en(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, ChannelItemUnit & ChannelShortName, False))
End Sub
Public Sub GetHTML_Index()
strHtml = GetTemplate(ChannelID, 1, Template_Index)
ClassID = 0
Call ReplaceCommon
strHtml = Replace(strHtml, "{$ShowChannelCount}", GetChannelCount())
Call getInfoListLable
End Sub
Public Sub GetHTML_Search()
Dim SearchChannelID
SearchChannelID = ChannelID
If ChannelID > 0 Then
strHtml = GetTemplate(ChannelID, 5, 0)
Else
ChannelID = PE_CLng(Conn.Execute("select min(ChannelID) from PE_Channel where ModuleType=1 and Disabled=" & PE_False & "")(0))
strHtml = GetTemplate(ChannelID, 3, 0)
CurrentChannelID = ChannelID
Call GetChannel(ChannelID)
End If
ClassID = PE_CLng(Trim(Request("SelClass")))
Call ReplaceCommon
strHtml = Replace(strHtml, "{$Keyword}", Keyword)
strHtml = Replace(strHtml, "{$PageTitle}", strPageTitle)
strHtml = Replace(strHtml, "{$ShowPath}", ShowPath())
Call GetClass
strHtml = PE_Replace(strHtml, "{$ClassID}", ClassID)
strHtml = PE_Replace(strHtml, "{$ClassName}", ClassName)
strHtml = PE_Replace(strHtml, "{$ParentDir}", ParentDir)
strHtml = PE_Replace(strHtml, "{$ClassDir}", ClassDir)
strHtml = PE_Replace(strHtml, "{$Readme}", ReadMe)
strHtml = PE_Replace(strHtml, "{$SpecialName}", SpecialName)
strHtml = Replace(strHtml, "{$SearchResul}", SearchResult())
If InStr(strHtml, "{$ShowPage}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage}", ShowPage(strFileName, totalPut, MaxPerPage_SearchResult, CurrentPage, True, True, ChannelItemUnit & ChannelShortName, False))
If InStr(strHtml, "{$ShowPage_en}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage_en}", ShowPage_en(strFileName, totalPut, MaxPerPage_SearchResult, CurrentPage, True, True, ChannelItemUnit & ChannelShortName, False))
Call getInfoListLable
End Sub
Private Sub ReplaceCommon()
Call ReplaceCommonLabel
strHtml = PE_Replace(strHtml, "{$MenuJS}", GetMenuJS(ChannelDir, ShowClassTreeGuide))
strHtml = PE_Replace(strHtml, "{$Skin_CSS}", GetSkin_CSS(SkinID))
strHtml = PE_Replace(strHtml, "{$PageTitle}", strPageTitle)
strHtml = PE_Replace(strHtml, "{$ShowPath}", ShowPath())
strHtml = PE_Replace(strHtml, "{$ClassID}", ClassID)
strHtml = PE_Replace(strHtml, "{$ClassName}", ClassName)
strHtml = PE_Replace(strHtml, "{$ParentDir}", ParentDir)
strHtml = PE_Replace(strHtml, "{$ClassDir}", ClassDir)
strHtml = PE_Replace(strHtml, "{$Readme}", ReadMe)
End Sub
Private Function getUserType(ByVal UserType)
If PE_CLng(UserType) = 0 Then
getUserType = "个人会员"
Else
getUserType = "企业会员"
End If
End Function
Private Function getUserSex(ByVal UserSex)
Select Case PE_CLng(UserSex)
Case 0
getUserSex = "女"
Case 1
getUserSex = "男"
Case Else
getUserSex = "保密"
End Select
End Function
Private Function ShowSearchCondition(ByVal ShowStyle, ByVal SupplyTypeNum)
Dim strTemp
strTemp = "<script language='javascript'>" & vbCrLf
strTemp = strTemp & "function CheckInput()" & vbCrLf
strTemp = strTemp & "{" & vbCrLf
strTemp = strTemp & " if(document.Searchform.KeyWord.value=='')" & vbCrLf
strTemp = strTemp & " {" & vbCrLf
strTemp = strTemp & " alert('关键字不可以为空!');" & vbCrLf
strTemp = strTemp & " return false;" & vbCrLf
strTemp = strTemp & " }" & vbCrLf
strTemp = strTemp & "}" & vbCrLf
strTemp = strTemp & "</script>" & vbCrLf
SearchStyleFlag = ShowStyle
Select Case ShowStyle
Case 0
strTemp = strTemp & "<table cellSpacing=0 cellPadding=2 width='100%' align=center border=0>"
strTemp = strTemp & "<Form Name='Searchform' action='Search.asp' method=GET onSubmit='return CheckInput();'>"
strTemp = strTemp & "<tr><td>" & GetSupplyInfo_Radio(0, "SupplyType", "//SupplyType/Type", SupplyTypeNum) & "<INPUT Class='SupplySearchKeyWordStyle' TYPE=""Text"" NAME=""KeyWord"" Id=""KeyWord"" MaxLength='250' > <INPUT TYPE=""submit"" Value=""搜索信息""></td></tr>"
strTemp = strTemp & "<Input Type='Hidden' value='" & ShowStyle & "' Name='SearchType' id='SearchType'>"
strTemp = strTemp & "</Form>"
strTemp = strTemp & "</Table>"
ShowSearchCondition = strTemp
Case 1
strTemp = strTemp & "<table cellSpacing=0 cellPadding=2 width='100%' align=center border=0>"
strTemp = strTemp & "<tr align=left>"
strTemp = strTemp & "<Form Name='Searchform' action='Search.asp' method='GET' onSubmit='return CheckInput();'>"
strTemp = strTemp & "<td>搜索关键字:<Input Class='SupplySearchKeyWordStyle' Name='KeyWord' id='KeyWord' type='text' MaxLength='200' size='20'>"
strTemp = strTemp & " <Select Name='selClass' id='selClass'><option Value=-1>所有栏目</option>" & GetClass_Option(0) & "</Select></td>"
strTemp = strTemp & "<td>按地区:<Select Name='mySelectProvince' Id='mySelectProvince' OnChange=""getSelected('Region.asp?Province='+this.value,mySelectCity)""><Option value=-1>所有省份</Option></Select><Select Name='mySelectCity' Id='mySelectCity' ><option value=-1>所有城市</option></Select></td>"
strTemp = strTemp & "<td><INPUT TYPE=""submit"" Value=""搜索信息""></td>"
strTemp = strTemp & "<Input Type='Hidden' value='" & ShowStyle & "' Name='SearchType' id='SearchType'>"
strTemp = strTemp & "</form></tr>"
strTemp = strTemp & "</Table>"
ShowSearchCondition = strTemp
End Select
End Function
Private Function SearchResult()
Dim Province, City, SelClass, SupplyType, SearchType, QuerySql, strSql, strTemp
Province = ReplaceBadChar(Trim(Request("mySelectProvince")))
City = ReplaceBadChar(Trim(Request("mySelectCity")))
SelClass = PE_CLng(Trim(Request("SelClass")))
SearchType = PE_CLng(Trim(Request("SearchType")))
SupplyType = PE_CLng(Trim(Request("SupplyType")))
strSql = "Select Top " & MaxPerPage_SearchResult & " A.SupplyId,A.SupplyTitle,A.SupplyName,A.SupplyType,A.TradeType, "
strSql = strSql & " A.UpDateTime,B.Country,B.Province,B.City From PE_Supply A , PE_Contacter B, PE_User C"
QuerySql = " Where A.UserName=C.UserName and C.ContacterID = B.ContacterID and A.Status=1 And Deleted=" & PE_False & " "
Select Case SearchType
Case 0
QuerySql = QuerySql & " And A.SupplyType =" & SupplyType
If CurrentPage > 1 Then
strSql = strSql & QuerySql & " And A.SupplyId <=(Select Min(SupplyId) From (Select Top " & (CurrentPage - 1) * MaxPerPage_SearchResult + 1 & " SupplyId From PE_Supply A,PE_Contacter B,PE_User C " & QuerySql & " And A.SupplyType =" & SupplyType & " And A.SupplyTitle like '%" & Keyword & "%' Order By SupplyId DESC) As QueryTable) Order by A.SupplyId Desc"
Else
strSql = strSql & QuerySql & " And A.SupplyType =" & SupplyType & " And A.SupplyTitle like '%" & Keyword & "%' Order By A.SupplyID Desc"
End If
strFileName = ChannelUrl & "/Search.asp?SupplyType=" & SupplyType & "&KeyWord=" & Keyword & "&SearchType=" & SearchType & ""
totalPut = PE_CLng(Conn.Execute("Select Count(*) From PE_Supply A , PE_Contacter B, PE_User C Where A.UserName=C.UserName and C.ContacterID = B.ContacterID and A.Status=1 And A.SupplyType =" & SupplyType & " And A.SupplyTitle like '%" & Keyword & "%' ")(0))
Case 1
If Province <> "-1" Then
QuerySql = QuerySql & "And B.Province='" & Province & "'"
End If
If City <> "-1" Then
QuerySql = QuerySql & " And B.City = '" & City & "'"
End If
If SelClass > -1 Then
If Child > 0 Then
QuerySql = QuerySql & " and A.ClassID in (" & arrChildID & ")"
Else
QuerySql = QuerySql & " and A.ClassID=" & ClassID
End If
End If
If CurrentPage > 1 Then
strSql = strSql & QuerySql & "And A.SupplyId <=(Select Min(SupplyId) From (Select Top " & (CurrentPage - 1) * MaxPerPage_SearchResult + 1 & " SupplyId From PE_Supply A,PE_Contacter B,PE_User C " & QuerySql & " And A.SupplyTitle like '%" & Keyword & "%' Order by A.SupplyId DESC) As QueryTable) Order By A.SupplyID DESC"
Else
strSql = strSql & QuerySql & " And A.SupplyTitle like '%" & Keyword & "%' Order By A.SupplyID DESC "
End If
totalPut = PE_CLng(Conn.Execute("Select Count(*) From PE_Supply A , PE_Contacter B, PE_User C " & QuerySql & " And A.SupplyTitle like '%" & Keyword & "%'")(0))
strFileName = ChannelUrl & "/Search.asp?KeyWord=" & Keyword & "&selClass=" & SelClass & "&mySelectProvince=" & Province & "&mySelectCity=" & City & "&SearchType=" & SearchType & ""
End Select
Dim rsSupply
Set rsSupply = Server.CreateObject("Adodb.RecordSet")
rsSupply.Open strSql, Conn, 1, 1
If rsSupply.EOF And rsSupply.BOF Then
SearchResult = "<li>没有搜索到任何信息</li>"
rsSupply.Close
Set rsSupply = Nothing
Exit Function
Else
Do While Not rsSupply.EOF
strTemp = strTemp & "<tr><td><Img src='" & ChannelUrl & "/Images/article_common.gif' border=0/>"
strTemp = strTemp & "<font color=red>[" & GetSupplyInfoType(rsSupply("SupplyType"), "//SupplyType/Type") & "]</font>"
strTemp = strTemp & "<a href='" & ChannelUrl & "/ShowSupply.asp?SupplyId=" & rsSupply("SupplyId") & "'"
If OpenType = 0 Then
strTemp = strTemp & " target = '_self' "
Else
strTemp = strTemp & " target = '_blank' "
End If
strTemp = strTemp & ">" & rsSupply("SupplyTitle") & "</a></td><td align='center'>" & GetSupplyInfoType(rsSupply("TradeType"), "//TradeType/Type") & "</td><td>" & rsSupply("Province") & "/" & rsSupply("City") & "</td><td>" & rsSupply("UpDateTime") & "</td></tr>" & vbCrLf
rsSupply.MoveNext
Loop
End If
rsSupply.Close
Set rsSupply = Nothing
SearchResult = "<Table>" & strTemp & "</Table>"
End Function
'==================================================
'函数名:ShowPath
'作 用:显示“你现在所有位置”导航信息
'参 数:无
'==================================================
Private Function ShowPath()
If PageTitle <> "" Then
strNavPath = strNavPath & " " & strNavLink & " " & PageTitle
End If
ShowPath = strNavPath
End Function
Private Function GetClassUrl(iClassID)
GetClassUrl = ChannelUrl & "/ShowClass.asp?ClassID=" & iClassID
End Function
Private Function GetClass_1Url(iClassID)
GetClass_1Url = ChannelUrl & "/ShowClass.asp?ShowType=2&ClassID=" & iClassID
End Function
Private Function GetExecuteSql(ByVal PageType, ByVal ClassID, ByVal CommandType, ByVal IsNew, ByVal IsHot, ByVal ShowNum, ByVal SupplyType, ByVal Flage)
Dim strSql, QuerySql, MaxShowInfo
QuerySql = QuerySql & "From PE_Supply A,PE_Contacter B,PE_User C "
QuerySql = QuerySql & "Where A.UserName=C.UserName and C.ContacterID = B.ContacterID and A.Status=1 And Deleted=" & PE_False & " "
If Flage Then
QuerySql = QuerySql & " And A.SupplyPicUrl<>'' "
End If
Select Case PageType
Case 0
MaxShowInfo = ShowNum
Case 1 '栏目页
MaxShowInfo = MaxPerPage
If Child > 0 Then
totalPut = getInfoCounts(arrChildID, 0, SupplyType)
Else
totalPut = getInfoCounts(ClassID, 0, SupplyType)
End If
Case 2 '推荐页
MaxShowInfo = MaxPerPage_Elite
CommandType = 3
If Flage Then
totalPut = getInfoCounts(0, 5, SupplyType) '调用又图片的推荐信息
Else
totalPut = getInfoCounts(0, 2, SupplyType) '无图片的推荐信息
End If
Case 3 '热点页
MaxShowInfo = MaxPerPage_Hot
totalPut = getInfoCounts(0, 3, SupplyType)
Case 4 '专题页
MaxShowInfo = MaxPerPage_Special
totalPut = getInfoCounts(0, 4, SupplyType)
Case 5 '最新页
MaxShowInfo = MaxPerPage_New
totalPut = getInfoCounts(0, 1, SupplyType) '最新的信息
Case Else
MaxShowInfo = MaxPerPage_Index
End Select
If ClassID > 0 Then
If Child > 0 Then
QuerySql = QuerySql & " and A.ClassID in (" & arrChildID & ")"
Else
QuerySql = QuerySql & " and A.ClassID=" & ClassID
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -