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

📄 placard.asp

📁 BBS源码 利用ASP的一个功能齐全的BBS论坛源码
💻 ASP
字号:
<!--#include file="Inc.asp"-->
<!--#include file="Inc/Page_Cls.asp"-->
<%
Dim Action,ID
Action=Lcase(Request.querystring("Action"))
ID=BBS94KK.Checknum(request.querystring("ID"))
Select Case Action
Case"edit"
	EditPlacard()	
Case"del"
	IF BBS94KK.MyAdmin<>1 And BBS94KK.MyAdmin<>2 And BBS94KK.MyAdmin<>3 Then BBS94KK.GoToErr(44)
	IF BBS94KK.MyAdmin=3 Then
		BBS94KK.execute("Delete From [KK_Placard] where ID="&ID&" and Name='"&BBS94KK.MyName&"'")
	Else
		BBS94KK.execute("Delete From [KK_Placard] where ID="&ID&"")
	End IF
	Cache.Name="Placard"
	Cache.clean()
	Response.redirect Request.ServerVariables("HTTP_REFERER")
Case Else
	SayPlacard()
End Select
BBS94KK.Footer()
Set BBS94KK=Nothing
Sub DelMyPlacard()
	Dim Caption,Content,rs
	Set Rs=BBS94KK.execute("select ID,Caption,Content,AddTime,Name,hits from [KK_Placard] where Name='"&BBS94KK.MyName&"'")
	IF Not rs.eof Then
		Caption="我发布的公告"
		Do while not Rs.eof
		Content=Content&"<tr><td><a href=javascript: onclick=javascript:window.open('See.asp?Id="&Rs("ID")&"','open','width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes')>"&BBS94KK.Fun.HtmlCode(Rs("caption"))&"</td><td>发表于:"&Rs("Addtime")&"<br></td><td><a onclick=checkclick('删除这条公告!!\n\n您确定要删除吗?') href='?Action=del&ID="&Rs("ID")&"'><img src='pic/del.gif' border='0'>删除</a></td></tr>"
		Rs.movenext
		Loop
		Call BBS94KK.ShowTable(Caption,Content)
	End IF
	Rs.Close
End Sub
Sub EditPlacard()
	Dim Caption,Content,Temp,Rs,TmpBoardID
	IF BBS94KK.MyAdmin<>1 And BBS94KK.MyAdmin<>2 Then BBS94KK.GoToErr(44)
	If BBS94KK.BoardID>0 Then
		BBS94KK.CheckBoard()
	End If
	Call BBS94KK.Head("管理公告")
	Caption=BBS94KK.Fun.Checkbad(BBS94KK.Fun.GetStr("caption"))
	Content=BBS94KK.Fun.Checkbad(BBS94KK.Fun.GetStr("Content"))
	IF Caption="" And Content="" Then
		Set Rs=BBS94KK.execute("select ID,BoardID,Caption,Content,AddTime,Name,hits from [KK_Placard] where ID="&ID&"")
		IF Not rs.eof Then
			Caption="编辑公告"
			Content="<form style='margin: 0' method=POST name=kk><tr><td height='30'>&nbsp;&nbsp;公告标题:</td><td>&nbsp;<input name='ID' type='hidden' value='"&Rs("ID")&"'><input name='Caption' type='text' id='Caption' size='60' Value='"&Rs("Caption")&"'></td></tr>"&_
				"<tr><td height='30'>&nbsp;&nbsp;所在版块:</td><td>&nbsp;"
			Content=Content & "<select name='BoardID'><option value='0'>论坛首页</option>"&BBS94KK.BoardIDList(Rs("BoardID"),0)&"</select>"
			Content=Content&"</td></tr><tr><td >&nbsp;&nbsp;公告内容:</td><td><table width='100%'><tr><td><img onClick=Cbold() <img src=""Pic/Ubb/U_1.gif""  border=0 alt=粗体字> <img src=""Pic/Ubb/U_2.gif"" onClick=Citalic() border=0 alt=斜体字 > <img src=""Pic/Ubb/U_3.gif"" onClick=Cunder() border=0 alt=下划线> <img src=""Pic/Ubb/U_4.gif"" onClick=center() border='0' alt='居中'> <img src=""Pic/Ubb/U_5.gif"" onClick=fly() border=0 alt=飞行字> <img src=""Pic/Ubb/U_6.gif"" onClick=move() border=0 alt=移动字> <img src=""Pic/Ubb/U_7.gif"" onClick=Insert(""[light]内容[/light]"") border=0 alt=发光字> <img src=""Pic/Ubb/U_8.gif"" onClick=ying() border=0 alt=阴影字> "&_
			"<img src=""Pic/Ubb/U_9.gif"" onClick=Curl() border='0' alt='超连接'> <img src=""Pic/Ubb/U_10.gif"" onClick=Cemail() border='0' alt='Email连接'> <img src=""Pic/Ubb/U_11.gif"" onClick=showpic() border='0' alt='更多的心情图片'> <img src=""Pic/Ubb/U_12.gif"" onClick=image() border=0 alt=图片> <img src=""Pic/Ubb/U_13.gif"" onClick=swf() border=0 alt=Flash动画 > <img onClick=Cwmv()  src=""Pic/Ubb/U_14.gif"" border=0 alt='Media Player视频文件'> <img src=""Pic/Ubb/U_15.gif"" onClick=Crm() border=0 alt=realplay视频文件>  <img onClick=Csound() src=""Pic/Ubb/U_16.gif"" border='0' alt='插入背景音乐'>"&_
			"<TEXTAREA name=content  cols=90 rows='8' style='PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px;WIDTH: 100%;' onkeydown=presskey();>"&Rs("content")&"</textarea></td><td valign='top' width='30%'><br><br><input type='button' style='BACKGROUND: url(pic/plus.gif); width:20;height:20;border:0;cursor:hand' onclick='textarea_Size(3,this.form.Content)' ><br><br><input type='button' style='BACKGROUND: url(pic/minus.gif); width:20;height:20;border:0;cursor:hand' onclick='textarea_Size(-3,this.form.Content)'></td></tr></Table></td></tr>"
			Content=Content&"<tr><td  height='30' colspan=2 align='center'> <input  type='submit' value='确定修改'>&nbsp;<input type='reset' value='取消重置'><div id='MaoDiv' style='position: absolute; width:570px; height:160px; display:none;'><iframe id='MView' name='MView' src='about:blank' frameborder='0' scrolling='no' valign='top' width='100%' height='100%'></iframe></div></form>"
		Else
			Caption="错误信息":Content="不存在公告记录!"
		End If
	Else
		ID=BBS94KK.Fun.GetStr("ID")
		TmpBoardID=BBS94KK.Fun.GetStr("BoardID")
		If Caption="" or Content="" Then BBS94KK.GoToErr(26)
		IF len(Content)>30720 or Len(Caption)>250 Then BBS94KK.GoToErr(18)
		Temp=BBS94KK.Fun.UbbString(Content)
		BBS94KK.execute("update [KK_Placard] Set Caption='"&Caption&"',Content='"&Content&"',AddTime='"&BBS94KK.NowBBSTime&"',ubbString='"&Temp&"',BoardID="&TmpBoardID&" where ID="&ID&"")
		Caption="编辑公告"
		Content="<li>公告修改成功!<li><a href=placard.asp>继续管理公告</a> <li><a href=Index.asp>返回论坛首页</a> "
		IF BBS94KK.BoardID>0 Then Content=Content&"<li><a href=List.asp?BoardID="&BBS94KK.BoardID&">"&BBS94KK.BoardName&"</a>"
		Content="<div style='margin:15;line-height: 150%'>"&Content&"</div>"
	End If
	Cache.Name="Placard"
	Cache.clean()
	Call BBS94KK.ShowTable(Caption,Content)
End Sub
Sub SayPlacard()
	Dim Caption,Content,Temp,TmpBoardID
	IF BBS94KK.MyAdmin<>1 And BBS94KK.MyAdmin<>2 And BBS94KK.MyAdmin<>3 Then BBS94KK.GoToErr(44)
	If BBS94KK.BoardID>0 Then BBS94KK.CheckBoard()
	IF BBS94KK.MyAdmin=3 And BBS94KK.IsBoardAdmin=False  Then BBS94KK.GoToErr(44)
	Call BBS94KK.Head("发布公告")
	Caption=BBS94KK.Fun.Checkbad(BBS94KK.Fun.GetStr("caption"))
	Content=BBS94KK.Fun.Checkbad(BBS94KK.Fun.GetStr("Content"))
	IF Caption="" And Content="" Then
		Caption="发布公告"
		Content="<form style='margin: 0' method=POST name=kk><tr><td height='30'>&nbsp;&nbsp;公告标题:</td><td>&nbsp;<input name='Caption' type='text' id='Caption' size='60'></td></tr>"&_
		"<tr><td height='30'>&nbsp;&nbsp;所在版块:</td><td>&nbsp;"
		IF BBS94KK.MyAdmin=3 Then
			Content=Content&BBS94KK.BoardName&"<input name='BoardID' value='"&BBS94KK.BoardID&"' type='hidden'>"
		Else
			Content=Content & "<select name='BoardID'><option value='0'>论坛首页</option>"&BBS94KK.BoardIDList(BBS94KK.BoardID,0)&"</select>"
		End If		
		Content=Content&"</td></tr><tr><td >&nbsp;&nbsp;公告内容:</td><td><table width='100%'><tr><td><img onClick=Cbold() <img src=""Pic/Ubb/U_1.gif""  border=0 alt=粗体字> <img src=""Pic/Ubb/U_2.gif"" onClick=Citalic() border=0 alt=斜体字 > <img src=""Pic/Ubb/U_3.gif"" onClick=Cunder() border=0 alt=下划线> <img src=""Pic/Ubb/U_4.gif"" onClick=center() border='0' alt='居中'> <img src=""Pic/Ubb/U_5.gif"" onClick=fly() border=0 alt=飞行字> <img src=""Pic/Ubb/U_6.gif"" onClick=move() border=0 alt=移动字> <img src=""Pic/Ubb/U_7.gif"" onClick=Insert(""[light]内容[/light]"") border=0 alt=发光字> <img src=""Pic/Ubb/U_8.gif"" onClick=ying() border=0 alt=阴影字> "&_
		"<img src=""Pic/Ubb/U_9.gif"" onClick=Curl() border='0' alt='超连接'> <img src=""Pic/Ubb/U_10.gif"" onClick=Cemail() border='0' alt='Email连接'> <img src=""Pic/Ubb/U_11.gif"" onClick=showpic() border='0' alt='更多的心情图片'> <img src=""Pic/Ubb/U_12.gif"" onClick=image() border=0 alt=图片> <img src=""Pic/Ubb/U_13.gif"" onClick=swf() border=0 alt=Flash动画 > <img onClick=Cwmv()  src=""Pic/Ubb/U_14.gif"" border=0 alt='Media Player视频文件'> <img src=""Pic/Ubb/U_15.gif"" onClick=Crm() border=0 alt=realplay视频文件>  <img onClick=Csound() src=""Pic/Ubb/U_16.gif"" border='0' alt='插入背景音乐'>"&_
		"<TEXTAREA name=content  cols=90 rows='8' style='PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px;WIDTH: 100%;' onkeydown=presskey();></textarea></td><td valign='top' width='30%'><br><br><input type='button' style='BACKGROUND: url(Images/plus.gif); width:20;height:20;border:0;cursor:hand' onclick='textarea_Size(3,this.form.content)' ><br><br><input type='button' style='BACKGROUND: url(Images/minus.gif); width:20;height:20;border:0;cursor:hand' onclick='textarea_Size(-3,this.form.content)'></td></tr></Table></td></tr>"
		Content=Content&"<tr><td  height='30' colspan=2 align='center'> <input  type='submit' value='确定发布'>&nbsp;<input type='reset' value='取消重写'><div id='MaoDiv' style='position: absolute; width:570px; height:160px; display:none;'><iframe id='MView' name='MView' src='about:blank' frameborder='0' scrolling='no' valign='top' width='100%' height='100%'></iframe></div></form>"
		Call BBS94KK.ShowTable(Caption,Content)
		If BBS94KK.MyAdmin=1 or BBS94KK.MyAdmin=2 Then AdminPlacard() Else DelmyPlacard()
	Else
		If Caption="" or Content="" Then BBS94KK.GoToErr(26)
		TmpBoardID=BBS94KK.Fun.GetStr("BoardID")
		IF len(Content)>30720 or Len(Caption)>250 Then BBS94KK.GoToErr(18)
		Temp=BBS94KK.Fun.UbbString(Content)
		BBS94KK.execute("insert into[KK_Placard](Caption,Content,AddTime,Name,BoardID,UbbString)values('"&Caption&"','"&Content&"','"&BBS94KK.NowBbsTime&"','"&BBS94KK.MyName&"',"&TmpBoardID&",'"&Temp&"')")
		Caption="发布公告"
		Content="<li>公告发布成功! <li><a href=Index.asp>返回首页</a> "
		IF BBS94KK.BoardID>0 Then Content=Content&"<li><a href=List.asp?BoardID="&BBS94KK.BoardID&">"&BBS94KK.BoardName&"</a>"
		Content="<div style='margin:15;line-height: 150%'>"&Content&"</div>"
		Cache.Name="Placard"
		Cache.clean()
		Call BBS94KK.ShowTable(Caption,Content)
	End If
End Sub

Function GetBoardName(Ast)
	Dim i
	If IsArray(BBS94KK.Board_Rs) Then
		For i=0 To Ubound(BBS94KK.Board_Rs,2)
		IF BBS94KK.Board_Rs(1,i)=Ast Then
			GetBoardName=BBS94KK.Board_Rs(3,i)
			Exit For
		End IF
		Next
	End If
	If GetBoardName="" Then GetBoardName="首页"
End Function

Sub AdminPlacard()
	Dim Pages,Page,arr_Rs,i,Temp,Content,PageInfo
	Temp=BBS94KK.Template.ReadTemplate("各项列表顶部")
	Temp=Replace(Temp,"{标题}","公告列表" )
	Response.Write Temp
	Page = Request.QueryString("page")
	Set pages = New Cls_PageView
	pages.strTableName = "[KK_Placard]"
	pages.strPageUrl = "?Action="&Action
	pages.strFieldsList = "ID,Caption,BoardID,Name,AddTime,hits"
	pages.strPrimaryKey ="ID"
	pages.strOrderList = "BoardID,ID desc"
	pages.intPageSize = 30
	pages.intPageNow = Page
	pages.strCookiesName = "Placard_List"'客户端记录总数
	pages.Reloadtime=3'每三分钟更新Cookies
	pages.strPageVar = "page"
	pages.InitClass
	Arr_Rs = pages.arrRecordInfo
	PageInfo = pages.strPageInfo
	page=pages.intPageNow
	Set pages = nothing
	Content="<tr bgcolor='#E4E4E4'><td width='35%' align='center' height=25 bgcolor='#E4E4E4'><b>公告标题</b></td><td width='15%' align='center'><b>所在版块</b></td><td width='10%' align='center'><b>作者</b></td><td width='20%' align='center'><b>时间</b></td><td width='20%' align='center'><b>管理</b></td></tr>"
	If IsArray(Arr_Rs) Then
		For i = 0 to UBound(Arr_Rs, 2)
		Content=Content&"<tr><td height=25>&nbsp;<a href=javascript: onclick=javascript:window.open('See.asp?Action=placard&ID="&Arr_Rs(0,i)&"','','width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes')>"&BBS94KK.Fun.HtmlCode(Arr_Rs(1,i))&"</td><td align='center'>"&GetBoardName(Arr_Rs(2,i))&"</td><td align='center'>"&Arr_Rs(3,i)&"</td><td align='center'>"&Arr_Rs(4,i)&"</td><td align='center'><a href='?Action=Edit&ID="&Arr_Rs(0,i)&"'><img src='Images/Edit.gif' border='0'>修改</a> <a onclick=checkclick('删除这条公告!!\n\n您确定要删除吗?') href='?Action=del&ID="&Arr_Rs(0,i)&"'><img src='Images/del.gif' border='0'>删除</a></td></tr>"
		Next
	End If
	Response.Write Content
	Temp=BBS94KK.Template.ReadTemplate("各项列表底部")
	Temp=Replace(Temp,"{分页}",PageInfo)
	Response.Write Temp
End Sub
%>
<SCRIPT language="JavaScript" src="inc/Fun.js"></SCRIPT>

⌨️ 快捷键说明

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