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

📄 ad_announce.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
📖 第 1 页 / 共 4 页
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true	
Const PurviewLevel=2
Const CheckChannelID=0
Const PurviewLevel_Others="Announce"
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/ubbcode.asp"-->
<!--#include file="inc/func.asp"-->
<%
dim sql,rs,rsChannel,strFileName,UbbImagePath
dim Action,Channel,FoundErr,ErrMsg
Action=Trim(Request("Action"))
Channel=Trim(Request("Channel"))
if Channel="" then
	Channel=0
else
	Channel=CLng(Channel)
end if
strFileName="ad_announce.asp?Channel="&Channel
UbbImagePath="images/guestbook/"
%>
<html>
<head>
<title>公告管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="ad_Style.css">
<SCRIPT language=javascript>
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll"&&e.disabled!=true)
       e.checked = form.chkAll.checked;
    }
}
function ConfirmDel()
{
	if(document.myform.Action.value=="Del")
	{
		if(confirm("确定要删除选中的公告吗?"))
		    return true;
		else
			return false;
	}
}
function openhelp()
{
	var Win =window.open("editor_ubbhelp.asp","face","width=550,height=400,resizable=1,scrollbars=1");
}
</script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
  <tr class="topbg"> 
    <td height="22" colspan=2 align=center><b>网 站 公 告 管 理</b></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航:</strong></td>
    <td height="30"><a href="ad_Announce.asp?Action=Add">添加新公告</a> | <a href="ad_Announce.asp">所有频道公告</a> | <a href="ad_Announce.asp?Channel=1">网站首页公告</a> | <a href="ad_Announce.asp?Channel=2">文章频道公告</a> | <a href="ad_Announce.asp?Channel=3">软件频道公告</a> | <a href="ad_Announce.asp?Channel=4">图片频道公告</a> | <a href="ad_Announce.asp?Channel=5">留言频道公告</a> | </td>
  </tr>
</table>
<%
if Action="Add" then
	call AddAnnounce()
elseif Action="SaveAdd" then
	call SaveAdd()
elseif Action="Modify" then
	call Modify()
elseif Action="SaveModify" then
	call SaveModify()
elseif Action="SetNew" then
	call SetNew()
elseif Action="CancelNew" then
	call CancelNew()
elseif Action="SetShowType" then
	call SetShowType()
elseif Action="Move" then
	call MoveAnnounce()
elseif Action="Del" then
	call DelAnnounce()
else
	call main()
end if
if FoundErr=True then
	call WriteErrMsg()
end if
call CloseConn()


sub main()
	sql="select * from Announce"
	sql=sql & " where ChannelID=" & Channel
	sql=sql & " order by IsSelected,id desc"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,1
%>
<form name="myform" method="POST" action=<%=strFileName%> onsubmit="return ConfirmDel();">
<%
response.write "您现在的位置:网站公告管理&nbsp;&gt;&gt;&nbsp;<font color=red>"
select case Channel
	case 0
		response.write "所有频道公告"
	case 1
		response.write "网站首页公告"
	case 2
		response.write "文章频道公告"
	case 3
		response.write "软件频道公告"
	case 4
		response.write "图片频道公告"
	case 5
		response.write "留言频道公告"
	case else
		response.write "错误的参数"
end select
response.write "</font><br>"
%>
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
    <tr class="title"> 
      <td width="30" height="22" align="center"><strong>选择</strong></td>
      <td width="50" height="22" align="center"><strong>公告ID</strong></td>
      <td height="22" align="center"><strong>标 题</strong></td>
      <td width="60" height="22" align="center"><strong>最新公告</strong></td>
      <td width="60" height="22" align="center"><strong>显示方式</strong></td>
      <td width="60" height="22" align="center"><strong>发布人</strong></td>
      <td width="120" height="22" align="center"><strong>发布时间</strong></td>
      <td width="60" height="22" align="center"><strong>操作</strong></td>
    </tr>
    <%
	if not(rs.bof and rs.eof) then
		do while not rs.eof
%>
    <tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'"> 
      <td align="center"> 
        <input type="checkbox" value=<%=rs("ID")%> name="AnnounceID">
      </td>
      <td align="center"> <%=rs("ID")%> </td>
      <td><a href="<%=strFileName%>&Action=Modify&ID=<%=rs("ID")%>" title="<%=left(nohtml(rs("content")),200)%>"><%=rs("Title")%></a></td>
      <td align="center"> 
        <%if rs("IsSelected")=true then response.write "<font color=#009900>新</font>" end if%>
      </td>
      <td align="center"> 
        <%
		if rs("ShowType")=0 then
			response.write "全部"
		elseif rs("ShowType")=1 then
			response.write "滚动"
		elseif rs("ShowType")=2 then
			response.write "弹出"
		end if
		%>
      </td>
      <td align="center"><%=rs("Author")%></td>
      <td align="center"><%=rs("DateAndTime")%></td>
      <td align="center"> 
        <%
	  response.write "<a href='" & strFileName & "&Action=Modify&ID=" & rs("ID") & "'>修改</a>&nbsp;&nbsp;"
	  response.write "<a href='" & strFileName & "&Action=Del&AnnounceID=" & rs("ID") & "' onClick=""return confirm('确定要删除此公告吗?');"">删除</a>"
	  %>
      </td>
    </tr>
    <%
		rs.movenext
	loop
	%>
    <tr class="tdbg"> 
      <td colspan=8 height="30"> 
        <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
        选中所有公告 
        <input name="Action" type="hidden" id="Action" value="del">
        &nbsp;&nbsp;&nbsp;&nbsp;说明:只有将公告设为最新公告后才会在前台显示
		<% if PopAnnounce="No" then response.write "<font color=red>(网站配置中已将弹出公告禁用)</font>"%>
      </td>
    </tr>
    <tr class="tdbg">
      <td colspan=8 height="30">将选定的公告: 
        <input type="submit" value=" 删除 " name="submit" onClick="document.myform.Action.value='Del'">
        &nbsp;&nbsp;
        <input type="submit" value="设为最新公告" name="submit" onClick="document.myform.Action.value='SetNew'">
        &nbsp;&nbsp;
        <input type="submit" value="取消最新公告" name="submit" onClick="document.myform.Action.value='CancelNew'">
        &nbsp;&nbsp;
        <input type="submit" value="设置显示方式" name="submit" onClick="document.myform.Action.value='SetShowType'">
		<select name='ShowType'>
			<option value='0'>全部</option>
			<option value='1'>滚动</option>
			<option value='2'>弹出</option>
		</select>
        &nbsp;&nbsp;
        <input type="submit" value="移动至" name="submit" onClick="document.myform.Action.value='Move'">
		<select name='ChannelID'>
			<option value='0'>全部</option>
			<option value='1'>首页</option>
			<option value='2'>文章</option>
			<option value='3'>软件</option>
			<option value='4'>图片</option>
			<option value='5'>留言</option>
		</select>
	  </td>
    </tr>
    <% end if%>
  </table>
</form>
<%
	rs.close
	set rs=nothing
end sub

sub AddAnnounce()
%>
<form name="form1" method="post" action=<%=strFileName%>>
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
    <tr class="title"> 
      <td height="22" colspan="2" align="center"><strong>添 加 公 告</strong></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" align="right">标题:</td>
      <td width="80%"> 
        <input type="text" name="Title" size="66" id="Title" value="">
      </td>
    </tr>
    <tr class="tdbg">
      <td align="right">Ubb标签:</td>
      <td> <% call showubb()%></td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">内容:</td>
      <td> 
        <textarea name="Content" cols="55" rows="10" id="Content"></textarea>
        &nbsp;&nbsp;&nbsp;</td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">发布人:</td>
      <td> 
        <input name="Author" type="text" id="Author" value="<%=AdminName%>" size="20" maxlength="20">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">发布时间:</td>
      <td> 
        <input name="DateAndTime" type="text" id="DateAndTime" value="<%=now()%>" size="20" maxlength="20">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">所属频道:</td>
      <td> 
        <input type='radio' name='ChannelID' value='0' checked>
        全部&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='1'>
        首页&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='2'>
        文章&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='3'>
        软件&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='4'>
        图片&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='5'>
        留言&nbsp;&nbsp; </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">显示类型:</td>
      <td> 
        <input type="radio" name="ShowType" value="0" checked>
        全部&nbsp;&nbsp; 
        <input type="radio" name="ShowType" value="1">
        滚动&nbsp;&nbsp; 
        <input type="radio" name="ShowType" value="2">
        弹出&nbsp;&nbsp; </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">&nbsp;</td>
      <td> 
        <input name="IsSelected" type="checkbox" id="IsSelected" value="True" checked>
        设为最新公告</td>
    </tr>
    <tr class="tdbg"> 
      <td height="40" colspan="2" align="center"> 
        <input name="Action" type="hidden" id="Action" value="SaveAdd">
        <input type="submit" name="Submit" value=" 添 加 ">
      </td>
    </tr>
  </table>
</form>
<%
end sub

sub Modify()
	dim ID
	ID=trim(request("ID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要修改的公告ID!</li>"
	else
		ID=Clng(ID)
	end if
	sql="select * from Announce where ID=" & ID
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,1
	if rs.bof and rs.eof then
		FoundErr=true
		ErrMsg=ErrMsg & "<br><li>找不到指定的公告!</li>"
		rs.close
		set rs=nothing
		exit sub
	end if
%>
<form name="form1" method="post" action=<%=strFileName%>>
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
    <tr align="center" class="title"> 
      <td height="22" colspan="2"><strong>修 改 公 告</strong></td>
    </tr>

⌨️ 快捷键说明

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