📄 announcements.asp
字号:
strEndDate = Request.Form("EndYearName") & doublenum(Request.Form("EndMonthName")) & doublenum(Request.Form("EndDayName")) & "000001"
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "ANNOUNCE "
strSql = strSql & " SET A_SUBJECT = '" & txtSubject & "'"
strSql = strSql & ", A_MESSAGE = '" & txtMessage & "'"
strSql = strSql & ", A_END_DATE = '" & strEndDate & "'"
strSql = strSql & " WHERE A_ID = " & Request.Form("A_ID")
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="AnnounceMents.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 %>
<% else %>
<%
'## Forum_SQL - Get Announcements from DB
strSql = "SELECT * "
strSql = strSql & " FROM " & strTablePrefix & "ANNOUNCE "
strSql = strSql & " WHERE A_ID = " & Request.QueryString("A_ID")
set rs = my_Conn.Execute (strSql)
TxtSub = rs("A_SUBJECT")
TxtMsg = rs("A_MESSAGE")
strStartDate = StrToDate(rs("A_START_DATE"))
strEndDate = StrToDate(rs("A_END_DATE"))
%>
<% end if %>
<% end if %>
<%
if (lCase(strMethod)="add" or lCase(strMethod)="edit") and _
(Request.Form("Method_Type") <> "Edit_Aannounce" and _
Request.Form("Method_Type") <> "Write_Aannounce") and AdminAllowed = 1 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%">
<TR>
<TD bgcolor="<% =strHeadCellColor %>" colspan="2" align="center" valign="top" nowrap><font color="<% =strForumFontColor %>"><B>>> <% =strAannounceTitle %> <<</b></font></TD>
</TR>
<FORM action="announcements.asp?Method=<% =strMethod %>" method="post" id="PostTopic" name="PostTopic">
<% if lCase(strMethod)="add" then %>
<input type="hidden" name="Method_Type" value="Write_Aannounce">
<% end if %>
<% if lCase(strMethod)="edit" then %>
<input type="hidden" name="Method_Type" value="Edit_Aannounce">
<input type="hidden" name="A_ID" value="<% =Request.QueryString("A_ID") %>">
<% end if %>
<TR valign="top">
<TD bgColor="<% =strPopUpTableColor %>" width="20%" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">标题:</font></TD>
<TD bgColor="<% =strPopUpTableColor %>"><input maxLength="50" name="Subject" value="<% =Trim(ChkString(TxtSub,"display")) %>" size="60"></TD>
</TR>
<TR valign="top">
<TD bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">UBB代码模式:</font></TD>
<TD bgColor="<% =strPopUpTableColor %>" align="left"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<select name="font" onChange="thelp(this.options[this.selectedIndex].value)">
<option value="1">帮助 </option>
<option selected value="2">完全 </option>
<option value="0">基本 </option>
</select></font></TD>
</TR>
<!--#INCLUDE FILE="inc_post_buttons.asp" -->
<TR valign="top">
<TD bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">公告内容:</font><br>
<br>
<table border=0>
<TR>
<TD align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<% if strAllowHTML = "1" then %>
* HTML 语法开启<br>
<% else %>
* HTML 语法关闭<br>
<% end if %>
<% if strAllowForumCode = "1" then %>
* <a href="JavaScript:openWindow3('pop_forum_code.asp')">本版专用代码</a>开启<br>
<% else %>
* 本版专用代码关闭<br>
<% end if %>
</font>
</TD>
</TR>
</table>
</TD>
<TD bgColor="<% =strPopUpTableColor %>"><textarea name="Message" cols="90" rows=15 wrap="virtual"><% =Trim(cleancode(TxtMsg)) %></textarea></TD>
</TR>
<TR>
<TD align="right" bgcolor="<% =strPopUpTableColor %>" colspan="1"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">公告开始日期:</font></TD>
<TD align="left" bgcolor="<% =strPopUpTableColor %>" colspan="1">
<TABLE border="0" cellspacing="1" cellpadding="1">
<TR valign="top">
<TD><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><B>月</B></FONT></TD>
<TD><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><B>日</B></FONT></TD>
<TD><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><B>年</B></FONT><br></TD>
</TR>
<% if lCase(strMethod)="add" then %>
<TR>
<TD><SELECT NAME="StartMonthName">
<% Date_FillBoxWithMonths "", True %>
</SELECT></TD>
<TD><SELECT NAME="StartDayName">
<% Date_FillBoxWithDays "" %>
</SELECT></TD>
<TD><SELECT NAME="StartYearName">
<% Date_FillBoxWithYears 2000, 2005, "" %>
</SELECT></TD>
</TR>
<% end if %>
<% if lCase(strMethod)="edit" then %>
<tr>
<td><SELECT NAME="StartMonthName" disabled>
<% Date_FillBoxWithMonths DatePart("m", strStartDate), True %>
</SELECT></td>
<td><SELECT NAME="StartDayName" disabled>
<% Date_FillBoxWithDays DatePart("d", strStartDate) %>
</SELECT></td>
<td><SELECT NAME="StartYearName" disabled>
<% Date_FillBoxWithYears 2000, 2005, DatePart("yyyy", strStartDate) %>
</SELECT></td>
</TR>
<% end if %>
</TABLE>
</TD>
</TR>
<TR>
<TD align="right" bgcolor="<% =strPopUpTableColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">公告结束日期:</font></TD>
<TD align="left" bgcolor="<% =strPopUpTableColor %>">
<TABLE border="0" cellspacing="1" cellpadding="1">
<TR valign="top">
<TD><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><B>月</B></FONT></TD>
<TD><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><B>日</B></FONT></TD>
<TD><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><B>年</B></FONT><br></TD>
</TR>
<TR>
<TD><SELECT NAME="EndMonthName"><% Date_FillBoxWithMonths DateAdd( "m", +1, Now() ), True %></SELECT></TD>
<TD><SELECT NAME="EndDayName"><% Date_FillBoxWithDays "" %></SELECT></TD>
<TD><SELECT NAME="EndYearName"><% Date_FillBoxWithYears 2000, 2005, Date_GetYear(DateAdd( "m", +1, Now() )) %></SELECT></TD>
</TR>
</TABLE>
</TD>
</TR>
<!--#INCLUDE FILE="inc_post_smilie.asp" -->
<TR>
<TD bgColor="<% =strPopUpTableColor %>" height=32 colspan="2" align="center"><input type="submit" value="发布公告" id="submit1" name="submit1"> <input name="Preview" type="button" value="预览公告" onclick="OpenPreview()"> <input type="reset" value="重新设定" id="reset1" name="reset1"></TD>
</TR>
</form>
</TABLE>
</TD>
</TR>
</TABLE>
<% end if %>
<P>
<!--#INCLUDE FILE="inc_adv.asp" -->
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
sub Paging()
if maxPages > 1 then
sScriptName = Request.ServerVariables("script_name")
ref = "<B>论坛公告共有 <FONT color=" & strInsistFontColor & ">" & maxPages & "</FONT> 页: [ "
if myPage-10 > 0 then
ref = ref & "<A HREF=""" & sScriptName
ref = ref & "?whichpage=" & StartPageNum - 1
ref = ref & "&Method=" & strMethod
ref = ref & """>←</a> "
end if
For I = StartPageNum to EndPageNum
if I <> myPage then
ref = ref & "<A href=""" & sScriptName & "?whichpage=" & I
ref = ref & "&Method=" & strMethod
ref = ref & """>" & I & "</a> "
else
ref = ref & "<font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=" & strInsistFontColor & ">" & I & "</FONT> "
end if
Next
if EndPageNum < maxPages then
ref = ref & "<A href=""" & sScriptName & "?whichpage=" & EndPageNum + 1
ref = ref & "&Method=" & strMethod
ref = ref & """>→</a> "
end if
ref = ref & "]</B>"
Response.Write (ref)
else
Response.Write ("<B>论坛公告只有一页</B>")
end if
end sub
Function Date_GetYear( dDate )
Date_GetYear = DatePart( "yyyy", dDate )
End Function
Function Date_GetMonthNo( dDate )
Date_GetMonthNo = DatePart( "m", dDate )
End Function
Function Date_GetDayNo( dDate )
Date_GetDayNo = DatePart( "d", dDate )
End Function
Function Date_GetMonthName( nMonthNo )
Select Case nMonthNo
Case 1
Date_GetMonthName = "一月"
Case 2
Date_GetMonthName = "二月"
Case 3
Date_GetMonthName = "三月"
Case 4
Date_GetMonthName = "四月"
Case 5
Date_GetMonthName = "五月"
Case 6
Date_GetMonthName = "六月"
Case 7
Date_GetMonthName = "七月"
Case 8
Date_GetMonthName = "八月"
Case 9
Date_GetMonthName = "九月"
Case 10
Date_GetMonthName = "十月"
Case 11
Date_GetMonthName = "十一月"
Case 12
Date_GetMonthName = "十二月"
End Select
End Function
Sub Date_FillBoxWithYears( nFirst, nLast, nDefault )
Dim nYear
If nDefault = "" Then
nDefault = Date_GetYear( Now() )
End If
For nYear = nFirst To nLast
Response.Write "<option"
If nYear = nDefault Then
Response.Write " selected=yes"
End If
Response.Write ">" & nYear & "</option>" & vbcrlf
Next
End Sub
Sub Date_FillBoxWithMonths( nDefault, fUseNumbersAsValue )
Dim nMonth
If nDefault = "" Then
nDefault = Date_GetMonthNo( Now() )
End If
For nMonth = 1 To 12
Response.Write "<option"
If nMonth = nDefault Then
Response.Write " selected=yes"
End If
If fUseNumbersAsValue = True Then
Response.Write " value=" & nMonth
End If
Response.Write ">" & Date_GetMonthName(nMonth) & "</option>" & vbcrlf
Next
End Sub
Sub Date_FillBoxWithDays( nDefault )
Dim nDay
If nDefault = "" Then
nDefault = Date_GetDayNo( Now() )
End If
For nDay = 1 To 31
Response.Write "<option"
If nDay = nDefault Then
Response.Write " selected=yes"
End If
Response.Write ">" & nDay & "</option>" & vbcrlf
Next
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -