📄 faction.asp
字号:
<!-- #include file="setup.asp" -->
<%
if Request.Cookies("username")=empty then error("<li>您还未<a href=login.asp>登录</a>社区")
id=int(Request("id"))
incept=HTMLEncode(Request("incept"))
username=HTMLEncode(Request("username"))
Honor=HTMLEncode(Request("Honor"))
sql="select * from [user] where username='"&Request.Cookies("username")&"'"
Set Rs=Conn.Execute(sql)
faction=rs("faction")
experience=rs("experience")
money=rs("money")
rs.close
top
if Request.form("menu")="factionadd" then
if faction<>"" then error2("您已经加入 "&faction&" 了,不能再加入其他帮派!")
factionname=Conn.Execute("Select factionname From faction where id="&id&"")(0)
if conn.execute("Select count(id) from [user] where faction='"&factionname&"'")(0)>99 then error2("该帮派已经超过100名会员,无法再加入新会员")
conn.execute("delete from [message] where id="&int(Request("messageid"))&" and incept='"&Request.Cookies("username")&"'")
conn.execute("update [user] set faction='"&factionname&"' where username='"&Request.Cookies("username")&"'")
error2("加入帮派成功")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="factionout" then
if ""&Request("sessionid")&""<>""&session.sessionid&"" then error("<li>效验码错误<li>请重新返回刷新后再试")
if faction=empty then error("<li>您目前没有加入任何帮派!")
If not conn.Execute("Select id From [faction] where buildman='"&Request.Cookies("username")&"'").eof Then error("<li>要退出请先解散帮派")
conn.execute("update [user] set faction='',honor='' where username='"&Request.Cookies("username")&"'")
message=message&"<li>退出帮派成功<li><a href=faction.asp>返回社区帮派</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=faction.asp>")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="invite" then
if username="" then error("<li>请填写受邀人的名称")
if Request.Cookies("username")=username then error("<li>不能自己邀请自己")
if Conn.Execute("Select buildman From [faction] where id="&id&"")(0)<>Request.Cookies("username") then error("<li>只有帮主才有权限执行该操作")
if conn.execute("Select count(id) from [user] where faction='"&faction&"'")(0)>99 then error2("帮派已经超过100名会员,无法再加入新会员")
if Conn.Execute("Select faction From [user] where username='"&username&"'")(0)<>"" then error("<li>对方已经加入了其他帮派")
messageid=conn.execute("select Max(ID)+1 From Message")(0)
conn.Execute("insert into [message] (author,incept,content) values ('"&Request.Cookies("username")&"','"&username&"','<form name=factionAdd"&messageid&" method=post action=faction.asp?id="&id&"&messageid="&messageid&"><input type=hidden name=menu value=factionadd></form><font color=0000FF>【系统消息】:"&Request.Cookies("username")&" 邀请您加入 "&faction&" 帮派<br><br><center><a href=javascript:factionAdd"&messageid&".submit()>同意</a> <a href=message.asp?menu=del&id="&messageid&">拒绝</a></font>')")
conn.execute("update [user] set newmessage=newmessage+1 where username='"&username&"'")
message=message&"<li>邀请已经成功发出<li><a href=faction.asp>返回社区帮派</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=faction.asp>")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="factiondel" then
if ""&Request("sessionid")&""<>""&session.sessionid&"" then error("<li>效验码错误<li>请重新返回刷新后再试")
if Conn.Execute("Select buildman From [faction] where id="&id&"")(0)<>Request.Cookies("username")then error("<li>只有帮主才有权限执行该操作")
conn.execute("update [user] set faction='',honor='' where faction='"&faction&"'")
conn.execute("delete from [faction] where id="&id&"")
message=message&"<li>解散帮派成功<li><a href=faction.asp>返回社区帮派</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=faction.asp>")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="factionUserOut" then
if ""&Request("sessionid")&""<>""&session.sessionid&"" then error("<li>效验码错误<li>请重新返回刷新后再试")
if Request.Cookies("username")=username then error("<li>不能自己开除自己")
if Conn.Execute("Select buildman From [faction] where id="&id&"")(0)<>Request.Cookies("username")then error("<li>只有帮主才有权限执行该操作")
conn.execute("update [user] set faction='',honor='' where username='"&username&"' and faction='"&faction&"'")
message=message&"<li>已经将 "&username&" 从帮派中开除了<li><a href=faction.asp>返回社区帮派</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=faction.asp>")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="factionUserHonor" then
if ""&Request("sessionid")&""<>""&session.sessionid&"" then error("<li>效验码错误<li>请重新返回刷新后再试")
if Len(Honor)>7 then error("<li>头衔长度不能超多7个字符")
if Conn.Execute("Select buildman From [faction] where id="&id&"")(0)<>Request.Cookies("username")then error("<li>只有帮主才有权限执行该操作")
conn.execute("update [user] set honor='"&Honor&"' where username='"&username&"' and faction='"&faction&"'")
message=message&"<li> "&username&" 已经获得 "&Honor&" 的头衔<li><a href=faction.asp>返回社区帮派</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=faction.asp>")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="addok" then
factionname=HTMLEncode(Request.Form("factionname"))
allname=HTMLEncode(Request.Form("allname"))
tenet=HTMLEncode(Request.Form("tenet"))
if faction<>empty then message=message&"<li>您已经加入了其他帮派!"
if experience< 10000 then message=message&"<li>您的经验值小于 10000 !"
if money< 10000 then message=message&"<li>您的金币少于 10000 !"
if factionname="" then message=message&"<li>帮派简称没有填写"
if Len(factionname)>7 then message=message&"<li>帮派简称最多7个字符"
if allname="" then message=message&"<li>帮派全称没有填写"
If not conn.Execute("Select id From [faction] where factionname='"&factionname&"' or buildman='"&Request.Cookies("username")&"'").eof Then message=message&"<li>社区中已存在同名帮派<li>您已经建立过帮派"
if message<>"" then error(""&message&"")
conn.Execute("insert into faction (factionname,allname,tenet,buildman) values ('"&factionname&"','"&allname&"','"&tenet&"','"&Request.Cookies("username")&"')")
conn.execute("update [user] set faction='"&factionname&"',[money]=[money]-10000 where username='"&Request.Cookies("username")&"'")
message=message&"<li>创建帮派成功<li><a href=faction.asp>返回社区帮派</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=faction.asp>")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="xiuok" then
allname=HTMLEncode(Request.Form("allname"))
tenet=HTMLEncode(Request.Form("tenet"))
if allname="" then message=message&"<li>帮派全称没有填写"
if message<>"" then error(""&message&"")
if Conn.Execute("Select buildman From [faction] where id="&id&"")(0)<>Request.Cookies("username")then error("<li>只有帮主才有权限执行该操作")
conn.execute("update [faction] set allname='"&allname&"',tenet='"&tenet&"' where id="&id&"")
message=message&"<li>修改帮派成功<li><a href=faction.asp>返回社区帮派</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=faction.asp>")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
elseif Request("menu")="look" then
sql="select * from faction where id="&id&""
Set Rs=Conn.Execute(sql)
%>
<table border=0 width=97% align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25> <img src=images/Forum_nav.gif> <%ClubTree%> →
<a href="faction.asp">社区帮派</a></td>
</tr>
</table><br>
<table width="82%" border="0" align="center" cellspacing="1" cellpadding="2" class=a2 height="150">
<tr bgcolor="FFFFFF">
<td width="15%">
<div align="center"><font color="000066"><b>帮派简称:</b></font></div>
</td>
<td width="82%"><%=rs("factionname")%></td>
</tr>
<tr bgcolor="FFFFFF">
<td width="15%">
<div align="center"><font color="000066"><b>帮派全称:</b></font></div>
</td>
<td width="82%"><%=rs("allname")%></td>
</tr>
<tr bgcolor="FFFFFF">
<td width="15%">
<div align="center"><font color="000066"><b>帮派公告:</b></font></div>
</td>
<td width="82%"><%=rs("tenet")%></td>
</tr>
<tr bgcolor="FFFFFF">
<td width="15%">
<div align="center"><font color="000066"><b>创建时间:</b></font></div>
</td>
<td width="82%"><%=rs("addtime")%></td>
</tr>
<tr bgcolor="FFFFFF">
<td width="15%">
<div align="center"><font color="000066"><b>帮主名称:</b></font></div>
</td>
<td width="82%"><%=rs("buildman")%></td>
</tr>
<tr bgcolor="FFFFFF">
<td width="15%">
<div align="center"><font color="000066"><b>现有会员:</b></font></div>
</td>
<td width="82%">
<%
sql="select username from [user] where faction='"&rs("factionname")&"'"
Set Rs=Conn.Execute(sql)
Do While Not RS.EOF
i=i+1
list=list&""&rs("username")&" "
RS.MoveNext
loop
%><%=i%>人</td>
</tr>
<tr bgcolor="FFFFFF">
<td width="15%">
<div align="center"><font color="000066"><b>会员名单:</b></font></div>
</td>
<td width="82%">
<%=list%>
</td>
</tr>
</table>
<br><center><INPUT onclick=history.back(-1) type=button value=" << 返 回 ">
<%
htmlend
end if
%>
<center>
<table border=0 width=97% align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25> <img src=images/Forum_nav.gif> <%ClubTree%> →
<a href="faction.asp">社区帮派</a></td>
</tr>
</table><br>
<%
if Request("menu")="add" then
%>
<form method=post name=form action=faction.asp?menu=addok>
<table cellspacing=1 cellpadding=2 width=442 border=0 align="center" class=a2>
<tr class=a1>
<td width=526 colspan="2" align="center" height="25">
创建门派</td>
</tr>
<tr class=a3>
<td width=187 align="right">
<b><font color="0033CC">帮派简称:</font></b></td>
<td width=339>
<input maxlength=7 name=factionname size="10"> 最多7个字符</td>
</tr>
<tr class=a3>
<td width=187>
<div align="right"><b><font color="0033CC">帮派全称: </font></b></div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -