📄 admin_notice.asp
字号:
<!--#include file = admin_chk.asp -->
<%
If Not ChkAdmin("Notice") Then
Call ArtErr("","")
End If
%>
<head>
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
</head>
<%
editid=trim(Request("editid"))
saveid=trim(Request("saveid"))
delid=trim(Request("delid"))
'2007_05_19修改
id=trim(request("id"))
op=trim(Request("op"))
title=Request("title")
content=Request("content")
gtype=Request("gtype")
addtime=now()
if editid<>"" and trim(Request("title"))="" and trim(Request("content"))="" then
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [webgg] where id="&clng(editid),conn,1,1
if rs.recordcount<>0 then
edittitle=rs("title")
editcontent=rs("content")
gtype=rs("gtype")
end if
rs.close
set rs=nothing
elseif saveid="" and trim(Request("title"))<>"" and trim(Request("content"))<>"" then
conn.Execute "insert into [webgg] ([title],[content],[addtime],[adduser],gtype) values('"&title&"','"&content&"','"&addtime&"','"&Request.Cookies(Art2008)("fullname")&"',"& gtype &")"
Response.Redirect "admin_notice.asp"
elseif saveid<>"" and trim(Request("title"))<>"" and trim(Request("content"))<>"" then
conn.Execute "update [webgg] set title='"&title&"',content='"&content&"',gtype=">ype&" where id="&clng(saveid)
Response.Redirect "admin_notice.asp"
elseif delid<>"" then
conn.Execute "delete from [webgg] where ID="&CInt(delid)
'2007_05_19修改
elseif op<>"" then
if op="show" then
conn.execute "update [webgg] set ifhide=false where id="&id
end if
if op="hide" then
conn.execute "update [webgg] set ifhide=true where id="&id
end if
'2007_05_19修改结束
end if
UbbImagePath="../images/gbook/guestbook/"
%>
<body>
<TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<th height=25 colspan="3" >公告管理</th>
</tr> </table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.title.value == "")
{
alert("请在 公告标题 域中输入值。");
theForm.title.focus();
return (false);
}
if (theForm.title.value.length < 1)
{
alert("在 公告标题 域中,请至少输入 1 个字符。");
theForm.title.focus();
return (false);
}
if (theForm.title.value.length > 200)
{
alert("在 公告标题 域中,请最多输入 200 个字符。");
theForm.title.focus();
return (false);
}
if (theForm.content.value == "")
{
alert("请在 公告内容 域中输入值。");
theForm.content.focus();
return (false);
}
if (theForm.content.value.length < 1)
{
alert("在 公告内容 域中,请至少输入 1 个字符。");
theForm.content.focus();
return (false);
}
return (true);
}
function openhelp()
{
var Win =window.open("editor_ubbhelp.asp","face","width=550,height=400,resizable=1,scrollbars=1");
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="?saveid=<%=editid%>" onSubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
<tr>
<td width="90" class="tdbg"><b>公告标题:</b></td>
<td width="587" class="tdbg"><!--webbot bot="Validation" s-display-name="公告标题" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="200" --><input type="text" name="title" class="input_1" size="50" value="<%=edittitle%>" maxlength="200" align="absmiddle">
<select size="1" name="gtype">
<option value="0" <% if gtype=0 then Response.Write " selected "%>>站内公告</option>
<option value="1" <% if gtype=1 then Response.Write " selected "%>>会员公告</option>
</select></td>
</tr>
<tr>
<td class="tdbg"><b>Ubb标签:</b></td>
<td class="tdbg"><% call showubb()%></td>
</tr>
<tr>
<td width="90" class="tdbg" height="94"><b>公告内容:</b></td>
<td width="587" height="94" class="tdbg"><textarea name="content" cols="65" rows="10" id="Content"><%=editcontent%></textarea></td>
</tr>
<tr><td colspan="2" align="center" class="tdbg"><input type="submit" value=" 保 存 " name="B1"> <input type="reset" value=" 重 置 " name="B2"></td></tr>
</form></table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td class="bg_tr" width="60%" align="center" height="25"><strong>公 告</strong></td>
<td class="bg_tr" width="15%" align="center" height="25"><strong>类 型</strong></td>
<td class="bg_tr" width="25%" align="center" height="25"><strong>操 作</strong></td>
</tr>
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [webgg] order by id desc",conn,1,1
if rs.recordcount<>0 then
page=int(request("page"))
rs.PageSize=10
pagecount=rs.pagesize
if page<=0 then page=1
if request("page")="" then page=1
rs.AbsolutePage=page
bbb=0
for k=1 to pagecount
%>
<tr height="23" <% if bbb=1 then Response.Write "style='background-color: #F2F2F2'"%>> <!--'2007_05_19修改-->
<td class="tdbg" ><font color="#333333">(编号:<%=rs("id")%>)</font><%if rs("ifhide")=true then%><font color=#666666><%end if%><%=titleb(rs("title"),50)%><br> </td>
<td align="center" class="tdbg"><% if rs("gtype")=0 then Response.Write "站内公告" else Response.Write "会员公告" end if%></td>
<td align="center" class="tdbg" >
<a href="?editid=<%=rs("ID")%>">修改</a> <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="?delid=<%=rs("id")%>">删除</a> <%if rs("ifhide") then%><a href="?id=<%=rs("ID")%>&op=show"><font color=#999999>显示</font></a><%else%><a href="?id=<%=rs("ID")%>&op=hide">隐藏</a><%end if%></td>
<!--'2007_05_19修改结束-->
</tr>
<%
bbb=bbb+1
if bbb>=2 then bbb=0
rs.movenext
if rs.eof then exit for
next
else
Response.Write "<tr><td colspan=3>暂无公告!</td></tr>"
end if
%>
<tr><td class="tdbg" align="center" colspan="3">
<%if rs.recordcount<>0 then
if page>1 then
response.write "<a href="&request.servervariables("URL")&"?page=1>首页</a> "
response.write "<a href="&request.servervariables("URL")&"?page="&page-1&">上一页</a> "
end if
if page<rs.pagecount then
response.write "<a href="&request.servervariables("URL")&"?page="&page+1&">下一页</a> "
response.write "<a href="&request.servervariables("URL")&"?page="&rs.pagecount&">尾页</a> "
end if
response.write "共"&rs.recordcount&"条 每页显示"&pagecount&"条 共"&rs.pagecount&"页 "
%>
<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>
<select size="1" onChange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
<%for i=1 to rs.pagecount%>
<option value="<%=request.servervariables("URL")%>?page=<%=i%>" <%if page=i then response.write "selected"%> style="font-size: 9pt">第<%=i%>页</option>
<%next%>
</select>
<%end if%>
</td></tr></table>
</body>
<%
rs.close
set rs=nothing
Call AdminPageEnd()
conn.close
set conn=nothing
%>
<%
'''''''''''''''''''''''''''Ubb标签'''''''''''''''''''''''''''''''''''''''''''''''''''
sub ShowUbb()%>
<script language=JavaScript>
helpstat = false;
stprompt = true;
basic = false;
function thelp(swtch){
if (swtch == 1){
basic = false;
stprompt = false;
helpstat = true;
} else if (swtch == 0) {
helpstat = false;
stprompt = false;
basic = true;
} else if (swtch == 2) {
helpstat = false;
basic = false;
stprompt = true;
}
}
function AddText(NewCode) {
document.FrontPage_Form1.Content.value+=NewCode;
}
function emails() {
if (helpstat) {
alert("Email 标记\n插入 Email 超级链接\n用法1: [email]nobody@domain.com[/email]\n用法2: [email=nobody@domain.com]佚名[/email]");
} else if (basic) {
AddTxt="[email][/email]";
AddText(AddTxt);
} else {
txt2=prompt("链接显示的文字.\n如果为空,那么将只显示你的 Email 地址","");
if (txt2!=null) {
txt=prompt("Email 地址.","name@domain.com");
if (txt!=null) {
if (txt2=="") {
AddTxt="[email]"+txt+"[/email]";
} else {
AddTxt="[email="+txt+"]"+txt2;
AddText(AddTxt);
AddTxt="[/email]";
}
AddText(AddTxt);
}
}
}
}
function flash() {
if (helpstat){
alert("Flash 动画\n插入 Flash 动画.\n用法: [flash]Flash 文件的地址[/flash]");
} else if (basic) {
AddTxt="[flash][/flash]";
AddText(AddTxt);
} else {
txt=prompt("Flash 文件的地址","http://");
if (txt!=null) {
AddTxt="[flash]"+txt;
AddText(AddTxt);
AddTxt="[/flash]";
AddText(AddTxt);
}
}
}
function Cdir() {
if (helpstat){
alert("Shockwave 动画\n插入 Shockwave 动画.\n用法: [dir=500,350]Shockwave 文件的地址[/dir]");
} else if (basic) {
AddTxt="[dir][/dir]";
AddText(AddTxt);
} else {
txt=prompt("Shockwave 文件的地址","");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -