📄 announcements.asp
字号:
<%
'#############################################################
'# 中国在线--极酷论坛 ver.2001 3.0
'#
'# 版权所有: 中国在线 (ChinaXP.Net)
'#
'# 制作人 : 周周 (SeeYa!)
'#
'#
'# 主页地址: http://www.ChinaXP.net/ 中国在线
'# http://www.ChinaXP.Net/bbs/ 中国在线--极酷论坛
'#
'#############################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->
<!--#INCLUDE FILE="inc_functions2.asp" -->
<%
Dim strMethod, mypagesize
strMethod = Request("Method")
mypagesize = 10
if strMethod="" then
strMethod = "View"
end if
If Request("whichpage") = "" or Request("whichpage") <= 0 then
mypage = 1
Else
mypage = cInt(Request("whichpage"))
End If
if (mLev = 4) or (lcase(strNoCookies) = "1") then
AdminAllowed = 1
else
AdminAllowed = 0
end if
%>
<% if lCase(strMethod)="edit" or lCase(strMethod)="add" then %>
<!--#INCLUDE FILE="inc_code.asp" -->
<% end if %>
<script language="JavaScript">
<!--
function OpenPreview()
{
var curCookie = "strMessagePreview=" + escape(document.PostTopic.Message.value);
document.cookie = curCookie;
popupWin = window.open('pop_preview.asp', 'preview_page', 'scrollbars=yes,width=550,height=250')
}
//-->
</script>
<% '################################## %>
<TD width="70%" align="left" valign="top">
<TABLE border="0" width="85%" align=center>
<TR>
<TD width="33%" align="left" nowrap><font face="<% Response.Write strDefaultFontFace %>" size="<% Response.Write strDefaultFontSize %>"><a href="default.asp"><img src="<% =strImageURL %>icon_folder_open.gif" alt="返回论坛首页" border="0"> <% =strForumTitle %></a>
<BR><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<% =strImageURL %>icon_folder_open.gif" border="0"> <A href="announcements.asp">论坛公告</A>
<% if lCase(strMethod)="add" then %>
<BR><img src="<%=strImageURL %>icon_blank.gif" border="0"><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<% =strImageURL %>icon_folder_open_topic.gif" border="0"> 发布论坛公告
<% end if %>
<% if lCase(strMethod)="edit" then %>
<BR><img src="<%=strImageURL %>icon_blank.gif" border="0"><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<% =strImageURL %>icon_folder_open_topic.gif" border="0"> 编辑论坛公告
<% end if %>
<% if strMethod="" or lCase(strMethod)="view" then %>
<BR><img src="<%=strImageURL %>icon_blank.gif" border="0"><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<% =strImageURL %>icon_folder_open_topic.gif" border="0"> 查看论坛公告
<% end if %>
</FONT></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<% '################################## %>
<P>
<% if strMethod="" or lCase(strMethod)="view" then %>
<TABLE cellpadding="0" cellspacing="0" border="0" width="<% Response.Write strTableWidth %>" bgcolor="<% =strTableBorderColor %>" align="center">
<TR>
<TD>
<TABLE cellpadding="3" cellspacing="1" border="0" width="100%" style="TABLE-LAYOUT: fixed">
<%
set rs = Server.CreateObject("ADODB.Recordset")
'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "ANNOUNCE.A_ID"
strSql = strSql & ", " & strTablePrefix & "ANNOUNCE.A_AUTHOR"
strSql = strSql & ", " & strTablePrefix & "ANNOUNCE.A_SUBJECT"
strSql = strSql & ", " & strTablePrefix & "ANNOUNCE.A_MESSAGE"
' ### strSql = strSql & ", " & strTablePrefix & "ANNOUNCE.A_FORUMLIST"
strSql = strSql & ", " & strTablePrefix & "ANNOUNCE.A_START_DATE"
strSql = strSql & ", " & strTablePrefix & "ANNOUNCE.A_END_DATE"
strSql = strSql & " FROM " & strTablePrefix & "ANNOUNCE "
if mLev < 4 then
strSql = strSql & " WHERE " & strTablePrefix & "ANNOUNCE.A_START_DATE <= " & "'" & DatetoStr(Now()) & "'"
strSql = strSql & " AND " & strTablePrefix & "ANNOUNCE.A_END_DATE > " & "'" & DatetoStr(Now()) & "'"
end if
strSql = strSql & " ORDER BY " & strTablePrefix & "ANNOUNCE.A_START_DATE DESC"
strSql = strSql & ", " & strTablePrefix & "ANNOUNCE.A_ID DESC;"
RS.cachesize = 20
RS.open strSql, my_Conn, 3
i = 0
If RS.EOF or RS.BOF then '## No categories found in DB
Response.Write ""
Else
num = 0
RS.MoveFirst
RS.PageSize = mypagesize
RS.CacheSize = RS.PageSize
maxPages = cint(RS.PageCount)
If myPage > RS.PageCount Then
myPage = RS.PageCount
end if
RS.AbsolutePage = myPage
StartPageNum=1
do while StartPageNum+10<=myPage
StartPageNum = StartPageNum+10
Loop
EndPageNum = StartPageNum+9
If EndPageNum > RS.Pagecount then EndPageNum = RS.Pagecount
howmanyrecs = 0
rec = 1
do until RS.EOF or (rec = mypagesize + 1)
if strI = 0 then
CColor = strAltForumCellColor
else
CColor = strForumCellColor
end if
%>
<TR>
<TD bgcolor="<% =strHeadCellColor %>" align="center" valign="top" nowrap><font color="<% =strForumFontColor %>"><B>>> <% =ChkString(rs("A_SUBJECT"),"display") %> <<</b></font></TD>
</TR>
<% if (mLev = 4) or (lcase(strNoCookies) = "1") then %>
<TR>
<TD bgcolor="<% =CColor %>" valign="top" style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word">
<TABLE border="0" cellpadding="1" cellspacing="1" width="100%">
<TBODY>
<TR>
<TD width="100%"> <a href="JavaScript:openWindow('pop_announce_delete.asp?mode=Announcement&A_ID=<% =rs("A_ID") %>')"><img src="<%=strImageURL %>a_delete.gif" alt="删除公告" border="0" align="absmiddle" hspace="6"></a>
<A href="announcements.asp?Method=Add"><img src="<%=strImageURL %>a_add.gif" alt="发布公告" border="0" align="absmiddle" hspace="6"></A>
<A href="announcements.asp?Method=Edit&A_ID=<% =rs("A_ID") %>&A_SUBJECT=<% =ChkString(rs("A_SUBJECT"),"urlpath") %>"><img src="<%=strImageURL %>a_edit.gif" alt="编辑公告" border="0" align="absmiddle" hspace="6"></A>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<% end if %>
<TR>
<TD bgcolor="<% =CColor %>" valign="top" style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word"><FONT face="宋体" color="#555555">
<BR><BLOCKQUOTE>
<font color="<% =strForumFontColor %>"><% =formatStr(rs("A_MESSAGE")) %></FONT>
</BLOCKQUOTE>
<P></FONT></TD>
</TR>
<TR>
<TD bgcolor="<% =CColor %>" valign="middle">
<TABLE bgcolor="<% =CColor %>" width="100%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD align="left"> <B>发布人:<% =rs("A_AUTHOR") %></B></TD>
<TD align="center"><B>
<% if rs("A_END_DATE") < DatetoStr(Now()) then %>
<font color="<% =strActiveLinkColor %>">(本则公告已过期)
<% end if %>
<% if rs("A_START_DATE") > DatetoStr(Now()) then %>
<font color="<% =strActiveLinkColor %>">(本则公告尚未启动)
<% end if %>
</B></TD>
<TD align="right"><B>发布时间:<% =ChkDate(rs("A_START_DATE")) %> </B> </TD>
</TR>
</TABLE>
</TD>
</TR>
<%
rec = rec + 1
strI = strI + 1
if strI = 2 then
strI = 0
end if
RS.MoveNext
loop
end if
%>
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE width="<% Response.Write strTableWidth %>" align="center" cellpadding="3" cellspacing="1" border="0">
<TR>
<TD><% Call Paging() %></TD>
</TR>
</TABLE>
<% end if %>
<%
if lCase(strMethod)="add" then
strAannounceTitle = "发布论坛公告"
if Request.Form("Method_Type") = "Write_Aannounce" then
txtSubject = ChkString(Request.Form("Subject"),"title")
txtMessage = ChkString(Request.Form("Message"),"message")
txtStartDate = Request.Form("StartYearName") & doublenum(Request.Form("StartMonthName")) & doublenum(Request.Form("StartDayName")) & "000001"
txtEndDate = Request.Form("EndYearName") & doublenum(Request.Form("EndMonthName")) & doublenum(Request.Form("EndDayName")) & "000001"
Err_Msg = ""
if txtSubject = " " then
Err_Msg = Err_Msg & "<li>你必须输入标题!</li>"
end if
if txtMessage = " " then
Err_Msg = Err_Msg & "<li>你必须输入公告内容!</li>"
end if
if txtStartDate = txtEndDate then
Err_Msg = Err_Msg & "<li>公告不能开始和结束在同一天!</li>"
end if
if txtStartDate > txtEndDate then
Err_Msg = Err_Msg & "<li>公告不能在开始前就结束!</li>"
end if
if Err_Msg = "" then
txtMessage = ChkString(Request.Form("Message"),"message")
txtSubject = ChkString(Request.Form("Subject"),"title")
strStartDate = Request.Form("StartYearName") & doublenum(Request.Form("StartMonthName")) & doublenum(Request.Form("StartDayName")) & "000001"
strEndDate = Request.Form("EndYearName") & doublenum(Request.Form("EndMonthName")) & doublenum(Request.Form("EndDayName")) & "000001"
'## Forum_SQL - Do DB Update
strSql = "INSERT INTO " & strTablePrefix & "ANNOUNCE ("
strSql = strSql & "A_AUTHOR"
strSql = strSql & ", A_SUBJECT"
strSql = strSql & ", A_MESSAGE"
strSql = strSql & ", A_START_DATE"
strSql = strSql & ", A_END_DATE"
strSql = strSql & ") VALUES ("
strSql = strSql & "'" & strDBNTUserName & "'"
strSql = strSql & ", '" & txtSubject & "'"
strSql = strSql & ", '" & txtMessage & "'"
strSql = strSql & ", " & "'" & strStartDate & "'"
strSql = strSql & ", " & "'" & strEndDate & "'"
strSql = strSql & ")"
my_Conn.Execute (strSql)
%>
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">公告已经发布完毕!</font></p>
<meta http-equiv="Refresh" content="1; URL=AnnounceMents.asp">
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">修改完毕!</font></p>
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="default.asp">回到论坛首页</font></a></p>
<% else %>
<p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">你输入的资料有问题或没有输入完全</font></p>
<table align=center border=0>
<TR>
<TD><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<ul>
<% =Err_Msg %>
</ul>
</font></TD>
</TR>
</table>
<p align=center><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>><a href="JavaScript:history.go(-1)">请返回重新输入</a></font></p>
<% end if %>
<% end if %>
<% end if %>
<%
if lCase(strMethod)="edit" then
strAannounceTitle = "编辑论坛公告"
if Request.Form("Method_Type") = "Edit_Aannounce" then
txtSubject = ChkString(Request.Form("Subject"),"title")
txtMessage = ChkString(Request.Form("Message"),"message")
txtEndDate = Request.Form("EndYearName") & doublenum(Request.Form("EndMonthName")) & doublenum(Request.Form("EndDayName")) & "000001"
Err_Msg = ""
if txtSubject = " " then
Err_Msg = Err_Msg & "<li>你必须输入标题!</li>"
end if
if txtMessage = " " then
Err_Msg = Err_Msg & "<li>你必须输入公告内容!</li>"
end if
if txtEndDate < DateToStr(Now()) then
Err_Msg = Err_Msg & "<li>公告不能在开始前就结束!</li>"
end if
if Err_Msg = "" then
txtMessage = ChkString(Request.Form("Message"),"message")
txtSubject = ChkString(Request.Form("Subject"),"title")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -