<%@ Language=VBScript %> <% option explicit response.buffer = true '********************************************************************************************** '*日期:2005-5-18 '*更新记录 '* 创建此代码 2005-5-18 '*用途:显示友情链接 '********************************************************************************************** %> <% on error resume next response.write gShowPageByNo(vSiteName) if err then response.write "Show Page Error:" & err.description response.end end if function gShowPageByNo(vSiteName) on error resume next dim vTemplatePath vTemplatePath=mGetTemplePath(vSiteName) LoadTemplate server.mappath(vTemplatePath) & "/Default.htm", "All" if err then UnloadTemplate response.write "Load default template error:" & err.description response.end end if SetVar "PageName","友情链接" SetVar "SiteName",vSiteName SetVar "TemplatePath",vTemplatePath mShowHeader vSiteName mShowNavigationTop vSiteName,"no" '显示当前位置(位于顶部) '------------------------------------------------------------------ LoadTemplate server.mappath(vTemplatePath) & "/Links/LinkSee.htm", "Main" if err then UnloadTemplate response.write "Load friend link template error:" & err.description response.end end if ShowFriendLink vSiteName Parse "Main",true '------------------------------------------------------------------- mShowNavigationBottom vSiteName,"no" '显示当前位置(位于底部) mShowFooter vSiteName Parse "All",false gShowPageByNo=PrintVar("All") UnloadTemplate end function Function ShowFriendLink(vSiteName) dim objBase_Links set objBase_Links=new clsBase_Links '查询构建,此处还可以放一些固定的查询条件和排序条件等 With objBase_Links .GetAllByQuery "And Enabled<>0 Order By OrderStr Desc" if Not .Eof Then Dim k,vLinksTemp k=0 vLinksTemp="" Session("Links_Tr_Link")="End" Do While Not .Eof K=K+1 'response.Write("K"&K&"
") If ((k-1) mod 6)=0 Then vLinksTemp=vLinksTemp&"" Session("Links_Tr_Link")="Begin" 'response.Write(K&"tr
") End If If .LinkImgType=0 Then vLinksTemp=vLinksTemp&"" Else vLinksTemp=vLinksTemp&"" End If If (k mod 6)=0 and (Not .Eof) Then vLinksTemp=vLinksTemp&"" Session("Links_Tr_Link")="End" 'response.Write(K&"/tr
") End If .MoveNext Loop Do While 1=1 K=K+1 If (k mod 6)<>0 And Session("Links_Tr_Link")<>"End" Then vLinksTemp=vLinksTemp&" " ElseIf (k mod 6)=0 And Session("Links_Tr_Link")<>"End" Then vLinksTemp=vLinksTemp&" " Session("Links_Tr_Link")="End" Else Exit Do End IF Loop SetVar "FriendLink_Content",vLinksTemp Parse "FriendLink",false End If End With set objBase_Links=Nothing End Function %>