📄 admin_update.asp
字号:
<!-- #include file="../conn.asp" -->
<!--#include file="../inc/config.asp"-->
<!-- #include file="session.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<script language="javaScript" src="../js/js.js"></script>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<div id="topmomo">
<a href="admin_update.asp?info=add">添加新公告</a> |
<a href="admin_update.asp?info=list&cndb=all">所有公告</a> |
<a href="admin_update.asp?info=list&cndb=top">置顶公告</a> |
<a href="admin_update.asp?info=list&cndb=nolink">非连接公告</a> |
<a href="admin_update.asp?info=list&cndb=islink">外部连接公告</a> |
<a href="admin_update.asp?info=list&cndb=book">作品评论公告</a> |
<a href="admin_update.asp?info=list&cndb=user">会员专区公告</a> |
<a href="admin_update.asp?info=list&cndb=author">作家专区公告</a></div>
<br>
<%
Select Case request.querystring("info")
Case "add"
Call add()
Case "list"
Call list()
Case "edit"
Call edit()
end select
Sub list()%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tborder">
<tr>
<td class="thead" align="center" height="25" colspan="9"><b>查 看 所 有 公 告</b></td>
</tr>
<form name="form" onsubmit="javascript:return cnendb();" target="cnendb" action="admin_Daily.asp?info=update_listdel">
<tr height="22" align="center">
<td width="5%" class="tcat"></td>
<td width="30%" class="tcat">公告主题</td>
<td width="20%" class="tcat">发表时间</td>
<td width="10%" class="tcat">状态</td>
<td width="10%" class="tcat">发表人</td>
<td width="10%" class="tcat">浏览次数</td>
<td width="15%" class="tcat">操作</td>
</tr>
<%
Const MaxPerPage=20
If Request("page")<>"" then
CurrentPage=Cint(Request("Page"))
Else
CurrentPage=1
End if
set rs=server.createobject("adodb.recordset")
cndb=request.querystring("cndb")
if IsSqlDataBase = 2 then
if cndb="all" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from news order by id desc"
elseif cndb="top" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from news where Istop=1 order by id desc"
elseif cndb="nolink" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from news where iscontent=1 order by id desc"
elseif cndb="islink" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from news where islink=1 order by id desc"
elseif cndb="book" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from news where Ntype=1 order by id desc"
elseif cndb="user" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from news where Ntype=2 order by id desc"
elseif cndb="author" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from news where Ntype=3 order by id desc"
end if
else
if cndb="all" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from [news] order by id desc"
elseif cndb="top" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from [news] where Istop=1 order by id desc"
elseif cndb="nolink" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from [news] where iscontent=1 order by id desc"
elseif cndb="islink" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from [news] where islink=1 order by id desc"
elseif cndb="book" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from [news] where Ntype=1 order by id desc"
elseif cndb="user" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from [news] where Ntype=2 order by id desc"
elseif cndb="author" then
sql="select id,txttitle,txttime,Istop,Iscontent,Islink,username,hits from [news] where Ntype=3 order by id desc"
end if
end if
'MySQL需要如下语句
conn.CursorLocation=3
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<tr align="center">
<td colspan="9" height="22" class="alt1"><span class="style1">暂无任何公告</span></td>
</tr>
<%else
Rs.PageSize=MaxPerPage
Allpage=Rs.PageCount
If Currentpage>Allpage Then Currentpage=1
Num=Rs.RecordCount
Rs.MoveFirst
Rs.AbsolutePage=CurrentPage
i=0
do while not rs.eof
%>
<tr height="22" align="center">
<td class="alt2">
<input type="checkbox" name="checked" value="<%=rs("id")%>"></td>
<td class="alt2" align="left">
<a href="admin_update.asp?info=edit&id=<%=rs("id")%>"><%=rs("txttitle")%></a></td>
<td class="alt2"><%= rs("txttime") %></td>
<td class="alt2"><%if rs("Istop")=1 then response.write "置顶" end if %>
<%if rs("Iscontent")=1 then response.write " 非连接" end if %> <%if rs("Islink")=1 then response.write " 外部连接" end if %>
<%if rs("Istop")=0 and rs("Iscontent")=0 and rs("Islink")=0 then response.write "普通" end if %>
</td>
<td class="alt2"><%= rs("username") %> </td>
<td class="alt2"><%= rs("hits") %>次</td>
<td class="alt2">
<a href="../gonggaodisp.asp?id=<%=rs("id")%>" target=_blank>浏览</a>
<a href="admin_update.asp?info=edit&id=<%=rs("id")%>">修改</a>
<a href="admin_Daily.asp?info=update_del&id=<%=rs("id")%>">删除</a></td>
</tr>
<% i=i+1
If i>=MaxPerPage Then Exit Do
Rs.MoveNext
Loop
%><tr>
<td height="20" align="center" colspan="8" class="alt3">
<input name="info" type="hidden" value="update_listdel">
<input class="button" type="button" onclick="CheckAll(this.form)" value="全选" name="chkall" style="width: 45; height: 20">
<input class="button" type="button" onclick="CheckOthers(this.form)" value="反选" name="chkOthers" style="width: 45; height: 20">
<input class="button" type="submit" value="删除" name="listdel" style="width: 45; height: 20">
</td>
</tr>
</form>
<%End If
Rs.Close
Set Rs=Nothing
%> <tr align="center">
<td height="25" colspan="9" class="alt2"><%Response.Write ShowPage("admin_update.asp?info=list&cndb="&cndb&"",CurrentPage,Num,MaxPerPage,True,True," 个项目")%></td>
</tr>
</table>
<%end sub
Sub add()%>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="tborder">
<tr height="25">
<td colspan="4" class="thead">添加公告</td>
</tr>
<script language="JavaScript">
var postminchars = parseInt('2');
var postmaxchars = parseInt('<%=filelistNum%>');
var disablepostctrl = parseInt('0');
function checklength(theform) {
if (postmaxchars != 0) { message = "系统限制: "+postminchars+" 到 "+postmaxchars+" 字节"; }
else { message = ""; }
alert("CnEndWeb(终点)提醒:\n当前长度: "+theform.message.value.length+" 字节\n\n"+message);
}
function validate(theform) {
if (theform.message.value == "" && theform.subject.value == "") {
alert("CnEndWeb(终点)提醒:\n请完成标题或内容栏。");
return false;
} else if (theform.subject.value.length > 200) {
alert("CnEndWeb(终点)提醒:\n您的标题超过 200 个字符的限制。");
return false;
}
if (!disablepostctrl && ((postminchars != 0 && theform.message.value.length < postminchars) || (postmaxchars != 0 && theform.message.value.length > postmaxchars))) {
alert("CnEndWeb(终点)提醒:\n公告内容长度不符合要求。\n\n当前长度: "+theform.message.value.length+" 字节\n系统限制: "+postminchars+" 到 "+postmaxchars+" 字节");
return false;
}
theform.replysubmit.disabled = true;
return true;
}
</script>
<form action="admin_Daily.asp?info=update_add" method="post" name="input" onsubmit="return validate(this)">
<script language="JavaScript" src="../js/bbcode.js"></script>
<tr>
<td colspan="4" class="alt3">
<div id="panx">
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="panel">
<tr>
<td width="25%" height="22" align="right" class="alt2">
<b>公告标题:</b><br>
</td>
<td width="75%" class="alt1">
<textarea name="subject" rows="3" cols="50" class="form"></textarea>
<br>(任何状态下不能为空,支持UBB代码)</td>
</tr>
<tr>
<td width="25%" height="22" align="right" class="alt2">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -