<% '************************************************************** ' 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 & ("") Else Do While Not rsFsKind.EOF 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 & "" i = i + 1 If i Mod 4 = 0 Then strFriendSite = strFriendSite & "" End If rsLink.MoveNext Loop strFriendSite = strFriendSite & "" rsFsKind.MoveNext Loop rsLink.Close Set rsLink = Nothing End If rsFsKind.Close Set rsFsKind = Nothing strFriendSite = strFriendSite & "
" & XmlText("Site", "Errmsg/FriendSiteErr", "暂时还没有类别或专题的友情链接。") & "
" & rsFsKind("KindName") & "
" & rsLink("SiteName") & "
" Case Else strFriendSite = strFriendSite & ("
" & XmlText("Site", "ShowFriendSiteList/t1", "分类显示:") & GetLinkType_Option & " " & GetFsKind_Option(1) & " " & GetFsKind_Option(2) & "
") 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 & "
" & XmlText("Site", "ShowFriendSiteList/t2", "共有 0 个友情链接") & "
" 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 & "" strFriendSite = strFriendSite & "" strFriendSite = strFriendSite & XmlText("Site", "ShowFriendSiteList/t3", "") strFriendSite = strFriendSite & "" Dim strT4, strT5 strT4 = XmlText("Site", "ShowFriendSiteList/t4", "LOGO链接") strT5 = XmlText("Site", "ShowFriendSiteList/t5", "文字链接") 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 & "" strFriendSite = strFriendSite & "" strFriendSite = strFriendSite & "" strFriendSite = strFriendSite & "" strFriendSite = strFriendSite & "" strFriendSite = strFriendSite & "" strFriendSite = strFriendSite & "" strFriendSite = strFriendSite & "" i = i + 1 If i >= MaxPerPage Then Exit Do rsLink.MoveNext Loop strFriendSite = strFriendSite & "
链接类型网站名称网站LOGO网站简介站长操作
" If rsLink("LinkType") = 1 Then strFriendSite = strFriendSite & "" & strT4 & "" Else strFriendSite = strFriendSite & "" & strT5 & "" End If strFriendSite = strFriendSite & "" & rsLink("SiteName") & "" 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 & "" & rsLink("SiteIntro") & "" & rsLink("SiteAdmin") & "" strFriendSite = strFriendSite & "修改 " strFriendSite = strFriendSite & "删除" 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 %>