⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminright2.asp

📁 完美政府版,正版网站解决方案
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="AdminConn.asp"--><!--#include file="../inc/fun.asp"--><!--#include file="../inc/md5.asp"-->
<%
dim action,strt,i,bad,b,lgname,lgpwd,lgpwdmd5,id,paper,ggtitle,ggok,content,contentok,content2,rs1,sql,bdlist2,grade
dim name,url,picurl,readme
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

sub bdlist()
set bdlist2=conn.execute("select * from bdinfo where followid<>0 order by followid,orders desc,id")
response.write"<select size=1 name=bd style='font-size: 9pt'><option value=0>请选择版面</option>"
do while not bdlist2.eof
response.write"<option value="&bdlist2("id")&">"&split(bdlist2("bdinfo"),"|")(0)&"</option>"
bdlist2.movenext
Loop
response.write"</select>"
set bdlist2=nothing
end sub

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"editgg","editggok" strt="公告修改"
case"bdinfo" strt="论坛版面设置"
case"addfl","addflsave" strt="添加分类"
case"delfl","delflok" strt="删除分类"
case"addbd","addbdsave" strt="添加版面"
case"delbd","delbdok" strt="删除版面"
case"adminbd","addbdadmin","delbdadmin" strt="版主设置"
case"allbd","addallbd","delallbd" strt="超级版主设置"
case"admiin","addadmin","deladmin" 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"editgg"
id=checknum(request.querystring("id"))
set rs=conn.execute("select*from paper where id="&id&"")
paper=rs("paper")
paper=split(paper,"|")

%>
<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="adminright2.asp?action=editggok&id=<%=id%>" name="topicform">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bordercolor="#F4F6FC">
      <tr>
 <td width="30%" class=td2>
 <p style="line-height: 120%; margin: 4">公告标题:</td>
 <td width="70%">
 <p style="line-height: 120%; margin: 4">
 <input type="text" name="ggtitle" size="80" value="<%=checkform(paper(0))%>"></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" value='<%=paper(3)%>'>
<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()">&nbsp;&nbsp;&nbsp; <input class=submit type=button value="预  览!" onclick=preview()>&nbsp;&nbsp;&nbsp; <input class=submit type=reset value=NO_!重写 name=B2>&nbsp; [ 按 Alt+Enter 直接发送 ]</td>
      </tr>
      </table>
</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"editggok"
id=checknum(request.querystring("id"))
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
call send("<b>对不起!公告修改失败,可能存在以下问题。</b><br>·请填写完整公告标题和公告内容。<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
else
content2=ggtitle&"|"&lgname&"|"&now()+timeset/24&"|"&content
conn.execute("update [paper] set paper='"&content2&"' where id="&id&"")
call send("公告修改成功。")
end if
%>
<%case"bdinfo"
%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bordercolor="#e3e3e3">
  <tr class=td2>
    <td width="40%" bgcolor="#F4F6FC" height="28">
    <p style="line-height: 150%; margin: 4">当前论坛已有的分类信息:</td>
    <td width="60%" bgcolor="#F4F6FC">
    <p style="line-height: 150%; margin: 4">当前论坛已有的版面信息:</td>
  </tr>
<%
set rs=conn.execute("select * from bdinfo where followid=0 order by orders desc,id")
do while not rs.eof
response.write"<tr><td valign=top><p style='line-height: 150%; margin: 4'>分类 ID:<b>"&rs("id")&"</b><br>分类名称:"&rs("bdinfo")&"&nbsp; <a href=adminright1.asp?action=editfl&flid="&rs("id")&">[ 编辑 ]</a>&nbsp; <a href=adminright1.asp?action=upfl&flid="&rs("id")&">[ 置前 ]</a></td><td valign=top><p style='line-height: 150%; margin: 4'>"
set rs1=conn.execute("select * from bdinfo where followid="&rs("id")&" order by orders desc,id")
do while not rs1.eof
response.write"版面 ID:<b>"&rs1("id")&"</b>&nbsp; &nbsp; 版面名称:"&split(rs1("bdinfo"),"|")(0)&"&nbsp; <a href=adminright1.asp?action=editbd&bd="&rs1("id")&">[ 编辑 ]</a>&nbsp; <a href=adminright1.asp?action=upbd&bd="&rs1("id")&">[ 置前 ]</a>"
if rs1("type")=3 then response.write"&nbsp; <a href=adminright1.asp?action=pass&bd="&rs1("id")&">[ 认证 ]</a>"
response.write"<br>"
rs1.movenext
loop
set rs1=nothing
response.write"</td></tr>"
rs.movenext
loop
set rs=nothing
%>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="#000000" height="35">
  <tr>
    <td class=td3><b><u>&gt;&gt;</u><a href="adminright2.asp?action=addfl"><u>添加分类</u></a></b>&nbsp;&nbsp; | &nbsp;&nbsp;<b><u>&gt;&gt;</u><a href="adminright2.asp?action=delfl"><u>删除分类</u></a></b>&nbsp; | &nbsp;&nbsp;<u>&gt;&gt;</u><b><a href="adminright2.asp?action=addbd"><u>添加版面</u></a>
    </b> | &nbsp;&nbsp;<b><u>&gt;&gt;</u><a href="adminright2.asp?action=delbd"><u>删除版面</u></a></b></td>
  </tr>
  </table>
<%
case"addfl"
%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F4F6FC" width="100%">
<form method="POST" action="adminright2.asp?action=addflsave"><tr>
    <td width="35%">
    <p style="margin: 8"><font color="#0466CC"><b>请输入分类的 ID:</b></font><br>不能与已有的分类 ID 重复,不能填 <b>0</b></td>
    <td width="65%">&nbsp;<input type="text" name="flid" size="9"></td>
  </tr>
  <tr>
    <td>
    <p style="margin: 8"><font color="#0466CC"><b>请输入分类的名称:</b></font><br>支持 HTML</td>
    <td>&nbsp;<input type="text" name="flname" size="46"></td>
  </tr>  <tr>
    <td colspan="2" bgcolor="#F4F6FC" align="center" height="35">
    <input type="submit" value="     确  认  添  加     " name="B1"></td>
  </tr></form>
</table>
<%
application(prefix&"allthebbs")=""
case"addflsave"
dim flid,flname
flid=checknum(request.form("flid"))
flname=Replace(Request.Form("flname"),"'","")
if flid="" or flname="" or flid=0 then
call send("·对不起,请正确填写分类的ID和名称。<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
else
set rs=conn.execute("select top 1 bdinfo from bdinfo where id="&flid&" and followid=0")
if not rs.eof then
call send("·对不起,分类 ID:<b>"&flid&"</b> 已经被 "&rs("bdinfo")&" 使用了。<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
else
conn.execute("insert into bdinfo(id,bdinfo) values("&flid&",'"&flname&"')")
response.redirect"adminright2.asp?action=bdinfo"
end if
end if
%>
<%
application(prefix&"allthebbs")=""
case"delfl"%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F4F6FC" width="100%">
<form method="POST" action="adminright2.asp?action=delflok"><tr>
    <td width="35%">
    <p style="margin: 8; line-height:150%">请输入要删除的分类的 ID:<br>
    <font color="#FF0000">注意:该操作将删除该分类下的版面和帖子。</font></td>
    <td width="65%">&nbsp;<input type="text" name="flid" size="9"></td>
  </tr>
 <tr>
    <td colspan="2" bgcolor="#F4F6FC" align="center" height="35">
    <input type="submit" value="     确  认  删  除     " name="B1" onClick="{if(confirm('确定删除此分类吗?这样将删除该分类下的版面和帖子。')){return true;}return false;}"></td>
  </tr></form>
</table>
<%
application(prefix&"allthebbs")=""
case"delflok"
flid=checknum(request.form("flid"))
conn.execute("delete*from bdinfo where (id="&flid&" and followid=0) or followid="&flid&"")
conn.execute("delete*from topic where bd="&flid&"")
conn.execute("delete*from paper where bd="&flid&"")

dim usedtable
usedtable=application(prefix&"usedtable")
usedtable=split(usedtable,"|")
for i=1 to ubound(usedtable)
conn.execute("delete*from bbs"&i&" where bd="&flid&"")
next
response.redirect"adminright2.asp?action=bdinfo"
%>
<%
application(prefix&"allthebbs")=""
case"addbd"
'lamking添加
if  conn.execute("select * from bdinfo where  followid=0").eof then
call send("·对不起,分类 ID:论坛尚无分类,请先:<br>·<a href='adminright2.asp?action=addfl'><font color=#ffffff>添加分类</font></a>")
response.end
end if
'结束
%>
<form method="POST" action="adminright2.asp?action=addbdsave">
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F4F6FC" width="100%">
 <tr>
   <td width="25%">
   <p style="line-height: 150%; margin: 5"><b><font color="#0466CC">版面 ID:</font></b><br>不能与已有的版面 ID 重复,不能填 <b>0</b></td>
   <td width="75%">&nbsp;<input type="text" name="bd" size="25"></td>
 </tr>
 <tr>

⌨️ 快捷键说明

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