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

📄 ad_announce.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
📖 第 1 页 / 共 4 页
字号:
    <tr class="tdbg"> 
      <td width="20%" align="right">标题:</td>
      <td width="80%"> 
        <input type="text" name="Title" size="66" id="Title" value="<%=dvHTMLCode(rs("Title"))%>">
      </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"><%=rs("Content")%></textarea>
        &nbsp;</td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">发布人:</td>
      <td> 
        <input name="Author" type="text" id="Author" value="<%=dvHTMLCode(rs("Author"))%>" size="20" maxlength="20">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">发布时间:</td>
      <td> 
        <input name="DateAndTime" type="text" id="DateAndTime" value="<%=rs("DateAndTime")%>" size="20" maxlength="20">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">所属频道:</td>
      <td> 
        <input type='radio' name='ChannelID' value='0' <%if rs("ChannelID")=0 then response.write " checked"%>>
        全部&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='1' <%if rs("ChannelID")=1 then response.write " checked"%>>
        首页&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='2' <%if rs("ChannelID")=2 then response.write " checked"%>>
        文章&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='3' <%if rs("ChannelID")=3 then response.write " checked"%>>
        软件&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='4' <%if rs("ChannelID")=4 then response.write " checked"%>>
        图片&nbsp;&nbsp; 
        <input type='radio' name='ChannelID' value='5' <%if rs("ChannelID")=5 then response.write " checked"%>>
        留言&nbsp;&nbsp; </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">显示类型:</td>
      <td> 
        <input type="radio" name="ShowType" value="0" <%if rs("ShowType")=0 then response.write "checked"%>>
        全部&nbsp;&nbsp; 
        <input type="radio" name="ShowType" value="1" <%if rs("ShowType")=1 then response.write "checked"%>>
        滚动&nbsp;&nbsp; 
        <input type="radio" name="ShowType" value="2" <%if rs("ShowType")=2 then response.write "checked"%>>
        弹出&nbsp;&nbsp; </td>
    </tr>
    <tr class="tdbg"> 
      <td align="right">&nbsp;</td>
      <td> 
        <input name="IsSelected" type="checkbox" id="IsSelected" value="True" <% if rs("IsSelected")=true then response.write "checked"%>>
        设为最新公告</td>
    </tr>
    <tr class="tdbg"> 
      <td height="40" colspan="2" align="center"> 
        <input name="Action" type="hidden" id="Action" value="SaveModify">
        <input type="submit" name="Submit" value=" 保 存 ">
        <input name="ID" type="hidden" id="ID" value="<%=rs("ID")%>">
      </td>
    </tr>
  </table>
</form>
<%
	rs.close
	set rs=nothing
end sub
%>
</body>
</html>
<%

sub SaveAdd()
	dim Title,Content,Author,DateAndTime,IsSelected,ChannelID,ShowType,sql
	Title=trim(request("Title"))
	Content=trim(request("Content"))
	Author=trim(request("Author"))
	DateAndTime=trim(request("DateAndTime"))
	IsSelected=trim(request("IsSelected"))
	ChannelID=Clng(request("ChannelID"))
	ShowType=Clng(request("ShowType"))
	if Title="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>公告标题不能为空!</li>"
	end if
	if len(Title)>250 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>公告标题过长(应小于250)!</li>"
	end if
	if Content="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>公告内容不能为空!</li>"
	end if
	if FoundErr=True then
		exit sub
	end if
	
	Title=dvHtmlEncode(Title)
'	Content=dvHtmlEncode(Content)
	Author=dvHtmlEncode(Author)
	if DateAndTime<>"" and IsDate(DateAndTime)=true then
		DateAndTime=Cdate(DateAndTime)
	else
		DateAndTime=now()
	end if
	if IsSelected="True" then
		IsSelected=True
	else
		IsSelected=False
	end if
	sql="select * from Announce"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.addnew
	rs("Title")=Title
	rs("Content")=Content
	rs("Author")=Author
	rs("DateAndTime")=DateAndTime
	rs("IsSelected")=IsSelected
	rs("ChannelID")=ChannelID
	rs("ShowType")=ShowType
	rs.update
	rs.close
	set rs=nothing
	call CloseConn()
	response.redirect "ad_announce.asp?Channel="&ChannelID
end sub

sub SaveModify()
	dim ID,Title,Content,Author,DateAndTime,IsSelected,ChannelID,ShowType
	ID=trim(request("ID"))
	Title=trim(request("Title"))
	Content=trim(request("Content"))
	Author=trim(request("Author"))
	DateAndTime=trim(request("DateAndTime"))
	IsSelected=trim(request("IsSelected"))
	ChannelID=Clng(request("ChannelID"))
	ShowType=Clng(request("ShowType"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要修改的公告ID!</li>"
	else
		ID=Clng(ID)
	end if
	if Title="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>公告标题不能为空!</li>"
	end if
	if len(Title)>250 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>公告标题过长(应小于250)!</li>"
	end if
	if Content="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>公告内容不能为空!</li>"
	end if
	if FoundErr=True then
		exit sub
	end if
	sql="select * from Announce where ID=" & ID
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	if rs.bof and rs.eof then
		FoundErr=true
		ErrMsg=ErrMsg & "<br><li>找不到指定的公告!</li>"
		rs.close
		set rs=nothing
		exit sub
	end if

	Title=dvHtmlEncode(Title)
'	Content=dvHtmlEncode(Content)
	Author=dvHtmlEncode(Author)
	if DateAndTime<>"" and IsDate(DateAndTime)=true then
		DateAndTime=Cdate(DateAndTime)
	else
		DateAndTime=now()
	end if
	if IsSelected="True" then
		IsSelected=True
	else
		IsSelected=false
	end if
	rs("Title")=Title
	rs("Content")=Content
	rs("Author")=Author
	rs("DateAndTime")=DateAndTime
	rs("IsSelected")=IsSelected
	rs("ChannelID")=ChannelID
	rs("ShowType")=ShowType
	rs.update
	rs.close
	set rs=nothing
	call CloseConn()
	response.redirect strFileName
end sub

sub SetNew()
	dim ID
	ID=Trim(Request("AnnounceID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定公告ID</li>"
		exit sub
	end if
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "Update Announce set IsSelected=True Where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "Update Announce set IsSelected=True Where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub

sub CancelNew()
	dim ID
	ID=Trim(Request("AnnounceID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定公告ID</li>"
		exit sub
	end if
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "Update Announce set IsSelected=False Where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "Update Announce set IsSelected=False Where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub

sub SetShowType()
	dim ID,ShowType
	ID=Trim(Request("AnnounceID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要移动的公告ID!</li>"
		exit sub
	end if
	ShowType=Trim(Request("ShowType"))
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "Update Announce set ShowType = "& ShowType & " where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "Update Announce set ShowType = "& ShowType & " where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub

sub MoveAnnounce()
	dim ID,MoveChannelID
	ID=Trim(Request("AnnounceID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要移动的公告ID!</li>"
		exit sub
	end if
	MoveChannelID=Trim(Request("ChannelID"))
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "Update Announce set ChannelID = "& MoveChannelID & " where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "Update Announce set ChannelID = "& MoveChannelID & " where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub

sub DelAnnounce()
	dim ID
	ID=Trim(Request("AnnounceID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要删除的公告ID!</li>"
		exit sub
	end if
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "delete from Announce where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "delete from Announce where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub


'=================================================
'过程名:sub ShowUbb()
'作  用:显示Ubb标签
'参  数:无
'=================================================
sub ShowUbb()
%>
<script language=JavaScript>
helpstat = false;
stprompt = true;
basic = false;
function thelp(swtch){
	if (swtch == 1){
		basic = false;
		stprompt = false;
		helpstat = true;

⌨️ 快捷键说明

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