📄 admin_bbsadd.asp
字号:
<% Option Explicit
Response.Expires=-1
const purviewlevel=4
%>
<!--#include file="admin_PurviewChe.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="admin_Function.asp" -->
<!--#include file="../inf/ubbcode.asp" -->
<%dim rs,errmsg
set rs=server.createobject("ADODB.Recordset")
rs.open"select bbsid,bbsclass from bbsclass order by bbsid",conn,1,1
if rs.eof or rs.bof then
errmsg=errmsg + "<br><br><li>还没有栏目,不能添加主题!</li>"
errmsg=errmsg + "<br><br><li>请添加栏目后再添加主题:[<a href='admin_BbsClaAdd.asp'>添加栏目</a>]</li>"
errmsg=errmsg + "<br><br>"
call closeconn()
call ShowErrMsg()
end if
%>
<% dim orsnews,bbsadd
bbsadd=trim(request.form("bbsadd"))
if bbsadd="add" then
dim usid,title,bbsclass,usphoto,datetime,tellself,face,content,facesel,locknews,passed,SuccessMsg,adminname
set orsnews=server.createobject("adodb.recordset")
orsnews.open"select *from userbook",conn,1,3
orsnews.addnew
orsnews("usid")=request.form("usid")
orsnews("title")=dvHtmlEncode(request.form("title"))
orsnews("bbsclass")=dvHtmlEncode(request.form("bbsclass"))
orsnews("faceimg")=request.form("usphoto")
orsnews("datetime")=request.form("datetime")
tellself=request.form("tellself")
if tellself="yes" then
orsnews("tellself")=true
else
orsnews("tellself")=false
end if
orsnews("content")=dvHtmlEncode(request.form("content"))
orsnews("face")=request.form("face")
locknews=request.form("locknews")
if locknews="yes" then
orsnews("locknews")=true
else
orsnews("locknews")=false
end if
passed=request.form("passed")
if passed="yes" then
orsnews("passed")=true
else
orsnews("passed")=false
end if
orsnews.update
orsnews.close
set orsnews=nothing
adminname=session("adminname")
dim rsbbs,bbs
set rsbbs=conn.execute("select bbs from admin where adminname='"&adminname&"'")
bbs=rsbbs("bbs")+1
conn.execute"update admin set bbs='"&bbs&"' where adminname='"&adminname&"'"
dim books,rsc
set rsc=conn.execute("select books from bbsclass where bbsclass='"&request.form("bbsclass")&"'")
books=rsc("books")+1
conn.execute("update bbsclass set books='"&books&"' where bbsclass='"&request.form("bbsclass")&"'")
rsc.close
set rsc=nothing
call closeconn()
SuccessMsg=SuccessMsg + "<br><br><li>主题发表成功!</li>"
SuccessMsg=SuccessMsg + "<br><br><li>你可以:[<a href='admin_BbsAdd.asp'>继续添加</a>][<a href='admin_BbsManage.asp'>返回BBS管理面板</a>]</li>"
call ShowSuccessMsg()
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发表新主题</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script language=javascript>
function OpenWindow(url)
{
window.open(url,"_blank","height=200,width=300,top=180,left=200,titlebar=no,directories=no,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
}
function checknews()
{
if (window.document.form1.title.value=="")
{
alert("主题名称不能为空!");
return false;
}
if(window.document.form1.bbsclass.value=="")
{
alert("所属栏目不能为空!");
return false;
}
if(window.document.form1.usid.value=="")
{
alert("主题作者不能为空!");
return false;
}
if(window.document.form1.content.value=="")
{
alert("主题内容不能为空!");
return false;
}
}
function contenlen()
{
var len=window.document.form1.content.value.length;
if(len<10)
{
alert("你写得太少了,有灌水之嫌!");
return false;
}
}
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><form name="form1" method="post" action="" onsubmit="return checknews();">
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#F5F8F5" class="border">
<tr>
<td align="center" class="txt1">发表新主题</td>
</tr>
<tr>
<td class="txt05">主题名称:
<input name="title" type="text" class="but" id="title" size="30" maxlength="30">
<span class="txt06"> *</span> </td>
</tr>
<tr>
<td class="txt05">所属栏目:
<select name="bbsclass" class="but" id="bbsclass">
<option>请选择所属栏目</option>
<%'else
do while not rs.eof
%>
<option value="<%=rs("bbsclass")%>"><%=rs("bbsclass")%></option>
<%rs.movenext
loop
'end if
%>
</select>
<span class="txt06"> *</span>发表时间:
<input name="datetime" type="text" class="but" id="datetime" value="<%=now()%>">
<span class="txt06"> *</span></td>
</tr>
<tr>
<td class="txt05">作者头像:<select name="usphoto" class="but" id="usphoto">
<%dim xx
for xx=1 to 18
%>
<option value="usphoto<%=xx%>.gif" selected="selected">photo<%=xx%></option>
<%next%>
</select>
[<a href="#" onclick="OpenWindow('../BbsPhotoShow.asp');">浏览</a>]</td>
</tr>
<tr>
<td class="txt05">主题作者:
<input name="usid" type="text" class="but" id="usid" value="<%=session("adminname")%>" maxlength="20">
<span class="txt06"> *</span> 是否保密:
<input name="tellself" type="checkbox" id="tellself" value="yes">
选中后仅管理员可见</td>
</tr>
<tr>
<td valign="top" class="txt1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13%" rowspan="2" class="txt05">当前心情:</td>
<td width="87%" class="txt02"><input name="face" type="radio" value="images/face1.gif" checked>
<img src="../images/face1.gif" width="22" height="22">
<input type="radio" name="face" value="images/face2.gif">
<img src="../images/face2.gif" width="22" height="22">
<input type="radio" name="face" value="images/face3.gif">
<img src="../images/face3.gif" width="22" height="22">
<input type="radio" name="face" value="images/face4.gif">
<img src="../images/face4.gif" width="22" height="22">
<input type="radio" name="face" value="images/face5.gif">
<img src="../images/face5.gif" width="22" height="22">
<input type="radio" name="face" value="images/face6.gif">
<img src="../images/face6.gif" width="22" height="22">
<input type="radio" name="face" value="images/face7.gif">
<img src="../images/face7.gif" width="22" height="22">
<input type="radio" name="face" value="images/face8.gif">
<img src="../images/face8.gif" width="22" height="22">
<input type="radio" name="face" value="images/face17.gif">
<img src="../images/face17.gif" width="22" height="22"></td>
</tr>
<tr>
<td class="txt02"><input type="radio" name="face" value="images/face9.gif">
<img src="../images/face9.gif" width="22" height="22">
<input type="radio" name="face" value="images/face10.gif">
<img src="../images/face10.gif" width="22" height="22">
<input type="radio" name="face" value="images/face11.gif">
<img src="../images/face11.gif" width="22" height="22">
<input type="radio" name="face" value="images/face12.gif">
<img src="../images/face12.gif" width="22" height="22">
<input type="radio" name="face" value="images/face13.gif">
<img src="../images/face13.gif" width="22" height="22">
<input type="radio" name="face" value="images/face14.gif">
<img src="../images/face14.gif" width="22" height="22">
<input type="radio" name="face" value="images/face15.gif">
<img src="../images/face15.gif" width="22" height="22">
<input type="radio" name="face" value="images/face16.gif">
<img src="../images/face16.gif" width="22" height="22">
<input type="radio" name="face" value="images/face18.gif">
<img src="../images/face18.gif" width="22" height="22"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="middle" class="txt05"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="txt05">主题内容:
<span class="txt06"> *</span></td>
<td class="txt02"><textarea name="content" cols="60" rows="10" class="but" id="textarea" onblur="contenlen()"></textarea></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="middle" class="txt05">是否通过审核
<input name="passed" type="checkbox" id="passed" value="yes" checked>
是否锁定
<input name="locknews" type="checkbox" id="locknews" value="yes"></td>
</tr>
<tr>
<td align="center" valign="middle" class="txt1"><input name="Submit" type="submit" class="but" value="发表">
<input name="Submit2" type="reset" class="but" value="全部重写">
<input name="bbsadd" type="hidden" id="bbsadd" value="add">
</td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
<%
call closeconn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -