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

📄 faction.asp

📁 BBS源码 利用ASP的一个功能齐全的BBS论坛源码
💻 ASP
字号:
<!-- #include file="Inc.asp" -->
<!-- #include file="Inc/Page_Cls.asp" -->
<script language="JavaScript" type="text/JavaScript">
function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}
</script>
<%Dim ID,Rs
If Not BBS94KK.Founduser Then BBS94KK.GoToErr(10)
BBS94KK.Head("论坛帮派")
ID = BBS94KK.CheckNum(Request.querystring("ID"))
Select Case Request("Action")
Case"Add"
	Add
Case"Edit"
	Edit
Case"FactionAdd"
	FactionAdd
Case"FactionOut"
	FactionOut
Case"Look"
	Look
Case"Del"
	Del
Case Else
	Main()
End Select
BBS94KK.Footer
Set BBS94KK=Nothing

Sub Alert(message)
	message = replace(message,"'","\'")
	Response.Write ("<script LANGUAGE='javascript'>alert('" & message & "');window.location.href='Faction.Asp';</script>")
	Response.End
End Sub

Sub Main()
Dim intPageNow,strPageInfo,arr_Rs,i,Pages,page,Content
Content="<tr><td align='center' height=40 colspan=5><a href='?Action=Add'><img src='Images/right.gif' border='0' align='absmiddle'> 创建帮派</a>&nbsp;&nbsp;<a onclick=checkclick('确定要退出您现在所加入的帮派?\n\n您的积分将会减去1') href='?Action=FactionOut'><img src='Images/right.gif'  border='0' align='absmiddle'> 退出帮派</a></td></tr>"&_
"<tr bgcolor='#D6DFE4'><th width='15%' height='25'>派别</th><th width='40%'>宗旨</th><th width='15%'>创始人</th><th width='10%'>动作</th><th width='20%'>帮主管理</th></tr>"
	intPageNow = Request.QueryString("page")
	Set Pages = New Cls_PageView
	Pages.strTableName = "[KK_Faction]"
	Pages.strFieldsList = "ID,Name,Note,User,BuildDate"
	Pages.strOrderList = "ID desc"
	Pages.strPrimaryKey = "ID"
	Pages.intPageSize = 15
	Pages.intPageNow = intPageNow
	Pages.strCookiesName = "Faction"'客户端记录总数
	Pages.Reloadtime=3'每三分钟更新Cookies
	Pages.strPageVar = "page"
	Pages.InitClass
	Arr_Rs = Pages.arrRecordInfo
	strPageInfo = Pages.strPageInfo
	Set Pages = nothing
	If IsArray(Arr_Rs) Then
	For i = 0 to UBound(Arr_Rs, 2)
		Content=Content & "<tr><td align='center' height='25'><a href=?Action=Look&ID="&Arr_Rs(0,i)&">"&Arr_Rs(1,i)&"</a></td><td>"&Arr_Rs(2,i)&"</td><td align='center' height='25'><a href=UserInfo.asp?Name="&Arr_Rs(3,i)&">"&Arr_Rs(3,i)&"</a></td><td align='center'>"
		If BBS94KK.MyFaction=Arr_Rs(1,i) then
			Content=Content & "<a onclick='checkclick(""您确定要退出该帮派?\n\n您的积分将会减去 1"")' href='?Action=FactionOut&ID="&Arr_Rs(0,i)&"'>退出此帮</a>"
		Else
			Content=Content & "<a onclick='checkclick(""您确定要加入该帮派?\n\n您的积分必须达到 3"")' href='?Action=FactionAdd&ID="&Arr_Rs(0,i)&"'>加入此帮</a>"
		End if
		Content=Content & "<td align='center'><a href='?Action=Edit&ID="&Arr_Rs(0,i)&"'><img src='Images/edit.gif' border=0>修改</a> <a onclick='checkclick(""您确定要解散该帮派?"")' href='?Action=Del&ID="&Arr_Rs(0,i)&"'><img src='Images/Del.gif' border=0>解散</a></td></tr>"
	Next
	End If
	Content=Content & "<tr><td colspan=5>"&strPageInfo&"</td></tr>"
	Call BBS94KK.ShowTable("论坛帮派",Content)
End Sub

Sub FactionAdd
	Dim Content,Rs
	BBS94KK.Fun.CheckMake
	If BBS94KK.MyFaction<>"" Then
		Call Alert("您已经加入["&BBS94KK.MyFaction&"]了!请先退出["&BBS94KK.MyFaction&"]才能加入新帮")
	ElseIf Int(BBS94KK.MyMark)<3 then
		Call Alert("您的积分值小于3!没有资格加入帮派!")
	Else
		Set Rs=BBS94KK.Execute("select Name from [KK_Faction] where ID="&ID)
		IF Not Rs.Eof Then
			BBS94KK.Execute("update [KK_user] Set Faction='"&rs(0)&"' where Name='"&BBS94KK.MyName&"'")
			Session(BBS94KK.CacheName & "MyInfo") = Empty
			Call Alert("成功的加入 ["&Rs(0)&"] 帮派!")
		Else
			Call Alert("不存在这个帮派!")
		End If
		Rs.Close
	End If
End Sub

Sub FactionOut
	BBS94KK.Fun.CheckMake
	If BBS94KK.MyFaction="" Then
		Call Alert("您目前还没有加入任何帮派!")
	Else
		If Not BBS94KK.Execute("select ID from [KK_Faction] where user='"&BBS94KK.MyName&"'").eof Then
			Call Alert("您是掌门人,不能退出帮派!退出必需先要解散帮派!")
		Else
			BBS94KK.execute("Update [KK_user] Set Faction='',Mark=Mark-1 where name='"&BBS94KK.MyName&"'")
			Session(BBS94KK.CacheName & "MyInfo") = Empty
		End If
		Call Alert("退出帮派成功")
	End If
End Sub

Sub Del
BBS94KK.Fun.CheckMake
	Set Rs=BBS94KK.Execute("Select Name,User From[KK_Faction] where ID="&ID)
	If Rs.Eof Then
		Call Alert("不存在这个帮派!")
	ElseIf BBS94KK.MyName<>Rs(1) Then
		Call Alert("您不是该帮的帮主无法解散该帮!")
	Else
		BBS94KK.Execute("Update [KK_user] set Faction='' where Faction='"&rs(0)&"'")
		BBS94KK.Execute("Delete from [KK_Faction] where ID="&ID)
		Session(BBS94KK.CacheName & "MyInfo") = Empty
		Call Alert("解散帮派成功!")
	End if
	Rs.Close
End Sub

Sub Look
Dim Content
Set Rs=BBS94KK.Execute("Select Name,FullName,Note,User,BuildDate from [KK_Faction] where ID="&ID)
If Rs.eof Then
	Call Alert("不存在此帮派!")
Else
	Content="<tr><td width='24%' align='right' height=25><b>帮派名称:</b></td><td width='74%'>&nbsp;"&BBS94KK.Fun.HtmlCode(rs(0))&"</td></tr>"&_
	"<tr><td align='right' height=25><b>帮派全称:</b></td><td>&nbsp;"&BBS94KK.Fun.HtmlCode(rs(1))&"</td></tr>"&_
	"<tr><td align='right' height=25><b>帮派宗旨:</b></td><td>&nbsp;"&BBS94KK.Fun.HtmlCode(rs(2))&"</td></tr>"&_
	"<tr><td align='right' height=25><b>创建时间:</b></td><td>&nbsp;"&Rs(4)&"</td></tr>"&_
	"<tr><td align='right' height=25><b>帮主名称:</b></td><td>&nbsp;"&Rs(3)&"</td></tr>"&_
	"<tr><td align='right' height=25><b>现有弟子:</b></td><td>"&Desciple(Rs(0))&"</td></tr>"&_
	"<tr><td colspan=2 align='center' height=25><a href='?'>【返回】</a></td></tr>"
	Call BBS94KK.ShowTable("帮派信息",Content)
End If
Rs.Close
End Sub

Function Desciple(name)
	Dim dRs,I
	I=0
	Set dRs=BBS94KK.Execute("Select Name From [KK_user] where Faction='"&Name&"'")
	Do while not dRs.eof
	I=I+1
	Desciple=Desciple & "<a target='_blank' href='Userinfo.asp?Name="&dRs(0)&"'>"&dRs(0)&"</a>&nbsp;&nbsp;&nbsp;"
	dRs.movenext
	Loop
	dRs.close:Set dRs=NoThing
	Desciple="<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td>&nbsp;"&I&" 名</td><td width='90%'><marquee onmouseover='this.stop()' onmouseout='this.start()' scrollAmount='3' direction='left' width='100%' height='15'>"&Desciple&"</marquee></td></tr></table>"
End Function

Sub Add
Dim Name,FullName,Note,Content
BBS94KK.Fun.CheckMake
Name=BBS94KK.Fun.GetStr("Name")
FullName=BBS94KK.Fun.GetStr("FullName")
Note=BBS94KK.Fun.GetStr("Note")
IF Name="" And FullName="" And Note="" Then
	Content="<form  method='post' style='margin:0'>"&_
	"<tr><td colspan=2 height=30 align='center'><font color=red>创建门派的必要条件: 1.您的积分值必须 20 以上! 2.需要扣除您 10000 的现金作为门派基金! </font></td></tr>"&_
	"<tr><td align='right' height=25><b>帮派名称:</b></td><td>&nbsp;<input Maxlength=10 Name='Name' size='10'>*最多只能5个汉字</td></tr>"&_
	"<tr><td align='right' height=25><b>帮派全称:</b></td><td>&nbsp;<input size=30 name='FullName'> * </td></tr>"&_
	"<tr><td align='right' height=25><b>帮派宗旨:</b></td><td>&nbsp;<input size=70 name='Note'> * </td></tr>"&_
	"<tr><td colspan=2 height=30 align='center'><input type=submit value=' 创 建 '>&nbsp;&nbsp;&nbsp; <input type=reset value=' 重 填 '></td></tr></form>"
	Call BBS94KK.ShowTable("创建帮派",Content)
Else
	IF Name="" or FullName="" or Note="" Then
		Call Alert("帮派要填写的信息你没有填写完整。")
	ElseIF Len(Name)>10 or Len(FullName)>50 Or Len(Note)>200 Then
		Call Alert("字符太多,超过了论坛的限制。")
	ElseIf int(BBS94KK.MyMark)<20 then
		Call Alert("您的积分小于 20 !")
	ElseIf int(BBS94KK.MyCoin)<10000 then
		Call Alert("您的现金少于 10000 !")
	ElseIf Not BBS94KK.Execute("Select ID From[KK_Faction] where User='"&BBS94KK.MyName&"'").Eof Then
		Call Alert("您已经贵为帮主了,不能再创立帮派!")
	Else
	BBS94KK.execute("Insert into[KK_Faction](Name,FullName,[Note],BuildDate,[User])Values('"&Name&"','"&FullName&"','"&Note&"','"&BBS94KK.NowBbsTime&"','"&BBS94KK.MyName&"')")
	BBS94KK.execute("Update [KK_User] Set Coin=Coin-10000,Faction='"&Name&"' where Name='"&BBS94KK.MyName&"'")
	Session(BBS94KK.CacheName & "MyInfo") = Empty
	Call Alert("您成功的创建了帮派["&Name&"],您现在是该帮派的掌门人!恭喜您!")
	End if
End if
End Sub

Sub Edit
Dim Name,FullName,Note,Content
Name=BBS94KK.Fun.GetStr("Name")
FullName=BBS94KK.Fun.GetStr("FullName")
Note=BBS94KK.Fun.GetStr("Note")
Set Rs=BBS94KK.Execute("Select Name,FullName,Note,User from [KK_Faction] where ID="&ID)
If Rs.eof Then
	Call Alert("不存在此帮派!")
ElseIf BBS94KK.MyName<>Rs(3) Then
	Call Alert("您不是["&Rs(0)&"]的帮主无法修改信息!")
Else
	IF Name="" And FullName="" And Note="" Then
		Set Rs=BBS94KK.Execute("Select Name,FullName,Note,User from [KK_Faction] where ID="&ID)
		If Rs.eof Then
			Call Alert("不存在此帮派!")
		ElseIf BBS94KK.MyName<>Rs(3) Then
			Call Alert("您不是["&Rs(0)&"]的帮主无法修改信息!")
		Else
			Content="<form  method='post' style='margin:0'>"&_
			"<tr><td colspan=2 height=30 align='center'><font color=red>注意:每次修改帮派信息将扣除您 1000 的现金! </font></td></tr>"&_
			"<tr><td align='right' height=25><b>帮派名称:</b></td><td>&nbsp;<input Maxlength=10 Name='Name' size='10' value='"&Rs(0)&"'>*不要超过5个汉字</td></tr>"&_
			"<tr><td align='right' height=25><b>帮派全称:</b></td><td>&nbsp;<input size=30 name='FullName' value='"&Rs(1)&"'> * </td></tr>"&_
			"<tr><td align='right' height=25><b>帮派宗旨:</b></td><td>&nbsp;<input size=70 name='Note' value='"&Rs(2)&"'> * </td></tr>"&_
			"<tr><td colspan=2 height=30 align='center'><input type=submit value=' 修 改 '>&nbsp;&nbsp;&nbsp; <input type=reset value=' 重 填 '></td></tr></form>"
			Call BBS94KK.ShowTable("创建帮派",Content)
		End If
	Else
		IF Name="" or FullName="" or Note="" Then
			Call Alert("帮派要填写的信息你没有填写完整。")
		ElseIf int(BBS94KK.MyCoin)<1000 then
			Call Alert("对不起,你的现金少于1000元,不能整顿帮派。")
		ElseIF Len(Name)>10 or Len(FullName)>50 Or Len(Note)>200 Then
			Call Alert("字符太多,超过了论坛的限制。")
		Else
		BBS94KK.execute("Update [KK_Faction]Set Name='"&Name&"',FullName='"&FullName&"',[Note]='"&Note&"' where ID="&ID)
		BBS94KK.execute("Update [KK_User] Set Faction='"&Name&"' where Faction='"&Rs(0)&"'")
		BBS94KK.execute("Update [KK_User] Set Coin=Coin-1000 where Name='"&BBS94KK.MyName&"'")
		Session(BBS94KK.CacheName & "MyInfo") = Empty
		Call Alert("成功的修改了帮派!")
		End if
	End if
End If
Rs.Close
End Sub
%>

⌨️ 快捷键说明

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