<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!-- #include file="inc/DvADChar.asp" -->
<%
Head()
dim admin_flag,crs
	admin_flag=",13,"
	if not Dvbbs.master or instr(","&session("flag")&",",admin_flag)=0 then
		Errmsg=ErrMsg + "<BR><li>本页面为管理员专用，请<a href=admin_index.asp target=_top>登录</a>后进入。<br><li>您没有管理本页面的权限。"
		dvbbs_error()
	else
		dim body
		dim readme,Tlink
		call main()
		set rs=nothing
		Footer()
	end if

sub main()
	Response.Write "<table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""3""  align=center class=""tableBorder"">"
	Response.Write "<th width=""100%"" height=25>个人主页管理</th>"
	Response.Write "</tr>"
	response.write "<tr><td><center>"
	response.write "<a href=?action=reg>注册设置</a>　　　　　"
	response.write "<a href=?action=msm>基本设置</a>　　　　　"
	response.write "<a href=?action=user>用户管理</a>"
	response.write "</td>"
	response.write "</table><br>"
if request("action")="reg" then
   call reg()
elseif request("action")="msm" then
   call msm()
elseif request("action")="user" then
   call user()
elseif request("action")="user_edit" then
   call user_edit()
elseif request("action")="setup" then
   call setup()
else
   call reg()
end if
end sub

public sub reg()
	Response.Write "<table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""3""  align=center class=""tableBorder"">"
    response.write "<form method=POST name=form>"
	Response.Write "<th width=""100%"" colspan=2 height=25>注册设置</th>"
	Response.Write "</tr>"
	set rs = Server.CreateObject("ADODB.Recordset")
	sql="select index_reg_yn,bbs_title,bbs_money,bbs_jingyan,bbs_meilei,bbs_weiwang from [dhy_setup]"
	rs.open sql,conn,1,3
	if request.form("submit")<>"" then
	rs("index_reg_yn")=request.form("index_reg_yn")
	rs("bbs_title")=request.form("bbs_title")
	rs("bbs_money")=request.form("bbs_money")
	rs("bbs_jingyan")=request.form("bbs_jingyan")
	rs("bbs_meilei")=request.form("bbs_meilei")
	rs("bbs_weiwang")=request.form("bbs_weiwang")
	rs.update
	rs.close:set rs=nothing
    response.write "<script languge='javascript'>alert('操作已成功！');location.href('?action=reg');</script>"
    end if
	response.write "<tr>"
	response.write "<td width=40%  class=forumrow>是否开放注册</td>"
    response.write "<td class=forumrow>"
    %>
    <label><input type="radio" name="index_reg_yn" value="1" <%If (CStr("1") = CStr(rs("index_reg_yn"))) Then Response.Write("checked") : Response.Write("")%>>打开</label>
    <label><input type="radio" name="index_reg_yn" value="0" <%If (CStr("0") = CStr(rs("index_reg_yn"))) Then Response.Write("checked") : Response.Write("")%>>关闭</label>
    <%
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>能申请个人主页的用户在社区最少文章</td>"
    response.write "<td class=forumrow><input type=text name=bbs_title value='"&rs("bbs_title")&"' maxlength=10 szie=3></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>能申请个人主页的用户在社区最低金钱</td>"
    response.write "<td class=forumrow><input type=text name=bbs_money value='"&rs("bbs_money")&"' maxlength=10 szie=3></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>能申请个人主页的用户在社区最低经验</td>"
    response.write "<td class=forumrow><input type=text name=bbs_jingyan value='"&rs("bbs_jingyan")&"' maxlength=10 szie=3></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>能申请个人主页的用户在社区最低魅力</td>"
    response.write "<td class=forumrow><input type=text name=bbs_meilei value='"&rs("bbs_meilei")&"' maxlength=10 szie=3></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>能申请个人主页的用户在社区最低威望</td>"
    response.write "<td class=forumrow><input type=text name=bbs_weiwang value='"&rs("bbs_weiwang")&"' maxlength=10 szie=3></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrowHighLight colspan=2><center><input type=submit name=submit value='提交'></td>"
	response.write "</tr></form>"
	response.write "</table>"
	rs.close:set rs=nothing
end sub

public sub msm()
	Response.Write "<table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""3""  align=center class=""tableBorder"">"
    response.write "<form method=POST name=form>"
	Response.Write "<th width=""100%"" colspan=2 height=25>基本设置</th>"
	Response.Write "</tr>"
	set rs = Server.CreateObject("ADODB.Recordset")
	sql="select index_list_num,index_list_order,logic,company from [dhy_setup]"
	rs.open sql,conn,1,3
	if request.form("submit")<>"" then
	rs("index_list_num")=request.form("index_list_num")
	rs("index_list_order")=request.form("index_list_order")
	rs("logic")=request.form("logic")
	rs("company")=request.form("company")
	rs.update
	rs.close:set rs=nothing
    Application.Lock
    Application("logic")=""
    Application.unlock
    response.write "<script languge='javascript'>alert('操作已成功！');location.href('?action=msm');</script>"
    end if
	response.write "<tr>"
	response.write "<td class=forumrow>主页列表显示文章数量</td>"
    response.write "<td class=forumrow><input type=text name=index_list_num value='"&rs("index_list_num")&"' maxlength=3 szie=3></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>主页列表文章排序方法</td>"
    response.write "<td class=forumrow>"
    response.write "<select name=index_list_order>"
	%>
    <option value="0" <%if (cstr(rs("index_list_order"))=cstr(0)) then response.write("selected") end if%>>按注册顺序</option>
	<option value="1" <%if (cstr(rs("index_list_order"))=cstr(1)) then response.write("selected") end if%>>按人气值顺序</option>
	<option value="2" <%if (cstr(rs("index_list_order"))=cstr(2)) then response.write("selected") end if%>>按文章数量顺序</option>
	<%
    response.write "</select>"
    response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>本期推的个人首页</td>"
    response.write "<td class=forumrow>"
    response.write "<select name=logic>"
    %>
    <option value="0" <%if (cstr(rs("logic"))=cstr(0)) then response.write("selected") end if%>>本期无推荐</option>
    <%
    set crs=Dvbbs.Execute("select userid,site_name from [dhy_index] where yn=1 order by ID")
    do while not crs.eof
    %>
    <option value="<%=crs("userid")%>" <%if (cstr(rs("logic"))=cstr(crs("userid"))) then response.write("selected") end if%>><%=crs("site_name")%></option>
    <%
    crs.movenext()
    loop
    crs.close:set crs=nothing
    response.write "</select>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow>版权声明<br>支持HTML，请注意不要有非法字符</td>"
    response.write "<td class=forumrow><textarea name=company rows=6 cols=65>"&rs("company")&"</textarea>"
    response.write "<img src=images/manage/plus.gif onclick=document.form.company.rows+=4 alt=放大>"
    response.write "<img src=images/manage/minus.gif onclick='if(document.form.company.rows>=4)document.form.company.rows-=4;else return false' alt=缩小>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrowHighLight colspan=2><center><input type=submit name=submit value='提交'></td>"
	response.write "</tr></form>"
	response.write "</table>"
	rs.close:set rs=nothing
end sub

public sub user()
    dim index,nowpage,page,pages
	page=request("page")
	If Page="" Or Not IsNumerIc(Page) or page=0 Then Page=1
	Response.Write "<table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
	Response.Write "<th width=""100%"" colspan=7 height=25>个人主页用户管理</th>"
	Response.Write "</tr>"
	response.write "<tr><td class=forumrowHighLight colspan=7>"
    response.write "<form method=POST action=?action=user>"
    response.write "网站搜索：<select name=orders onchange='javascript:submit()'>"
    response.write "<option value=0 "
	if request("orders")=0 then response.write("selected")
	response.write ">最新注册的网站 Top20</option>"
    response.write "<option value=1 "
	if request("orders")=1 then response.write("selected")
	response.write ">所有网站</option>"
    response.write "<option value=2 "
	if request("orders")=2 then response.write("selected")
	response.write ">未开通网站</option>"
    response.write "<option value=3 "
	if request("orders")=3 then response.write("selected")
	response.write ">被用户删除网站</option>"
    response.write "<option value=4 "
	if request("orders")=4 then response.write("selected")
	response.write ">文章数量排行 Top20</option>"
    response.write "<option value=5 "
	if request("orders")=5 then response.write("selected")
	response.write ">人气网站排行 Top20 </option>"
    response.write "</select>"
    response.write "&nbsp;&nbsp;网站关键字搜索：<input type=text size=30 name=keyword> <input type=submit name=Submit value=搜索>　"
    response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrowHighLight><center>网站名称</td>"
	response.write "<td class=forumrowHighLight><center>管理员</td>"
	response.write "<td class=forumrowHighLight><center>文件数量</td>"
	response.write "<td class=forumrowHighLight><center>人气值</td>"
	response.write "<td class=forumrowHighLight><center>建站时间</td>"
	response.write "<td class=forumrowHighLight><center>状态</td>"
	response.write "<td class=forumrowHighLight><center>操作</td>"
	response.write "</tr>"
	set rs = Server.CreateObject("ADODB.Recordset")
    if request("keyword")<>"" then
       sql="select id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] where site_name like '%"&request("keyword")&"%' order by id desc"
	elseif request("orders")=0 then
       sql="select top 20 id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] order by id desc"
	elseif request("orders")=1 then
       sql="select id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] order by id desc"
	elseif request("orders")=2 then
       sql="select id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] where yn=0 order by id desc"
	elseif request("orders")=3 then
       sql="select id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] where yn=2 order by id desc"
	elseif request("orders")=4 then
       sql="select top 20 id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] where yn=1 order by file_num desc"
	elseif request("orders")=5 then
       sql="select top 20 id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] where yn=1 order by click_num desc"
	else
       sql="select top 20 id,site_name,user,userid,file_num,click_num,add_time,yn from [dhy_index] order by id desc"
	end if
	rs.open sql,conn,1,3
    if not rs.eof then
    index = 0
    rs.pagesize=20
    rs.movefirst
    nowpage=page
    rs.absolutepage=nowpage
    pages=rs.PageCount
	do while not rs.eof
	response.write "<tr>"
	response.write "<td class=forumrow>&nbsp;<a href=?action=user_edit&usID="&rs("id")&" title=对该网站进行编辑>"&rs("site_name")&"</a></td>"
	response.write "<td class=forumrow>&nbsp;<a href=admin_user.asp?action=modify&userid="&rs("userid")&" title=管理该用户社区信息>"&rs("user")&"</a></td>"
	response.write "<td class=forumrow><center>"&rs("file_num")&"</td>"
	response.write "<td class=forumrow><center>"&rs("click_num")&"</td>"
	response.write "<td class=forumrow><center>"&rs("add_time")&"</td>"
	if rs("yn")=0 then
	   response.write "<td class=forumrow><center><font color=#888888>未开放</font></td>"
	elseif rs("yn")=1 then
	   response.write "<td class=forumrow><center>正常</td>"
	elseif rs("yn")=2 then
	   response.write "<td class=forumrow><center><font color=red>删除</font></td>"
	end if
	response.write "<td class=forumrow><center><a href=?action=setup&usID="&rs("id")&">快捷操作</a></td>"
	response.write "</tr>"
	index=index+1
	if index=rs.pagesize then exit do
	rs.movenext()
	loop
	end if
	response.write "</table>"
Response.Write "<table cellpadding=4 cellspacing=0 align=center class=tableborder1 style=word-break:break-all>"
response.write "<tr>"
response.write "<td class=tablebody2 width=50% >"
response.write "页次：<b>"&nowpage&"</b> / <b>"&pages&"</b> 每页<b>"&rs.pagesize&"</b>条记录 共有<b>"&rs.recordcount&"</b>个主页"
response.write "</td><td class=tablebody2 align=right>"
if pages="" then pages=1
if nowpage="" then nowpage=1
response.write "分页："
   dim xpage,xten,tos
   if nowpage mod 10=0 then
      xpage=nowpage-1
   else
      xpage=nowpage
   end if
   xten=int(xpage/10)*10
   if nowpage=1 then
      response.write "<font face=dhydings color=red>9</font>"
   else
      if request("keyword")<>"" then
         response.write "<a href=?action=user&keyword="&request("keyword")&"&page=1 title=首页><font face=dhydings>9</font></a>"
      elseif request("orders")<>"" then
         response.write "<a href=?action=user&orders="&request("orders")&"&page=1 title=首页><font face=dhydings>9</font></a>"
	  else
         response.write "<a href=?action=user&page=1 title=首页><font face=dhydings>9</font></a>"
	  end if
   end if
   if nowpage>10 then
      if request("keyword")<>"" then
         response.write "<a href=?action=user&keyword="&request("keyword")&"&page="&xten&" title=前十页><font face=dhydings>7</font></a>"
      elseif request("orders")<>"" then
         response.write "<a href=?action=user&orders="&request("orders")&"&page="&xten&" title=前十页><font face=dhydings>7</font></a>"
	  else
         response.write "<a href=?action=user&page="&xten&" title=前十页><font face=dhydings>7</font></a>"
	  end if
   end if
   if pages-xten>11 then
      tos=xten+10
   else
      tos=pages
   end if
   for i=xten+1 to tos
       if i=nowpage then
          response.write " <font color=red><b>"&i&"</b></a> "
	   else
          if request("keyword")<>"" then
	         response.write " <a href=?action=user&keyword="&request("keyword")&"&page="&i&"><b>"&i&"</b></a> "
          elseif request("orders")<>"" then
             response.write " <a href=?action=user&orders="&request("orders")&"&page="&i&"><b>"&i&"</b></a> "
	      else
	         response.write " <a href=?action=user&page="&i&"><b>"&i&"</b></a> "
	      end if
	   end if
   next
   if pages-xten>10 then
      if request("keyword")<>"" then
         response.write "<a href=?action=user&keyword="&request("keyword")&"&page="&xten+11&" title=后十页><font face=dhydings>8</font></a>"
      elseif request("orders")<>"" then
         response.write "<a href=?action=user&orders="&request("orders")&"&page="&xten+11&" title=后十页><font face=dhydings>8</font></a>"
	  else
         response.write "<a href=?action=user&page="&xten+11&" title=后十页><font face=dhydings>8</font></a>"
	  end if
   end if
   if pages=nowpage or pages=1 then
      response.write "<font face=dhydings color=red>:</font>"
   else
      if request("keyword")<>"" then
         response.write "<a href=?action=user&keyword="&request("keyword")&"&page="&pages&" title=尾页><font face=dhydings>:</font></a>"
      elseif request("orders")<>"" then
         response.write "<a href=?action=user&orders="&request("orders")&"&page="&pages&" title=尾页><font face=dhydings>:</font></a>"
	  else
         response.write "<a href=?action=user&page="&pages&" title=尾页><font face=dhydings>:</font></a>"
	  end if
   end if
response.write "</td></tr></table>"
rs.close:set rs=nothing
end sub

public sub user_edit()
    dim usID
    usID=request("usID")
	set rs = Server.CreateObject("ADODB.Recordset")
	sql="select * from [dhy_index] where id="&usID
	rs.open sql,conn,1,3
	if request.form("submit")="提交" then
	rs("site_name")=request.form("site_name")
    rs("yn")=request.form("yn")
	rs("index_sm")=request.form("index_sm")
	rs("index_gg")=request.form("index_gg")
	rs("new_list_yn")=request.form("new_list_yn")
	rs("new_list_num")=request.form("new_list_num")
	rs("click_list_yn")=request.form("click_list_yn")
	rs("click_list_num")=request.form("click_list_num")
	rs("file_list_num")=request.form("file_list_num")
	rs("file_no_num")=request.form("file_no_num")
	rs("file_num")=request.form("file_num")
	rs("click_num")=request.form("click_num")
	rs("add_time")=request.form("add_time")
	rs("zs_name")=request.form("zs_name")
	rs("E_mail")=request.form("E_mail")
	rs("company")=request.form("company")
	rs("width")=request.form("width")
	rs("height")=request.form("height")
	rs("zs_tel")=request.form("zs_tel")
	rs("zs_code")=request.form("zs_code")
	rs("zs_add")=request.form("zs_add")
	rs("user_sm")=request.form("user_sm")
	rs.update
	rs.close:set rs=nothing
    Application.Lock
    Application("logic")=""
    Application("writes")=""
	Application("gg")=""
    Application.unlock
    response.write "<script languge='javascript'>alert('操作已成功！');location.href('?action=user_edit&usID="&usID&"');</script>"
	elseif request.form("submit")="删除" then
	Dvbbs.Execute("delete from [dhy_class] where userid="&rs("userid"))
	Dvbbs.Execute("delete from [dhy_link] where userid="&rs("userid"))
	Dvbbs.Execute("update [Dv_Topic] set index_yn=0,index_class=0 where PostUserID="&rs("userid")&" and index_yn=1 and index_class<>0")
	Dvbbs.Execute("delete from [dhy_index] where id="&usID)
    Application.Lock
    Application("logic")=""
    Application("writes")=""
	Application("gg")=""
    Application.unlock
    response.write "<script languge='javascript'>alert('操作已成功！');location.href('?action=user');</script>"
    end if
	Response.Write "<table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""3""  align=center class=""tableBorder"">"
    response.write "<form method=POST name=form>"
	response.write "<tr>"
	Response.Write "<th width=""100%"" colspan=2 height=25>"&rs("site_name")&"-主页基本设置</th>"
	Response.Write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页名称</td>"
    response.write "<td class=forumrow><input type=text name=site_name value='"&rs("site_name")&"' maxlength=15 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >管理员</td>"
    response.write "<td class=forumrow><a href=admin_user.asp?action=modify&userid="&rs("userid")&" title=管理该用户社区信息>"&rs("user")&"</a></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >当前状态</td>"
    response.write "<td class=forumrow>"
    %>
    <label><input type="radio" name="yn" value="1" <%If (CStr("1") = CStr(rs("yn"))) Then Response.Write("checked") : Response.Write("")%>>打开</label>
    <label><input type="radio" name="yn" value="0" <%If (CStr("0") = CStr(rs("yn"))) Then Response.Write("checked") : Response.Write("")%>>关闭</label>
    <label><input type="radio" name="yn" value="2" <%If (CStr("2") = CStr(rs("yn"))) Then Response.Write("checked") : Response.Write("")%>><font color="red">已被用户删除</font></label>
    <%
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页简介</td>"
    response.write "<td class=forumrow><textarea name=index_sm rows=6 cols=65>"&rs("index_sm")&"</textarea>"
    response.write "<img src=images/manage/plus.gif onclick=document.form.index_sm.rows+=4 alt=放大>"
    response.write "<img src=images/manage/minus.gif onclick='if(document.form.index_sm.rows>=4)document.form.index_sm.rows-=4;else return false' alt=缩小>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页公告</td>"
    response.write "<td class=forumrow><textarea name=index_gg rows=6 cols=65>"&rs("index_gg")&"</textarea>"
    response.write "<img src=images/manage/plus.gif onclick=document.form.index_gg.rows+=4 alt=放大>"
    response.write "<img src=images/manage/minus.gif onclick='if(document.form.index_gg.rows>=4)document.form.index_gg.rows-=4;else return false' alt=缩小>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >版权信息</td>"
    response.write "<td class=forumrow><input type=text name=company value='"&rs("company")&"&nbsp;' maxlength=250 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页最新文章调用</td>"
    response.write "<td class=forumrow>"
    %>
    <label><input type="radio" name="new_list_yn" value="1" <%If (CStr("1") = CStr(rs("new_list_yn"))) Then Response.Write("checked") : Response.Write("")%>>打开</label>
    <label><input type="radio" name="new_list_yn" value="0" <%If (CStr("0") = CStr(rs("new_list_yn"))) Then Response.Write("checked") : Response.Write("")%>>关闭</label>
    <%
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页最新文章调用数量</td>"
    response.write "<td class=forumrow><input type=text name=new_list_num value='"&rs("new_list_num")&"' maxlength=2 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页人气文章调用</td>"
    response.write "<td class=forumrow>"
    %>
    <label><input type="radio" name="click_list_yn" value="1" <%If (CStr("1") = CStr(rs("click_list_yn"))) Then Response.Write("checked") : Response.Write("")%>>打开</label>
    <label><input type="radio" name="click_list_yn" value="0" <%If (CStr("0") = CStr(rs("click_list_yn"))) Then Response.Write("checked") : Response.Write("")%>>关闭</label>
    <%
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页人气文章调用数量</td>"
    response.write "<td class=forumrow><input type=text name=click_list_num value='"&rs("click_list_num")&"' maxlength=2 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页文章分类列表调用数量</td>"
    response.write "<td class=forumrow><input type=text name=file_list_num value='"&rs("file_list_num")&"' maxlength=2 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >文章分类列表数量</td>"
    response.write "<td class=forumrow><input type=text name=file_no_num value='"&rs("file_no_num")&"' maxlength=2 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页文章数量</td>"
    response.write "<td class=forumrow><input type=text name=file_num value='"&rs("file_num")&"' maxlength=10 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页总访问量</td>"
    response.write "<td class=forumrow><input type=text name=click_num value='"&rs("click_num")&"' maxlength=10 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >建站时间</td>"
    response.write "<td class=forumrow><input type=text name=add_time value='"&rs("add_time")&"' maxlength=20 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	Response.Write "<th width=""100%"" colspan=2 height=25>"&rs("site_name")&"-用户信息设置</th>"
	Response.Write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >真实姓名</td>"
    response.write "<td class=forumrow><input type=text name=zs_name value='"&rs("zs_name")&"' maxlength=15 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >电子信箱</td>"
    response.write "<td class=forumrow><input type=text name=E_mail value='"&rs("E_mail")&"' maxlength=100 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >联系电话</td>"
    response.write "<td class=forumrow><input type=text name=zs_tel value='"&rs("zs_tel")&"' maxlength=30 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >邮政编码</td>"
    response.write "<td class=forumrow><input type=text name=zs_code value='"&rs("zs_code")&"' maxlength=6 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >邮政地址</td>"
    response.write "<td class=forumrow><input type=text name=zs_add value='"&rs("zs_add")&"' maxlength=200 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >用户照片</td>"
    response.write "<td class=forumrow><input type=text name=userphoto value='"&rs("userphoto")&"' maxlength=200 size=40>"
	response.write " 宽 <input type=text name=width value='"&rs("width")&"' maxlength=3 size=2>"
	response.write " 高 <input type=text name=height value='"&rs("height")&"' maxlength=3 size=2>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >用户简介</td>"
    response.write "<td class=forumrow><textarea name=user_sm rows=6 cols=65>"&rs("user_sm")&"</textarea>"
    response.write "<img src=images/manage/plus.gif onclick=document.form.user_sm.rows+=4 alt=放大>"
    response.write "<img src=images/manage/minus.gif onclick='if(document.form.user_sm.rows>=4)document.form.user_sm.rows-=4;else return false' alt=缩小>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrowHighLight colspan=2><center>"
	response.write "<input type=submit name=submit value=提交>　　"
	response.write "<input type=submit name=submit value=删除 onclick=return(confirm('你确定要删除该网站吗？删除后将不能再回恢该操作!!!'))>　　"
    response.write "<input type=button value=返回 onclick='javascript:history.go(-1);'>"
	response.write "</td>"
	response.write "</tr></form>"
	response.write "</table>"
	rs.close:set rs=nothing
end sub

public sub setup()
    dim usID,tmid,drs,ctmid
    usID=request("usID")
	set rs = Server.CreateObject("ADODB.Recordset")
	sql="select * from [dhy_index] where id="&usID
	rs.open sql,conn,1,3
	if request.form("submit")="提交" then
	rs("site_name")=request.form("site_name")
    rs("yn")=request.form("yn")
	rs("index_sm")=request.form("index_sm")
	rs("zs_name")=request.form("zs_name")
	rs("E_mail")=request.form("E_mail")
	rs("company")=request.form("company")
	rs("width")=request.form("width")
	rs("height")=request.form("height")
	rs("zs_tel")=request.form("zs_tel")
	rs("zs_code")=request.form("zs_code")
	rs("zs_add")=request.form("zs_add")
	rs("user_sm")=request.form("user_sm")
	rs.update
	rs.close:set rs=nothing
    response.write "<script languge='javascript'>alert('操作已成功！');location.href('?action=setup&usID="&usID&"');</script>"
	elseif request.form("submit")="删除" then
	set crs=Dvbbs.Execute("select FileID from [dhy_file]")
    do while not crs.eof
    if tmid="" then
       tmid=crs("fileID")
    else
       tmid=tmid&","&crs("fileID")
    end if
    crs.movenext()
    loop
    crs.close:set crs=nothing
	if tmid="" then tmid=0
	set drs=Dvbbs.Execute("select TopicID from [Dv_Topic] where PostUserID="&rs("userid")&" and TopicID in ("&tmid&")")
    do while not drs.eof
	if ctmid="" then
	   ctmid=drs("TopicID")
	else
	   ctmid=ctmid&","&drs("TopicID")
	end if
	drs.movenext()
	loop
	drs.close:set drs=nothing
	if ctmid="" then ctmid=0
	Dvbbs.Execute("delete from [dhy_file] where FileID in ("&ctmid&")")
	Dvbbs.Execute("delete from [dhy_class] where userid="&rs("userid"))
	Dvbbs.Execute("delete from [dhy_link] where userid="&rs("userid"))
	Dvbbs.Execute("delete from [dhy_index] where id="&usID)
    response.write "<script languge='javascript'>alert('操作已成功！');location.href('?action=user');</script>"
    end if
	Response.Write "<table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""3""  align=center class=""tableBorder"">"
    response.write "<form method=POST name=form>"
	response.write "<tr>"
	Response.Write "<th width=""100%"" colspan=2 height=25>"&rs("site_name")&"-主页基本设置</th>"
	Response.Write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页名称</td>"
    response.write "<td class=forumrow><input type=text name=site_name value='"&rs("site_name")&"' maxlength=15 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >管理员</td>"
    response.write "<td class=forumrow><a href=admin_user.asp?action=modify&userid="&rs("userid")&" title=管理该用户社区信息>"&rs("user")&"</a></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >当前状态</td>"
    response.write "<td class=forumrow>"
    %>
    <label><input type="radio" name="yn" value="1" <%If (CStr("1") = CStr(rs("yn"))) Then Response.Write("checked") : Response.Write("")%>>打开</label>
    <label><input type="radio" name="yn" value="0" <%If (CStr("0") = CStr(rs("yn"))) Then Response.Write("checked") : Response.Write("")%>>关闭</label>
    <label><input type="radio" name="yn" value="2" <%If (CStr("2") = CStr(rs("yn"))) Then Response.Write("checked") : Response.Write("")%>><font color="red">已被用户删除</font></label>
    <%
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >主页简介</td>"
    response.write "<td class=forumrow><textarea name=index_sm rows=6 cols=65>"&rs("index_sm")&"</textarea>"
    response.write "<img src=images/manage/plus.gif onclick=document.form.index_sm.rows+=4 alt=放大>"
    response.write "<img src=images/manage/minus.gif onclick='if(document.form.index_sm.rows>=4)document.form.index_sm.rows-=4;else return false' alt=缩小>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	Response.Write "<th width=""100%"" colspan=2 height=25>"&rs("site_name")&"-用户信息设置</th>"
	Response.Write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >真实姓名</td>"
    response.write "<td class=forumrow><input type=text name=zs_name value='"&rs("zs_name")&"' maxlength=15 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >电子信箱</td>"
    response.write "<td class=forumrow><input type=text name=E_mail value='"&rs("E_mail")&"' maxlength=100 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >联系电话</td>"
    response.write "<td class=forumrow><input type=text name=zs_tel value='"&rs("zs_tel")&"' maxlength=30 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >邮政编码</td>"
    response.write "<td class=forumrow><input type=text name=zs_code value='"&rs("zs_code")&"' maxlength=6 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >邮政地址</td>"
    response.write "<td class=forumrow><input type=text name=zs_add value='"&rs("zs_add")&"' maxlength=200 size=40></td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >用户照片</td>"
    response.write "<td class=forumrow><input type=text name=userphoto value='"&rs("userphoto")&"' maxlength=200 size=40>"
	response.write " 宽 <input type=text name=width value='"&rs("width")&"' maxlength=3 size=2>"
	response.write " 高 <input type=text name=height value='"&rs("height")&"' maxlength=3 size=2>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrow widht=40% >用户简介</td>"
    response.write "<td class=forumrow><textarea name=user_sm rows=6 cols=65>"&rs("user_sm")&"</textarea>"
    response.write "<img src=images/manage/plus.gif onclick=document.form.user_sm.rows+=4 alt=放大>"
    response.write "<img src=images/manage/minus.gif onclick='if(document.form.user_sm.rows>=4)document.form.user_sm.rows-=4;else return false' alt=缩小>"
	response.write "</td>"
	response.write "</tr>"
	response.write "<tr>"
	response.write "<td class=forumrowHighLight colspan=2><center>"
	response.write "<input type=submit name=submit value=提交>　　"
	response.write "<input type=submit name=submit value=删除 onclick=return(confirm('你确定要删除该网站吗？删除后将不能再回恢该操作!!!'))>　　"
    response.write "<input type=button value=返回 onclick='javascript:history.go(-1);'>"
	response.write "</td>"
	response.write "</tr></form>"
	response.write "</table>"
	rs.close:set rs=nothing
end sub
%>