admin_config.asp

来自「CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。」· ASP 代码 · 共 211 行

ASP
211
字号
<!--#include file="config.asp" -->
<!--#include file="admin_admininfo.asp"-->
<!--#include file="sub_change.asp" -->
<%
if session("adminname")<>adminname or session("adminpwd")<>adminpwd then
  response.Redirect("admin_login.asp")
end if

dim ok,error,v
ok=strchange(left(trim(request.QueryString("ok")),1))
v="  Powered By CityCN V2.1"

dim sitename1,sitesname1,siteurl1,sitelogo1,sitekeywords1,sitedescription1,copyright1,sitealign1,adminqq1,citynamemax1,siteread1,sitepass1,siteplpass1,siteguolv1
if ok="y" then
  sitename1=trim(request.Form("sitename"))
  sitesname1=trim(request.Form("sitesname"))
  siteurl1=trim(request.Form("siteurl"))
  sitelogo1=trim(request.Form("sitelogo"))
  sitekeywords1=trim(request.Form("sitekeywords"))
  sitedescription1=trim(request.Form("sitedescription"))
  copyright1=trim(request.Form("copyright"))
  sitealign1=trim(request.Form("sitealign"))
  adminqq1=trim(request.Form("adminqq"))
  citynamemax1=trim(request.Form("citynamemax"))
  siteread1=trim(request.Form("siteread"))
  sitepass1=trim(request.Form("sitepass"))
  siteplpass1=trim(request.Form("siteplpass"))
  siteguolv1=trim(request.Form("siteguolv"))
  
  if len(sitename1)=0 then error="站点名称不能为空!<br>" end if
  if len(sitesname1)=0 then error=error&"站点简称不能为空!<br>" end if
  if len(siteurl1)=0 then error=error&"站点网址不能为空!<br>" end if
  if len(sitelogo1)=0 then error=error&"站点LOGO不能为空!<br>" end if
  if len(sitekeywords1)=0 then error=error&"站点关键字不能为空!<br>" end if
  if len(sitedescription1)=0 then error=error&"站点描述不能为空!<br>" end if
  if len(copyright1)=0 then error=error&"版权信息不能为空!<br>" end if
  if len(sitealign1)=0 then error=error&"网页显示方式不能为空!<br>" end if
  if len(adminqq1)=0 then error=error&"站长QQ不能为空!<br>" end if
  if len(citynamemax1)=0 then error=error&"城市名限制不能为空!<br>" end if
  if len(siteread1)=0 then error=error&"站点只读不能为空!<br>" end if
  if len(sitepass1)=0 then error=error&"发布审核不能为空!<br>" end if
  if len(siteplpass1)=0 then error=error&"评论审核不能为空!<br>" end if
  
  if len(error)=0 then
    dim msg
    msg="<%"&chr(13)&chr(10)
    msg=msg&"const sitename="""&sitename1&v&""""&chr(13)&chr(10)
    msg=msg&"const sitesname="""&sitesname1&""""&chr(13)&chr(10)
    msg=msg&"const siteurl="""&siteurl1&""""&chr(13)&chr(10)
    msg=msg&"const sitelogo="""&sitelogo1&""""&chr(13)&chr(10)
    msg=msg&"const sitekeywords="""&sitekeywords1&""""&chr(13)&chr(10)
    msg=msg&"const sitedescription="""&sitedescription1&""""&chr(13)&chr(10)
    msg=msg&"const copyright="""&copyright1&""""&chr(13)&chr(10)
    msg=msg&"const sitealign="""&sitealign1&""""&chr(13)&chr(10)
    msg=msg&"const adminqq="""&adminqq1&""""&chr(13)&chr(10)
    msg=msg&"const citynamemax="""&citynamemax1&""""&chr(13)&chr(10)
    msg=msg&"const siteread="""&siteread1&""""&chr(13)&chr(10)
    msg=msg&"const sitepass="&sitepass1&chr(13)&chr(10)
    msg=msg&"const siteplpass="&siteplpass1&chr(13)&chr(10)
    msg=msg&"const siteguolv="""&siteguolv1&""""&chr(13)&chr(10)
    msg=msg&chr(37)&">"
    
    dim files,fs
    On Error Resume Next
    set fs=Server.CreateObject("Adodb.Stream")
    If Err.Number=-2147221005 Then 
      Response.Write "非常遗憾,您的主机不支持ADODB.Stream,不能使用本程序"
      Err.Clear
      Response.End
    End If

    fs.Mode=3
    fs.Type=2
    fs.charset="gb2312"
    fs.Open
    fs.writetext msg
    fs.SaveToFile Server.MapPath("config.asp"),2
    fs.Close
    set fs=nothing   

    ok="yes"
  else
    error="注意:信息填写错误!请重新填写!<br>"&error
  end if
end if

if ok="" then
  sitename1=left(sitename,len(sitename)-len(v))
  sitesname1=sitesname
  siteurl1=siteurl
  sitelogo1=sitelogo
  sitekeywords1=sitekeywords
  sitedescription1=sitedescription
  copyright1=copyright
  sitealign1=sitealign
  adminqq1=adminqq
  citynamemax1=citynamemax
  siteread1=siteread
  sitepass1=sitepass
  siteplpass1=siteplpass
  siteguolv1=siteguolv
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>【后台管理】基本信息设置 - <%=sitename%></title>
<link href="admin.css" rel="stylesheet" type="text/css">
</head>

<body topmargin="0" leftmargin="0">
<div align="center">
<!--#include file="admin_top_config.asp" -->
<br>
<% If ok="yes" Then %>
<p align="center"><font color="#FF0000">信息已成功保存!</font></p>
<% Else %>
<table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
  <tr>
    <td height="40" align="center" style="line-height: 16pt"><b>系统基本设置</b></td>
  </tr>
</table>
<table width="90%" border="0" cellpadding="5" cellspacing="0">
  <tr> 
    <td height="40" colspan="2" style="color: #FF0000; padding-left: 10px"><%=error%></td>
  </tr>
  <form action="admin_config.asp?ok=y" method="post">
    <tr>
      <td width="15%" height="22" align="right">站点名称:</td>
      <td width="85%">
		<input name="sitename" type="text" value="<%=sitename1%>" size="50">尽量不要有特殊字符,例:城市中国CityCn.net</td>
    </tr>
    <tr> 
      <td height="22" align="right">站点简称:</td>
      <td>
		<input name="sitesname" type="text"  value="<%=sitesname1%>" size="20">最好不要超过5个汉字,例:城市中国</td>
    </tr>
    <tr> 
      <td height="22" align="right">站点网址:</td>
      <td>
		<input name="siteurl" type="text" value="<%=siteurl1%>" size="40">包含http://,例:http://www.citycn.net</td>
    </tr>
    <tr> 
      <td height="22" align="right">站点LOGO:</td>
      <td><input name="sitelogo" value="<%=sitelogo1%>" size="50">包含http://,例:http://www.citycn.net/logo.gif</td>
    </tr>
    <tr> 
      <td height="22" align="right">站点关键字:</td>
      <td><input name="sitekeywords" value="<%=sitekeywords1%>" size="50">你的站点所包含的关键字,英文,分割关键字</td>
    </tr>
    <tr> 
      <td height="22" align="right">站点描述:</td>
      <td><input name="sitedescription" value="<%=sitedescription1%>" size="50">站点描述,简短的一句话</td>
    </tr>
    <tr> 
      <td height="22" align="right">版权信息:</td>
      <td><input name="copyright" value="<%=copyright1%>" size="50">版权信息,出现在页面下方</td>
    </tr>
    <tr> 
      <td height="22" align="right">网页显示方式:</td>
      <td>
		<select name="sitealign">
		<option value="left" <%if cstr(sitealign1)="left" then response.write "selected class='red'" end if%>>网页左侧对齐</option>
		<option value="center" <%if cstr(sitealign1)="center" then response.write "selected class='red'" end if%>>网页居中对齐</option>
		<option value="right" <%if cstr(sitealign1)="right" then response.write "selected class='red'" end if%>>网页右侧对齐</option>
		</select>网页的整体对齐方式,建议居中对齐</td>
    </tr>
    <tr> 
      <td height="22" align="right">站长QQ:</td>
      <td><input name="adminqq" value="<%=adminqq1%>" size="20">站长<span lang="zh-cn">联系QQ号,例:123456</span></td>
    </tr>
    <tr> 
      <td height="22" align="right">城市名限制:</td>
      <td><input name="citynamemax" value="<%=citynamemax1%>" size="20">对于新城市的长度限制,建议填4</td>
    </tr>
    <tr> 
      <td height="22" align="right">站点只读:</td>
      <td><select size="1" name="siteread">
		<option value="no" <%if cstr(siteread1)="no" then response.write "selected class='red'" end if%>>站点开放</option>
		<option value="yes" <%if cstr(siteread1)="yes" then response.write "selected class='red'" end if%>>站点只读</option>
		</select>站点是否暂时不允许发帖</td>
    </tr>
    <tr> 
      <td height="22" align="right">发布审核:</td>
      <td><select size="1" name="sitepass">
		<option value="1" <%if sitepass1=1 then response.write "selected class='red'" end if%>>无需审核</option>
		<option value="0" <%if sitepass1=0 then response.write "selected class='red'" end if%>>需要审核</option>
		</select><span lang="zh-cn">发布信息是否需要审核</span></td>
    </tr>
    <tr> 
      <td height="22" align="right">评论审核:</td>
      <td><select size="1" name="siteplpass">
		<option value="1" <%if siteplpass1=1 then response.write "selected class='red'" end if%>>无需审核</option>
		<option value="0" <%if siteplpass1=0 then response.write "selected class='red'" end if%>>需要审核</option>
		</select>发布评论是否需要审核</td>
    </tr>
    <tr> 
      <td height="22" align="right">过滤字符:</td>
      <td><textarea rows="5" name="siteguolv" cols="72"><%=siteguolv1%></textarea><br>
		需要过滤的字符,用|分隔,如:法轮功|色情|暴力</td>
    </tr>
    <tr> 
      <td width="700" height="22" align="center" colspan="2">
		<input type="submit" name="Submit" value="  保 存 信 息  ">&nbsp;&nbsp;<input type="reset" value="重置" name="B1"></td>
    </tr>
  </form>
</table>
<% End If %>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?