<!--#include file="head.asp"-->
<!--#include file="Config.asp"-->

<%
Call head()
Call saycardb("友链")



dim Rs,Sql,Countt
dim getday
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"select [linkactive] from [admin]",conn,1,1
if not rs.eof then
getday=rs("linkactive")
end if
call rsclose
 response.write"<img src='"&linklogo&"' alt='.'/><br/>"
'n天自动隐藏

conn.Execute("update link set del=1 Where YD_time <= '"&date()-getday&"'")
Countt=conn.execute("Select count(ID) from [link] Where del=1")(0)
%>
==网站分类==<br/>
<%dim linkindex
set rs = server.createobject("adodb.recordset")
rs.open"select linkindex from admin",conn,1,1
if rs.eof then
    Call rsClose()
    Call Error("资料没有配置！")
  end if
  linkindex=rs("linkindex")
    Call rsClose()
  if linkindex=0 then
set rs1 = server.createobject("adodb.recordset")
	sql1="select * from linkclass order by pid asc"
	rs1.open sql1,conn,1,1
        if rs1.eof then
        response.write("暂无分类<br/>")
        else
i=1
do while not rs1.eof
set Rss=Server.CreateObject("ADODB.Recordset")
Sqls="select top 4 [ID],[namt],[classid] from [link] Where [Active] =0 and del=0 and classid="&rs1("classid")&" order by [YD_time] desc"
rss.open Sqls,conn,1,1
Response.write "【<a href=""list.asp?class="&rs1("classid")&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"&usb(rs1("Class"))&"</a>】"
If rss.eof then
   Response.write "暂时还没有<br/>"& chr(13) 
Else
for i=1 to 6
Response.write "<a href='view.asp?class="&rss("classid")&"&amp;id="&rss("id")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&usb(rss("namt"))&"</a>"& chr(13) 
rss.Movenext
if rss.EOF then Exit for
Next
Response.write "<br/>"& chr(13) 
End if
Call rssClose()
i=i+1
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
else
set rs = server.createobject("adodb.recordset")
	sql="select * from linkclass order by pid asc"
	rs.open sql,conn,1,1
if not (rs.bof and rs.eof)  then 
For i=1 to rs.RecordCount    '完全循环下去
If Rs.Eof Then
exit For
End If
if rs("br")="1" then '换行标识
br="<br/>"
else
br=""
end if
Response.write "<a href=""list.asp?class="&rs("classid")&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"&usb(rs("class"))&"</a> "& br &"" 
Rs.MoveNext
Next
end if
Call rsClose()
end If
Response.write "-----------<br/>"
'---------------------------

set Rs=Server.CreateObject("ADODB.Recordset")
Sql="select [ID],[name],[classid],[YD_out],[YD_in] from [link] Where [Active] =0 and del=0  order by [yd_time] desc"
rs.open Sql,conn,1,1
If Not rs.eof	Then
Dim PageSize,i
	PageSize=10							
	Dim Count,page,pagecount,gopage	
	gopage="index.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;"
	Count=rs.recordcount
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1    
	pagecount=(count+pagesize-1)\pagesize
        if page>pagecount then page=pagecount	
	rs.move(pagesize*(page-1))
zongshu=clng(count)+clng(Countt)


        response.write ("本站友链系统申请提交后系统自动审核通过!<br/>共:"&count&"个正常显示的站点<br/>"&getday&"天没有链入我站的站点系统自动隐藏.直到有链入则自动显示!<br/>"&Countt&"个站点已隐藏!<br/>友盟站点总数:"&zongshu&"<br/>")	
		
	For i=1 To PageSize       						
	If rs.eof Then Exit For				
Response.write "<a href=""view.asp?class="&rs("classid")&"&amp;id="&rs("id")&"&amp;saytk="&saytk&""">"&usb(rs("name"))&"</a>(出"&rs("YD_out")&"/入"&rs("YD_in")&")<br/>" 
	rs.moveNext 								
	Next	
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页"
if saytk=1 then
response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a>"
end if
Else
%>
	暂时没有友链！
<%end if%>
<%Call rsClose()


Response.write "<br/>-----------<br/>"
Response.write "<a href='top.asp?sid="&sid&"&amp;saytk="&saytk&"'>网站排行</a>-"& chr(13)
Response.write "<a href='Add.asp?sid="&sid&"&amp;saytk="&saytk&"'>申请友链</a><br/>"& chr(13)
Response.write "<a href='Active.asp?sid="&sid&"&amp;saytk="&saytk&"'>待审网站</a>-"& chr(13)
Response.write "<a href=""../index.asp?sid="&sid&"&amp;saytk="&saytk&""">返回首页</a>"& chr(13)
call head3()
call connClose()
%>
