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

📄 bulletin.asp

📁 旋木留言本 v1.51 主要功能: UBB代码支持
💻 ASP
字号:
<% Option Explicit %>
<%response.buffer=true%>

<!--#include file="Inc_common.asp"-->
<%
'**************************************
'**    Bulletin.asp
'**
'** 文件说明:公告发布页面
'** 修改日期:2004-9-22
'** 作者:Howlion
'** Email:howlion@163.com
'**************************************
dim mainpic
mainpic="page_bulletin.gif"

dim errinfo
select case request("act")
case "addin"
call update()
case else
call main()
end select

sub main()
pagename="发布公告"
call pageinfo()

if not session("login")="true" then
errinfo="您没有登陆或已经退出登陆。"
error(errinfo)
else

call skin1()
'---------------以下显示页面主体--------
%>
<br>
<script src="ubb.js"></script>
<form action="?act=addin" method="POST" name="frmAnnounce">
<table align="center" cellpadding="3" cellspacing="1" class="table1" width="95%" style="border-collapse: collapse table-layout:fixed;word-break:break-all">
<tr>
<td width="20%" class="tablebody3" align="right" height="19">管理QQ</td>
<td width="80%" class="tablebody2" height="19"><input name="userqq" size="19" maxlength="80">&nbsp;可不填</td>
</tr>
<tr>
<td width="20%" class="tablebody3" align="right" height="19">公告标题</td>
<td width="80%" class="tablebody2" height="19"><input name="usertitle" size="40" maxlength="100">&nbsp;必填,少于50个字节</td>
</tr>
<tr>
<td width="20%" valign="top" class="tablebody3" align="right" height="160">公告正文<br>
<b><br>
</b></td>
<td width="80%" class="tablebody2" height="160"><!--#include file="Inc_ubb.asp"-->
<textarea class="smallarea" cols="60" name="usercontent" title="Ctrl+Enter提交" rows="12" onkeydown=ctlent()></textarea><br><br>点击表情符号可以将其加入正文(正文内容不能大于300字符)。<br>
<%
dim ii,i
for i=1 to 42
if len(i)=1 then ii="0" & i else ii=i
response.write "<img src=""images/faces/"&ii&".gif"" border=0 onclick=""insertsmilie('[face"&ii&"]')"" style=""CURSOR: hand"">&nbsp;"
if i=17 or i=34 then response.write "<br>"
next
%>
</td>
</tr>
<tr>
<td valign="middle" colspan="2" align="center" class="tablebody1" height="21"><b><input type="Submit" value="提 交" name="Submit">&nbsp;&nbsp;<input type="reset" name="Submit2" value="清 除"> </b></td>
</tr>
</table>
</div>
</form>
<%
'--------------页面主体显示结束--------
call skin2()
end if
end sub

sub update()

if not session("login")="true" then
errinfo="您没有登陆或已经退出登陆。"
error(errinfo)
exit sub
else

dim username,userurl,usermail,userqq,usertitle,usercontent,xingbie,whisper,ip,checked,adderr,nameerr,adderr2,adderr3,nameerr2,titleerr,titleerr2,contenterr,contenterr2,urlerr,mailerr,qqerr
username=name
xingbie=0
userurl=url
usermail=adminmail
userqq=request.form("userqq")
usertitle=request.form("usertitle")
usercontent=request.form("usercontent")
ip=Request.ServerVariables("REMOTE_ADDR")

if usertitle="" then
adderr=true
titleerr=true
elseif len(usertitle)>50 then
adderr2=true
titleerr2=true
end if

if usercontent="" then
adderr=true
contenterr=true
end if

if trim(userqq)<>"" then
if not(isnumeric(userqq)) then
adderr3=true
qqerr=true
end if
end if

if adderr=true or adderr2=true or adderr3=true then
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="70%">
<tr>
<td width="100%" height="210">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="187">
<tr>
<td width="100%" height="16">
<p align="center"><img border="0" src="images/error.gif" width="17" height="17"><b>出错了!!</b></td>
</tr>
<tr>
<td width="100%" height="170">
<p align="center"><%if adderr=true then%>以下内容没有填写:<%end if%><%if titleerr=true then%>『公告标题』<%end if%><%if contenterr=true then%>『公告内容』<%end if%><br>
<%if adderr2=true then%>以下内容超过限制的字数:<%end if%><%if titleerr2=true then%>『留言标题』<%end if%><%if contenterr2=true then%>『留言内容』<%end if%><br>
<%if adderr3=true then%>以下内容格式错误:<%end if%><%if qqerr=true then%>『QQ号码』<%end if%><br>
<br><br>
<a href="javascript:history.back(1)">&lt;- <b>重新填写</b></a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
exit sub
end if

Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from topic"
rs.open sql,conn,3,2
rs.addnew
rs("username")=username
rs("xingbie")=0
rs("userurl")=userurl
rs("usermail")=usermail
rs("userqq")=userqq
rs("usertime")=now()
rs("usertitle")=usertitle
rs("usercontent")=usercontent
rs("top")="1"
rs("reply")="0"
rs("ip")=ip
rs("checked")=1
rs("whisper")=0
rs.update
rs.close
Response.Redirect "Index.asp"
Response.Flush
end if
end sub
%>

⌨️ 快捷键说明

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