<!--#include file="Head.asp"-->

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



<% dim rs,sql,p
p=request.Querystring("p")
if p="" then p=1
set rs=server.CreateObject("adodb.recordset")
				sql="select * from admin"
				rs.open sql,conn,1,1 %>
<%if p=1 then
call saycardd("友链设置")
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""admin_config.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;p=2"">"%>
                        首页动态设置:<br/>
			<select name="links" value="<%=rs("links")%>">
			<option value="1">显示友链</option>
			<option value="2">关闭显示</option>
			</select><br/>   
友链显示个数:<br/>
<input name="linknum" type="text" value="<%=rs("linknum")%>"  size="2"/><br/>
友链首页排版:<br/>   
<select name="linktop" value="<%=rs("linkindex")%>">
<option value="0">横排经典</option>
<option value="1">简单分类</option>
</select><br/>  
审核设置:<br/>   
<select name="Active" value="<%=rs("Active")%>">
<option value="1">必须审核</option>
<option value="0">不用审核</option>
</select><br/>    
无链入自动隐藏天数:<br/>
<input name="linkact" type="text" value="<%=rs("linkactive")%>"  size="2"/><br/>
<input type="submit" name="Submit" value="保存修改"></form><br/>
<%else%>
                        首页动态设置:<br/>
			<select name="links<%=minute(now)%><%=second(now)%>" value="<%=rs("links")%>">
			<option value="1">显示友链</option>
			<option value="2">关闭显示</option>
			</select><br/>   
友链显示个数:<br/>
<input name="linknum<%=minute(now)%><%=second(now)%>" type="text" value="<%=rs("linknum")%>"  size="2"/><br/>
友链首页排版:<br/>   
<select name="linktop<%=minute(now)%><%=second(now)%>" value="<%=rs("linkindex")%>">
<option value="0">横排经典</option>
<option value="1">简单分类</option>
</select><br/>  
审核设置:<br/>   
<select name="Active<%=minute(now)%><%=second(now)%>" value="<%=rs("Active")%>">
<option value="1">必须审核</option>
<option value="0">不用审核</option>
</select><br/>    
无链入自动隐藏天数:<br/>
<input name="linkact<%=minute(now)%><%=second(now)%>" type="text" value="<%=rs("linkactive")%>"  size="2"/><br/>
                   
<anchor>保存修改<go href="admin_config.asp?sid=<%=sid%>&amp;p=2&amp;saytk=<%=saytk%>" method="post">
<postfield name="links" value="$(links<%=minute(now)%><%=second(now)%>)" />
<postfield name="linktop" value="$(linktop<%=minute(now)%><%=second(now)%>)" />
<postfield name="linknum" value="$(linknum<%=minute(now)%><%=second(now)%>)" />
<postfield name="linkact" value="$(linkact<%=minute(now)%><%=second(now)%>)"/>

<postfield name="Active" value="$(Active<%=minute(now)%><%=second(now)%>)" />
</go></anchor><br/><%end if%>

<a href='Admin_index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;saytk=<%=saytk%>'>[友链后台]</a><br/>
<a href="../index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;saytk=<%=saytk%>">[后台管理]</a>
<%elseif p=2 then
call saycardd("友链设置结果")
dim links,linktop,linknum,Active,linkact
links=Request.Form("links")
linktop=Request.Form("linktop")
linknum=Request.Form("linknum")
linkact=Request.Form("linkact")
Active=Request.Form("Active")   
if linknum="" or IsNumeric(linknum) = False then
  Call Error("显示个数错误！")
  end if
if linkact="" or IsNumeric(linkact) = False then
  Call Error("隐藏天数错误！")
  end if

set rs=server.CreateObject("adodb.recordset")
sql="select * from admin"
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) then
rs("linknum")=linknum
rs("linkindex")=linktop
rs("linkactive")=linkact
rs("links")=links
rs("Active")=Active                                       
	rs.update()
Response.Write "成功设置！<br/>"
end if				
%>
<a href='Admin_index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>'>[友链后台]</a><br/>
<a href="../index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[后台管理]</a>
<%END IF%><%call ALLClose()%>
<%
call headsay()
%>
