📄 adminright3.asp
字号:
<!--#include file="AdminConn.asp"--><!--#include file="../inc/fun.asp"--><!--#include file="../inc/md5.asp"-->
<%dim action,strt,i,lgname,lgpwd,lgpwdmd5,lguserid,touserid,usedtable,usetable,using,table,canadd,totable,tablestr,autotable,usedtable1,sql,bd
lgname=replace(session(prefix&"lgname"),"'","''")
lgpwd=replace(session(prefix&"lgpwd"),"'","''")
if isnull(lgname) or lgname="" or isnull(lgpwd) or lgpwd="" then
response.redirect"admincheck.asp"
else
lgpwdmd5=md5(lgpwd)
if conn.execute("select top 1 bd from admin where name='"&lgname&"' and password='"&lgpwdmd5&"' and bd=0").eof then
response.redirect"admincheck.asp"
end if
end if
lguserid=checknum(session(prefix&"lguserid"))
action=request.querystring("action")
select case action
case"sms","deloldsms","delusersms" strt="论坛留言管理"
case"sendsms","savesms" strt="群发留言"
case"table","updatetable","addtable","deltable" strt="论坛帖子数据表管理"
case"recycle","delbbsgg" strt="论坛回收站"
end select
sub send(str)
response.write"<table border=1 cellpadding=0 cellspacing=0 style='border-collapse: collapse' bordercolor=#F4F6FC width=100% bgcolor=#ffffff height=50><tr><td width=100% ><p style='margin:5px;line-height:150%'>"&str&"</p></td></tr></table>"
end sub
%>
<link rel=stylesheet type=text/css href=pic/css.css>
<STYLE type=text/css>
body { background:#555555; margin:0px; font-family: Verdana, Arial, sans-serif, 宋体; font-size: 9pt; text-decoration: none; color:#555555;
SCROLLBAR-FACE-COLOR: #55919A;
SCROLLBAR-HIGHLIGHT-COLOR: #cccccc;
SCROLLBAR-SHADOW-COLOR: #cccccc;
SCROLLBAR-3DLIGHT-COLOR: #cccccc;
SCROLLBAR-ARROW-COLOR: #555555;
SCROLLBAR-TRACK-COLOR: #555555;
SCROLLBAR-DARKSHADOW-COLOR: #cccccc;}
</style>
<body bgcolor="#D6DFF7" leftmargin="15" rightmargin="15">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table7" height="18" >
<tr>
<td align="right" height="40" background="../../images/admin_top_bg.gif"><div align="center"><font color="#ffffff">完美政府CMS系统.论坛后台管理</font></div></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" >
<tr>
<td class=td1 height="30" align="center" background="../../images/topBar_bg.gif"><font color="#000000">完美设计·政府网站管理系统{宽屏新城第二版}--<%=strt%></font></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#1C58C9" width="100%" bgcolor=#ffffff>
<tr>
<td width="100%" valign="top">
<%
select case action
case"sms"
%><br><form method="POST" action="adminright3.asp?action=deloldsms">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td class=td3 colspan=2>删除所有已读的留言:</td>
</tr>
<tr>
<td class=td2 width="30%" height="40" bgcolor="#F4F6FC">
<p style="margin: 6">删除所有已读的留言:<br>确实要删除,请输入<font color="#FF0000">ok</font>。</td>
<td width="70%" bgcolor="#F4F6FC">
<input type="text" name="ok" size="20">
<input type="submit" value=" 确 认 删 除 " name="B1"></td>
</tr>
</table></form>
<form method="POST" action="adminright3.asp?action=delusersms">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td class=td3 colspan=2>删除指定用户的所有留言:</td>
</tr>
<tr>
<td class=td2 width="30%" height="40" bgcolor="#F4F6FC">
<p style="margin: 6">删除指定用户的留言:( 用户名 )</td>
<td width="70%" bgcolor="#F4F6FC">
<input type="text" name="name" size="20"> <input type="submit" value=" 确 认 删 除 " name="B1"></td>
</tr>
</table></form>
<%case"deloldsms"
dim ok
ok=Replace(Request.Form("ok"),"'","")
if ok="ok" then
conn.execute("delete*from sms where new=false")
call send("删除已读留言成功。")
else
call send("删除已读留言失败。")
end if
case"delusersms"
dim name,userid
name=Replace(Request.Form("name"),"'","")
set rs=conn.execute("select top 1 userid from [user] where name='"&name&"'")
if rs.eof then
call send("·论坛不存在该用户<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
else
userid=rs(0)
conn.execute("delete*from sms where touserid="&userid&"")
call send("删除 "&checktitle(name)&" 的留言成功。")
end if
set rs=nothing
%>
<%case"sendsms"%>
<SCRIPT>
function checkeditor(editor)
{
if(editor=="html")
{
document.getElementById("ubbeditordiv").style.display = 'none';
document.getElementById("htmltoolbar").style.display = 'block';
EDITFORM_DOCUMENT.body.innerHTML = document.getElementById("CodeForm").value;
document.getElementById("editTextarea").style.display = 'none';
document.getElementById("editIframe").style.display = 'block';
HtmlDisableToolbar(false);
}
else if(editor=="ubb")
{
document.getElementById("ubbeditordiv").style.display = 'block';
document.getElementById("htmltoolbar").style.display = 'none';
document.getElementById("CodeForm").value = HtmlHtmlToXhtml(EDITFORM_DOCUMENT.body.innerHTML);
document.getElementById("editIframe").style.display = 'none';
document.getElementById("editTextarea").style.display = 'block';
HtmlDisableToolbar(true);
}
}
function preview()
{
if(htmlsubmit()){
document.form1.topic.value=document.topicform.ggtitle.value;
document.form1.content.value=document.topicform.content.value;
var popupWin = window.open('../paper.asp?action=preview', 'showgg', 'width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes');
document.form1.submit()
}
}
</SCRIPT>
<form method="POST" action="adminright3.asp?action=savesms" name="topicform">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bordercolor="#F4F6FC">
<tr>
<td class=td2 width="100%" height="32" colspan="2" bgcolor="#F4F6FC">
<font color="#FF0000">注意:该操作将会占用很大系统资源,请慎用。</font></td>
</tr>
<tr>
<td class=td2 width="25%" height="32">
<p style="line-height: 120%; margin: 4">留言对象:</td>
<td width="75%">
<p style="line-height: 120%; margin: 4">
<select style="FONT-SIZE: 9pt" name="toname">
<option value="0" selected>所有在线用户</option>
<option value="1">所有版主</option>
<option value="2">所有超级版主</option>
<option value="3">所有管理员</option>
<option value="4">所有Vip用户</option>
<option value="5">所有注册用户</option>
</select><input type="hidden" name="ggtitle" size="20" value="群发留言"></td>
</tr>
<tr>
<td valign="top" width="200">
<p style="line-height: 150%; margin: 5"><b><font color="#0466CC">留言内容:</font></b><br>
<input type="radio" name="usereditor" value="html" onClick="checkeditor('html')" checked>使用Html编辑器<br>
<input type="radio" name="usereditor" value="ubb" onClick="checkeditor('ubb')">使用UBB编辑器<br>
</td>
<td valign="top" style="padding:5px;">
<input name=content type="hidden">
<SCRIPT src="../Editor/Ubb/UbbEditor.js"></SCRIPT>
<script type="text/javascript" src="../Editor/Html/htmlEditor.js"></script>
<script>
var ubbedit=new UbbEditor("CodeForm",100,14,"default values","../editor/ubb/images/");
ubbedit.showeditor();
</script>
<script type="text/javascript">
var editor = new htmlEditor("editor");
editor.hiddenName = "content";
editor.width = "100%";
editor.height = "300px";
editor.imagePath="../editor/html/images/";
editor.iconPath = '../editor/html/images/face/';
editor.show();
var strlength;
//提交表单
function submitform(){
if(htmlsubmit())
{document.topicform.submit();}
}
//检测表单
function htmlsubmit() {
if(document.getElementsByName("usereditor").item(0).checked==true){
var content = editor.data();
}
else if(document.getElementsByName("usereditor").item(1).checked==true){
checkeditor("html");
var content = editor.data();
checkeditor("ubb");
}
strlength=document.getElementsByName("content").item(0).value.length;
if (strlength>25600||strlength<5){
alert("您输入的文章长度为"+strlength+",长度必须大于5且小于25600,请修正之后再继续。");
return false;
}
else if(document.getElementsByName("ggtitle").item(0).value==""){
alert("标题不能为空。");
document.getElementsByName("ggtitle").item(0).focus();
return false;
}
else{
return true;
}
}
</script>
</td>
</tr>
<tr>
<td colspan="2" align="center" height="40" bgcolor="#F4F6FC">
<input class=submit type=button value=OK_!发送 name=B1 onClick="submitform()"> <input class=submit type=button value="预 览!" onclick=preview()> <input class=submit type=reset value=NO_!重写 name=B2> [ 按 Alt+Enter 直接发送 ]</td>
</tr>
</table>
</div>
</form>
<form name=form1 action=../paper.asp?action=preview method=post target=showgg>
<input type=hidden name=topic value=><input type=hidden name=content value=>
</form>
<%case"savesms"
dim bad,b,toname,content,contentok,content2
toname=checknum(request.form("toname"))
function checkbad(str)
if isnull(str) then exit function
bad=split(application(prefix&"badcontent"), "|")
for b=0 to ubound(bad)
str=Replace(str,bad(b),string(len(bad(b)),"*"))
next
checkbad=str
end function
content=checkbad(Request.Form("content"))
content=replace(content,"|","│")
content=replace(content,"'","''")
contentok=Replace(content," ","")
content2=content&"|"&now()+timeset/24
if toname="" or contentok="" then
call send("·请填写完整留言对象和留言内容<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
else
select case toname
case 0
set rs=conn.execute("select userid from online where userid<>0")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing
case 1
set rs=conn.execute("select userid from [user] where grade=14")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing
case 2
set rs=conn.execute("select userid from [user] where grade=15")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing
case 3
set rs=conn.execute("select userid from [user] where grade=16")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing
case 4
set rs=conn.execute("select userid from [user] where grade=13")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing
case 5
set rs=conn.execute("select userid from [user]")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing
end select
call send("群发留言成功。")
end if
case"table"
%><form method="POST" action="adminright3.asp?action=updatetable">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F4F6FC" width="100%">
<tr>
<td class=td3 width="100%" colspan="4" height="32" bgcolor="#F4F6FC"> 当前论坛已有的帖子数据表:</td>
</tr>
<tr class=td2>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -