%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
PageTitle = "友情链接"
Dim SpecialID
KindType = PE_CLng(Trim(Request("KindType")))
LinkType = PE_CLng(Trim(Request("LinkType")))
KindID = PE_CLng(Trim(Request("KindID")))
SpecialID = PE_CLng(Trim(Request("SpecialID")))
strFileName = "Index.asp?KindType=" & KindType & "&LinkType=" & LinkType & "&KindID=" & KindID & "&SpecialID=" & SpecialID
If CurrentPage > 1 Or LinkType > 0 Or KindID > 0 Or SpecialID > 0 Or KindType > 0 Then
Call GetFriendSiteList
Else
If PE_Cache.CacheIsEmpty("FriendSite_Index") Then
Call GetFriendSiteList
PE_Cache.SetValue "FriendSite_Index", strHtml
Else
strHtml = PE_Cache.GetValue("FriendSite_Index")
End If
End If
Response.Write strHtml
Call CloseConn
Sub GetFriendSiteList()
Dim sqlLink, rsLink, strFriendSite, i
Dim LinkSiteUrl
ChannelID = 0
strHtml = GetTemplate(ChannelID, 5, 0)
Call ReplaceCommonLabel
strNavPath = strNavPath & strNavLink & " " & PageTitle
strHtml = Replace(strHtml, "{$PageTitle}", SiteTitle & " >> " & PageTitle)
strHtml = Replace(strHtml, "{$ShowPath}", strNavPath)
strHtml = Replace(strHtml, "{$MenuJS}", GetMenuJS("", False))
strHtml = Replace(strHtml, "{$Skin_CSS}", GetSkin_CSS(0))
Select Case KindType
Case 1, 2
strFriendSite = strFriendSite & "
"
Dim rsFsKind, sqlFsKind
sqlFsKind = "select KindID,KindName from PE_FsKind where KindType=" & KindType
If KindID > 0 Then
sqlFsKind = sqlFsKind & " and KindID=" & KindID
End If
sqlFsKind = sqlFsKind & " order by KindID"
Set rsFsKind = Conn.Execute(sqlFsKind)
If rsFsKind.BOF And rsFsKind.EOF Then
strFriendSite = strFriendSite & ("
"
If KindID > 0 Then
sqlLink = "select ID,SiteName,SiteUrl,SiteIntro from PE_FriendSite where Passed=" & PE_True & " "
Else
sqlLink = "select top 20 ID,SiteName,SiteUrl,SiteIntro from PE_FriendSite where Passed=" & PE_True & " "
End If
If rsFsKind("KindID") > 0 Then
If KindType = 1 Then
sqlLink = sqlLink & " and KindID=" & rsFsKind("KindID")
Else
sqlLink = sqlLink & " and SpecialID=" & rsFsKind("KindID")
End If
End If
sqlLink = sqlLink & " order by ID desc"
Set rsLink = Conn.Execute(sqlLink)
strFriendSite = strFriendSite & "
"
i = 0
Do While Not rsLink.EOF
If EnableCountFriendSiteHits = True Then
LinkSiteUrl = InstallDir & "FriendSite/FriendSiteUrl.asp?ID=" & rsLink("ID")
Else
LinkSiteUrl = rsLink("SiteUrl")
End If
strFriendSite = strFriendSite & "
")
sqlLink = "select * from PE_FriendSite where Passed=" & PE_True & " "
If LinkType > 0 Then
sqlLink = sqlLink & " and LinkType=" & LinkType
End If
If KindID > 0 Then
sqlLink = sqlLink & " and KindID=" & KindID
End If
If SpecialID > 0 Then
sqlLink = sqlLink & " and SpecialID=" & SpecialID
End If
sqlLink = sqlLink & " order by ID desc"
Set rsLink = Server.CreateObject("adodb.recordset")
rsLink.Open sqlLink, Conn, 1, 1
If rsLink.BOF And rsLink.EOF Then
strFriendSite = strFriendSite & "
"
Else
totalPut = rsLink.RecordCount
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
rsLink.Move (CurrentPage - 1) * MaxPerPage
Else
CurrentPage = 1
End If
End If
i = 0
strFriendSite = strFriendSite & "
"
If rsLink("LinkType") = 1 Then
If rsLink("LogoUrl") <> "" And rsLink("LogoUrl") <> "http://" Then
If LCase(Right(rsLink("LogoUrl"), 3)) = "swf" Then
strFriendSite = strFriendSite & ""
Else
strFriendSite = strFriendSite & ""
End If
Else
strFriendSite = strFriendSite & ""
End If
Else
strFriendSite = strFriendSite & " "
End If
strFriendSite = strFriendSite & "
"
i = i + 1
If i >= MaxPerPage Then Exit Do
rsLink.MoveNext
Loop
strFriendSite = strFriendSite & "
"
End If
rsLink.Close
Set rsLink = Nothing
End Select
strHtml = Replace(strHtml, "{$FriendSiteList}", strFriendSite)
If InStr(strHtml, "{$ShowPage}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage}", ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, XmlText("Site", "ShowFriendSiteList/PageChar", "个站点"), False))
If InStr(strHtml, "{$ShowPage_en}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage_en}", ShowPage_en(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, XmlText("Site", "ShowFriendSiteList/PageChar", "个站点"), False))
regEx.Pattern = "\<(.[^\<\!]*)\>"
Set Matches = regEx.Execute(strHtml)
For Each Match In Matches
strHtml = Replace(strHtml, Match.value, Replace(Match.value, "= ", "='' "))
Next
End Sub
%>