📄 admin.asp
字号:
<% option explicit %>
<%response.buffer=true%>
<!--#include file="common.asp"-->
<!--#include file="session.asp"-->
<%
select case request.querystring("act")
case "main"
call main()
case "update"
call update()
case "batch"
call batch()
case "check"
call check()
case "del"
call del()
case "logout"
call logout()
case else
call main()
end select
sub main() '-----------------留言本设置页面
if not session("userkey")=4 then
errinfo="<li>您未登陆或已经退出登陆,不能进入该页。"
call error()
else
pagename="设置留言本"
call pageinfo()
mainpic="page_admin.gif"
call skin1()
'---------------以下显示页面主体--------
%>
<br>
<form method="post" action="?act=update">
<div align="center">
<center>
<table border="0" cellpadding="3" cellspacing="1" width="95%" class="table1">
<tr>
<td width="28%" class="tablebody3" align="right">网站名称:</td>
<td width="72%" class="tablebody2">
<input type="text" name="site" size="29" value="<%=site%>">
留言本所属的站点的名称(如:搜狐网)。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">网站地址:</td>
<td width="72%" class="tablebody2">
<input type="text" name="URL" size="29" value="<%=URL%>">
请注意:必须是完整的地址(如:http://www.howlion.com/)。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">管理员名称:</td>
<td width="72%" class="tablebody2">
<input type="text" name="name" size="29" value="<%=name%>">
换上你自己的称呼。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">管理员密码:</td>
<td width="72%" class="tablebody2">
<input type="password" name="password" size="29" value="<%=password%>">
这个管理员密码已经作废,不用去管他。[胖胖 2005-04-17]</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">重复密码:</td>
<td width="72%" class="tablebody2">
<input type="password" name="password2" size="29" value="<%=password%>"></td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">管理员email:</td>
<td width="72%" class="tablebody2">
<input type="text" name="adminmail" size="29" value="<%=adminmail%>">
换上你自己的email。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">每页显示留言数:</td>
<td width="72%" class="tablebody2">
<input type="text" name="perpage" size="10" value="<%=perpage%>"></td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">最大留言字数:</td>
<td width="72%" class="tablebody2">
<input type="text" name="maxnum" size="10" value="<%=maxnum%>"></td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">留言提示:</td>
<td width="72%" class="tablebody2">
<textarea rows="5" name="notice" cols="55"><%=notice%></textarea><br>
可以是欢迎词、警告、站点说明等,将出现在提交留言页面的顶部,支持UBB代码。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">不受欢迎的IP:</td>
<td width="72%" class="tablebody2">
<textarea rows="5" name="badip" cols="34"><%=badip%></textarea><br>
不受欢迎的IP地址将无法进入留言本。<b>每个IP地址必须占一行</b>。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">广告过滤:</td>
<td width="72%" class="tablebody2">
<textarea rows="5" name="adword" cols="34"><%=adword%></textarea><br>
包含上述某一词语的留言将无法提交,如果以上某个词语和您的站点的主题有关,请将其从文本框中删去。<br><b>每个词语必须占一行</b>。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">访问次数:</td>
<td width="72%" class="tablebody2">
<input type="text" name="stat" size="10" value="<%=stat%>"> 修改留言本自带的计数器的数值。</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">自定义UBB支持:</td>
<td width="72%" class="tablebody2">
<input type="checkbox" name="UBBcfg" value="font"<%if UBBcfg_font=1 then%> checked<%end if%>>字体 <input type="checkbox" name="UBBcfg" value="size"<%if UBBcfg_size=1 then%> checked<%end if%>>字号 <input type="checkbox" name="UBBcfg" value="color"<%if UBBcfg_color=1 then%> checked<%end if%>>文字颜色 <input type="checkbox" name="UBBcfg" value="bold"<%if UBBcfg_b=1 then%> checked<%end if%>>粗体 <input type="checkbox" name="UBBcfg" value="italic"<%if UBBcfg_i=1 then%> checked<%end if%>>斜体 <input type="checkbox" name="UBBcfg" value="underline"<%if UBBcfg_u=1 then%> checked<%end if%>>下划线<br><input type="checkbox" name="UBBcfg" value="center"<%if UBBcfg_center=1 then%> checked<%end if%>>居中 <input type="checkbox" name="UBBcfg" value="URL"<%if UBBcfg_URL=1 then%> checked<%end if%>>超链接 <input type="checkbox" name="UBBcfg" value="email"<%if UBBcfg_email=1 then%> checked<%end if%>>email链接 <input type="checkbox" name="UBBcfg" value="shadow"<%if UBBcfg_shadow=1 then%> checked<%end if%>>阴影字 <input type="checkbox" name="UBBcfg" value="glow"<%if UBBcfg_glow=1 then%> checked<%end if%>>发光字<br><input type="checkbox" name="UBBcfg" value="pic"<%if UBBcfg_pic=1 then%> checked<%end if%>>图片 <input type="checkbox" name="UBBcfg" value="swf"<%if UBBcfg_swf=1 then%> checked<%end if%>>Flash <input type="checkbox" name="UBBcfg" value="face"<%if UBBcfg_face=1 then%> checked<%end if%>>表情图<br><B>注意:</B>某些Flash动画可能包含有害的脚本,请慎重选择是否支持Flash!</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">留言本状态:</td>
<td width="72%" class="tablebody2">
<input type="radio" value="0" <%if lock=0 then%>checked <%end if%>name="lock">开放 <input type="radio" value="1" <%if lock=1 then%> checked<%end if%> name="lock">锁定
(若锁定,任何人都不能发表留言)</td>
</tr>
<tr>
<td width="28%" class="tablebody3" align="right">留言审核:</td>
<td width="72%" class="tablebody2">
<input type="radio" value="1" <%if needcheck=1 then%>checked <%end if%>name="needcheck">需要 <input type="radio" value="0" <%if needcheck=0 then%> checked<%end if%> name="needcheck">不需要 (未经审核的留言将不会被显示,但管理员可以看到)</td>
</tr>
</table>
<p><input type="submit" value="提 交" name="submit">
<input type="reset" value="清 除" name="submit2"> </p>
</center>
</div>
</form>
<%
end if
conn.close
set rs=nothing
'--------------页面主题显示结束--------
call skin2()
end sub
sub update() '-----------------更新设置
if not session("userkey")=4 then
errinfo="<li>您未登陆或已经退出登陆,不能进入该页。"
call error()
else
dim site,URL,name,password,password2,adminmail,perpage,maxnum,notice,stat,lock,needcheck
site=trim(request.form("site"))
URL=trim(request.form("URL"))
name=trim(request.form("name"))
password=trim(request.form("password"))
password2=trim(request.form("password2"))
adminmail=trim(request.form("adminmail"))
perpage=trim(request.form("perpage"))
maxnum=trim(request.form("maxnum"))
notice=request.form("notice")
badip=trim(request.form("badip"))
adword=trim(request.form("adword"))
stat=trim(request.form("stat"))
UBBcfg=request.form("UBBcfg")
lock=request.form("lock")
needcheck=request.form("needcheck")
if site="" or URL="" or name="" or password="" or adminmail="" or perpage="" or maxnum="" or stat="" or lock="" then
errinfo=errinfo & "<li>内容填写不完整。除了留言提示、IP列表和广告过滤以外,其它各项都是必填的"
end if
if password<>password2 then
errinfo=errinfo & "<li>两次输入的密码不一致"
end if
if (not perpage="") and not(isnumeric(perpage)) then
errinfo=errinfo & "<li>每页显示留言数必须为数字"
end if
if (not maxnum="") and not(isnumeric(maxnum)) then
errinfo=errinfo & "<li>最大留言字数必须为数字"
end if
if (not stat="") and not(isnumeric(stat)) then
errinfo=errinfo & "<li>访问次数必须为数字"
end if
call error()
set rs= server.createobject("adodb.recordset")
sql="select * from admin where id=1"
rs.open sql,conn,3,2
rs.update
rs("site")=site
rs("URL")=URL
rs("name")=name
rs("password")=password
rs("adminmail")=adminmail
rs("perpage")=perpage
rs("maxnum")=maxnum
rs("notice")=notice
rs("badip")=badip
rs("adword")=adword
rs("stat")=stat
rs("ubbconfig")=UBBcfg
rs("lock")=lock
rs("needcheck")=needcheck
rs.update
rs.close
response.redirect "manage.asp"
response.flush
end if
end sub
sub batch() '-----------------批量管理留言
dim currentpage,page_count,pcount
dim totalrec,endpage
if request.querystring("page")="" then
currentpage=1
else
currentpage=cint(request.querystring("page"))
end if
if not session("userkey")=4 then
errinfo="<li>您未登陆或已经退出登陆,不能进入该页。"
call error()
end if
if (not isnumeric(request.querystring("page"))) or (not isnumeric(request.querystring("page_num"))) then
errinfo="<li>非法的页面参数!"
call error()
end if
pagename="批量管理留言"
call pageinfo()
mainpic="page_admin_lw.gif"
call skin1()
'---------------以下显示页面主体--------
%>
<script language="JavaScript" type="text/JavaScript">
<!--
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}
function MM_jumpMenu(targ,selObj,restore){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function SetSubmitType(sub_type){
if (confirm("确定要执行批量操作吗?")){
SetSubmitType = sub_type;
}
}
function Submit_all(theForm){
var flag = false;
if ( SetSubmitType == 'del'){
flag = true;
theForm.action = theForm.action + "del";
}
else if (SetSubmitType == 'check'){
flag = true;
theForm.action = theForm.action + "check";
}
return flag;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -