📄 adminbd.asp
字号:
<!--#include file="up.asp"-->
<%
if usertype<3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|")=0) then
tl=" 操 作 失 败"
mes="<b>对不起!权限不够。</b>"
call sendinfo(tl,mes)
call down
response.end
end if
function gettop()
idtop=conn.execute("select top 1 top from topic where id="&id&" and bd="&bd&"")(0)
end function
%>
<div class=adminbdlan><a href="adminbd.asp?bd=<%=bd%>&action=gonggao">发布公告</a> | <a href="adminbd.asp?bd=<%=bd%>&action=gonggaogl">公告管理</a><%if bdtype=3 then%> | <a href="adminbd.asp?action=passuser&bd=<%=bd%>"> 认证用户</a><%end if%> | <a href="adminbd2.asp?action=recycle&bd=<%=bd%>">回 收 站</a></div>
<%
dim action,content,content2,contentok,ggtitle,ggok,bad,b,paper,sql,markn,umarkuserid,rs1
function umark(markn)
umarkuserid=conn.execute("select top 1 userid from topic where id="&id&"")(0)
set rs1=server.createobject("adodb.recordset")
sql="Select top 1 mark,del from [user] where userid="&umarkuserid&""
rs1.open sql,conn,1,3
rs1("mark")=rs1("mark")+int(markn)
if rs1("mark")<0 then
rs1("del")=true
application(prefix&"deluser")=application(prefix&"deluser")&"|"&umarkuserid&"|"
end if
rs1.Update
rs1.close
set rs1=nothing
end function
function umark2(markn)
umarkuserid=conn.execute("select top 1 userid from bbs"&totable&" where bbsid="&bbsid&"")(0)
set rs1=server.createobject("adodb.recordset")
sql="Select top 1 mark,del from [user] where userid="&umarkuserid&""
rs1.open sql,conn,1,3
rs1("mark")=rs1("mark")+int(markn)
if rs1("mark")<0 then
rs1("del")=true
end if
rs1.Update
rs1.close
set rs1=nothing
end function
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
action=request.querystring("action")
select case action
%>
<%case"gonggao"%>
<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>
<div class=adminbdtitle>发布公告</div>
<div class=adminbdbody>
<form method="POST" action="adminbd.asp?action=savegg&bd=<%=bd%>" name="topicform" onsubmit="htmlsubmit()">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="200">
<p style="line-height: 120%; margin: 4"><b>公告标题:</b></td>
<td>
<p style="line-height: 120%; margin: 4">
<input type="text" name="ggtitle" size="80"></td>
</tr>
<tr>
<td valign="top" width="200">
<p style="line-height: 150%; margin: 5"><b>帖子内容:</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;">
<textarea name="content" cols="40" rows="2" style="display:none"></textarea>
<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" >
<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>
</form></div>
<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"savegg"
ggtitle=Replace(Request.Form("ggtitle"),"'","")
ggtitle=replace(ggtitle,"|","│")
ggok=Replace(ggtitle," ","")
content=checkbad(Request.Form("content"))
content=replace(content,"|","│")
content=replace(content,"'","''")
contentok=Replace(content," ","")
if ggok="" or contentok="" then
tl=" 发 送 失 败"
mes="<b>对不起!公告发送失败,可能存在以下问题。</b><br>·请填写完整公告标题和公告内容。<br>·<a href='javascript:history.go(-1)'><img src="&styleid&"/re.gif align=absmiddle border=0> 返回重新填写</a>"
else
content2=ggtitle&"|"&lgname&"|"&now()+timeset/24&"|"&content
conn.execute("insert into paper(paper,bd) values('"&content2&"',"&bd&")")
tl=" 发 送 成 功"
mes="·公告发送成功。"
end if
call sendinfo(tl,mes)
%>
<%case"passuser"
%>
<div class=adminbdtitle>认证用户</div>
<div class=adminibdbody>
<form method="POST" action="adminbd.asp?action=editpassuser&bd=<%=bd%>">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
<%if bdtype=3 then%><tr>
<td valign="top" width="30%">
<p style="line-height: 120%; margin: 8"><b>版面认证用户:</b><br>
该版面为认证版面,<br>请输入能够进入该版面的用户名。<br>各个用户名用<font color="#FF0000"> | </font> 隔开,<br>输入过程中<b><font color="#FF0000">不能按 Enter</font></b>。<br>
</td>
<td width="70%">
<p style="margin: 5">
<textarea name="passuser" cols="70" style="font-family: 宋体; font-size: 9pt" rows="8"><%=passuser%></textarea></td>
</tr>
<%end if%>
<tr>
<td colspan="2" height="40" align="center">
<input type="submit" value=" 确 认 修 改 " name="B1">
<input type="reset" value=" 取 消 修 改 " name="B2"></td>
</tr>
</table>
</form>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -