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

📄 setgroup.php

📁 FTB安装版 v1.3(虚拟形象)FTB安装版 v1.3(虚拟形象)
💻 PHP
字号:
<?
require("global.php");
require("userdata/style.php");
require("header.php");echo"$headertp";
if (file_exists("bbsdata/group.php")) require("userdata/style.php");
else {
echo "门派文件不存在,请上传:bbsdata/group.php并改属性为777";
exit;
}
$check_user=0;
if ($login_status==1 && $username==$manager) $check_user=1;

if (file_exists("bbsdata/superadmin.php")) {
    include("bbsdata/superadmin.php");
    if ($superadmin && in_array($username,$superadmin)) {
    $check_user=1;}
  }
$useri=get_user_info($username);
if($useri[16]>=$group_rvrc*10 && $useri[24]>=$group_ofstar) $check_user=1;

$groupfile ="bbsdata/group.php";
$groups=explode("\n",readfromfile($groupfile));
$gcount=count($groups);
for($i=0;$i<$gcount;$i++){
$detail=explode("|",$groups[$i]);
if (($username==$detail[3]||$username==$detail[1]||$username==$manager||($superadmin && in_array($username,$superadmin))) && $id==$detail[2]) {
$check_user=1;
break;
}
}
if ($check_user==0) {
$status="您没有权利新建分堂!你不是管理员或者你的威望不足{$group_rvrc};金钱不足{$group_ofstar}!";
headguide("您正处在<br>{$bbs_title} <br>帮派管理",
"<a href=\"club.php\">俱乐部中心</a></a>",
"帮派管理","no");
print_err($status);
exit;
}

function print_err($status) {
$title="发生错误";
$content="管理程序发生了错误,情况:<br>
<br>$status<br><ul>
<li><a href=\"javascript:history.go(-1)\">返回</a></li>
</ul>";
msg_box($title,$content);
}

if ($action=="add") {
for($i=0;$i<$gcount;$i++){
$detail=explode("|",$groups[$i]);
if ($addgroup==$detail[0]) $error1="该分堂已经存在<br>";
if ($addgroup=="") $error1="你没有填写分堂名称<br>";
if ($username==$detail[3]||$username==$detail[1]) $error1="你已经是分堂<b>".$detail[0]."</b>的掌门或创始人了<br>";
}
if ($error1!="")
 {
print_err($error1);require("footer.php");echo"$footertp";exit;
}
if($groups[0]!=""){
$grouplist="";
for($i=0;$i<$gcount;$i++){
$grouplist.=$groups[$i]."\n";
}
$grouplist.=$addgroup."|".$username."|".$timestamp."|".$username."|1|".$timestamp."|".$addrvrc."|".$addofstar."|".$groupad."|".$addpermit."|".$username;
writetofile($groupfile,$grouplist);
}else{
$group=$addgroup."|".$username."|".$timestamp."|".$username."|1|".$timestamp."|".$addrvrc."|".$addofstar."|".$groupad."|".$addpermit."|".$username;
writetofile($groupfile,$group);
}

dtchange($username,-$group_rvrc,0,-$group_ofstar);
$useri=get_user_info($username);
$useri[27]=$addgroup;
$uu=implode('|',$useri);
writetofile("$userpath/$username.php",$uu);

		$reson=$groupad;
		if (file_exists("bbsdata/forumevent.php")) 
		$forumevent=explode("\n",readfromfile("bbsdata/forumevent.php"));
		else $forumevent[0]="";
		$articletitle=str_replace("|","|",$articletitle);
		$articletitle=str_replace("\n","",$articletitle);
		$reson=str_replace("|","|",$reson);
		$reson=str_replace("\n","",$reson);
		$newevent="创建分堂《".$addgroup."》||||$username|$reson|-$group_rvrc|-$group_ofstar|$timestamp|$username|\n";
		$forumevent=implode("\n",$forumevent);
		writetofile("bbsdata/forumevent.php",$newevent.$forumevent);

headguide("您正处在<br>{$bbs_title}<br>",
"<a href=\"club.php\">俱乐部中心</a>","no");
print <<<EOT
<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center bgcolor=$titlecolor>
 <tr>
 <td>
  <table width=100% border=0 cellspacing=1 cellpadding=3>
   <tr> 
    <td class=title   bgcolor=$titlecolor>欢迎来到俱乐部 / 帮派管理</td>
   </tr>
    <td bgcolor=$article_color1 valign=middle colspan=2>
    <font color=#333333><center><b>你已经成功地新建了一个分堂</b></center><br><br>
    <b>分堂信息</b><br><br>
    $tab_top
    <br>分堂名称:$addgroup
    <br>分堂ID:$timestamp
    <br>创 始 人:$username
    <br>掌 门 人:$username
    <br>分堂威望:$addrvrc </b>
    <br>分堂金钱:$addofstar </b>
    <br>分堂口号:$groupad </b>
    <br>加入分堂是否要经过掌门人同意(1为是,0为否):$addpermit </b>
<br>为了建立此分堂,你花去了威望:{$group_rvrc}点、金钱:{$group_ofstar}{$money_title}
    $tab_bottom
    <br><br><center><a href="setgroup.php?id=$timestamp">管理分堂</a>   <a href="group.php">查看所有分堂</a></center>
    </td></tr></td>
   </tr>
  </table>
 </td>
 </tr>
</table>
EOT;
require("footer.php");echo"$footertp";
  exit;
}

if ($action=="modify") {
$useri=get_user_info($username);
$grouplist="";
for($i=0;$i<$gcount;$i++){
$detail=explode("|",$groups[$i]);

if (($username==$detail[3]||$username==$detail[1]||$username==$manager||($superadmin && in_array($username,$superadmin))) && $id==$detail[2]) {
if($modgroup!=$oldname && $useri[24]<1000){
$error="你想修改分堂名字,但是金钱不够!请有了1000".$money_title."再来修改!";
print_err($error);require("footer.php");echo"$footertp";exit;
}
$groupmbr=explode(",",$detail[10]);
if(!in_array($groupadmin,$groupmbr)){
$error="你设定的新掌门人并没有加入你的门派,请他加入后再来修改!";
print_err($error);require("footer.php");echo"$footertp";exit;
}
$groups[$i]=$modgroup."|".$groupcs."|".$grouptime."|".$groupadmin."|".$groupnum."|".$timestamp."|".$modrvrc."|".$modofstar."|".$groupad."|".$modpermit."|".$groupmb;}
if($i==$gcount-1||$gcount==1) $grouplist.=$groups[$i];else $grouplist.=$groups[$i]."\n";
}
writetofile($groupfile,$grouplist);
if($modgroup!=$oldname) {$useri[24]=$useri[24]-1000;$qb=-1000;$msg="(你把门派名称由《".$oldname."》改为《".$modgroup."》,系统自己动扣除你金钱 1000 $money_title )";} else $qb=0;
$uu=implode('|',$useri);
writetofile("$userpath/$username.php",$uu);

		$reson=$groupad;
		if (file_exists("bbsdata/forumevent.php")) 
		$forumevent=explode("\n",readfromfile("bbsdata/forumevent.php"));
		else $forumevent[0]="";
		$articletitle=str_replace("|","|",$articletitle);
		$articletitle=str_replace("\n","",$articletitle);
		$reson=str_replace("|","|",$reson);
		$reson=str_replace("\n","",$reson);
		$newevent="修改分堂《".$modgroup."》||||$username|$reson|0|$qb|$timestamp|$username|\n";
		$forumevent=implode("\n",$forumevent);
		writetofile("bbsdata/forumevent.php",$newevent.$forumevent);

headguide("您正处在<br>{$bbs_title}<br>帮派管理",
"<a href=\"club.php\">俱乐部中心</a>",
"帮派管理","no");
print <<<EOT
<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center bgcolor=$bordercolor>
 <tr>
 <td>
  <table width=100% border=0 cellspacing=1 cellpadding=3>
   <tr> 
    <td class=title  bgcolor=$titlecolor>欢迎来到俱乐部 / 帮派管理</td>
   </tr>
    <td bgcolor=$article_color1 valign=middle colspan=2>
    <font color=#333333><center><b>你已经成功地修改了分堂</b></center><br><br>
    <b>分堂信息</b><br><br>
    $tab_top
    <br>分堂名称:$modgroup $msg
    <br>分堂ID:$grouptime
    <br>创 始 人:$groupcs
    <br>掌 门 人:$groupadmin
    <br>分堂威望:$modrvrc </b>
    <br>分堂金钱:$modofstar </b>
    <br>分堂口号:$groupad </b>
    <br>加入分堂是否要经过掌门人同意(1为是,0为否):$modpermit</b>
    $tab_bottom
    <br><br><center><a href="setgroup.php?id=$grouptime">管理分堂</a>   <a href="group.php">查看所有分堂</a></center>
    </td></tr></td>
   </tr>
  </table>
 </td>
 </tr>
</table>
EOT;
require("footer.php");echo"$footertp";
  exit;
}

if ($action=="del")
{
$delgroupofstar=$group_ofstar/5000;
$delgrouprvrc=$group_rvrc/50;
$grouplist="";
$isgroup=0;
for ($i=0;$i<$gcount;$i++)
{
$detail=explode("|",$groups[$i]);
if ($id==$detail[2]) {$groupcs=$detail[1];$delgroup=$detail[0];unset($groups[$i]);$isgroup=1;break;}
}
$grouplist=implode("\n",$groups);
if($isgroup){
writetofile($groupfile,$grouplist);
dtchange($groupcs,$delgrouprvrc,0,$delgroupofstar);
$msg="<font color=#333333><center><b>所有的信息已经保存</b></center><br>你已经成功的解散了分堂:".$delgroup."。作为补偿,我们还给分堂创始人 ".$groupcs." 威望:".$delgrouprvrc."点、金钱:".$delgroupofstar.$money_title;

		if (file_exists("bbsdata/forumevent.php")) 
		$forumevent=explode("\n",readfromfile("bbsdata/forumevent.php"));
		else $forumevent[0]="";
		$articletitle=str_replace("|","|",$articletitle);
		$articletitle=str_replace("\n","",$articletitle);
		$reson=str_replace("|","|",$reson);
		$reson=str_replace("\n","",$reson);
		$newevent="删除分堂《".$delgroup."》||||$groupcs||$delgrouprvrc|$delgroupofstar|$timestamp|$username|\n";
		$forumevent=implode("\n",$forumevent);
		writetofile("bbsdata/forumevent.php",$newevent.$forumevent);

}else{
$msg="<font color=#333333><center><b>你要删除的分堂不存在</b></center><br>
请按返回后刷新页面";
}

headguide("您正处在<br>{$bbs_title}<br>帮派管理",
"<a href=\"club.php\">俱乐部中心</a>",
"帮派管理","no");
print <<<EOT
<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center bgcolor=$titlecolor>
 <tr>
 <td>
  <table width=100% border=0 cellspacing=1 cellpadding=3>
   <tr> 
    <td class=title background=images/{$style_path}/title_back.gif color=$titlecolor>欢迎来到帮派管理</td>
   </tr><tr>
<td bgcolor=$article_color2 valign=middle colspan=2>{$msg}
<br>
<center><a href="club.php">返回俱乐部中心</a>   <a href="group.php">查看分堂信息</a></center>
</td></tr>
  </table>
 </td>
 </tr>
</table>
EOT;
require("footer.php");echo"$footertp";
exit;
}
headguide("您正处在<br>{$bbs_title}<br>帮派管理",
"<a href=\"club.php\">俱乐部中心</a>",
"帮派管理","no");

?>


<table width=<?=$tablewidth?> border=0 cellspacing=0 cellpadding=0 align=center bgcolor=<?=$bordercolor?>>
 <tr>
 <td>
  <table width=100% border=0 cellspacing=1 cellpadding=3>
   <tr bgcolor=$titlecolor>
    <td class=title  bgcolor=<?=$titlecolor?> height=22>
<b>帮派管理</b></td>
   </tr>
<tr>
<td bgcolor=<?=$article_color1?> valign=middle colspan=2>
<?
$havegroup=0;
for($i=0;$i<$gcount;$i++){
$detail=explode("|",$groups[$i]);
if (($username==$detail[3]||$username==$detail[1]||$username==$manager||($superadmin && in_array($username,$superadmin))) && $id==$detail[2] && $id!=""){
$havegroup=1;
break;
}
}
if($havegroup){
$yes="";$no="";
if($detail[9]==1) $yes="checked";else $no="checked";
?>
<form name="form1" method="post" action="setgroup.php">
<input type=hidden name="action" value="modify">
<input type=hidden name="id" value="<?=$id?>">
<input type=hidden name="oldname" value="<?=$detail[0]?>">
<font color=#000000>
<b>修改分堂信息(<a href=setgroup.php?action=del&id=<?=$id?> onclick="if(!confirm('真的要解散分堂吗?')) return false;">点击此处解散该分堂</a>)</b><br><br>
<?=$tab_top?>
分堂名字:<input name="modgroup" type="text" size="10" value=<?=$detail[0]?>>(修改名字需花金钱1000)<br>
分堂ID:<input name="grouptime" type="text" size="10" value=<?=$detail[2]?> readonly>(不可更改)<br>
创 始 人:<input type="text" name="groupcs" value=<?=$detail[1]?> readonly>(不可更改)<br>
创建时间:<input type="text" value=<?$time=getfulldate($detail[2]);echo $time;?> readonly>(不可更改)<br>
掌 门 人:<input name="groupadmin" type="text" size="10" value=<?=$detail[3]?>>(可以重新设定新掌门)<br>
成员总数:<input type="text" name="groupnum" value=<?=$detail[4]?> readonly>(不可更改)<br>
分堂成员:<textarea cols=60 rows=10 name="groupmb" readonly><?=$detail[10]?></textarea>(不可更改)<br>
分堂威望:<input name="modrvrc" type="text" size="3" maxlength="3" value=<?=$detail[6]?> readonly>(分堂成员的平均威望)<br>
分堂金钱:<input name="modofstar" type="text" size="4" maxlength="4" value=<?=$detail[7]?> readonly>(分堂成员的平均金钱)<br>
分堂口号:<input name="groupad" type="text" size="30" maxlength="200" value=<?=$detail[8]?>>(不要超过100个字)<br>
加入是否要经过掌门人同意:<INPUT type=radio value=1 name=modpermit <?=$yes?>>是 <INPUT type=radio value=0 <?=$no?> name=modpermit>否(暂时无此功能)<br>
<input type="submit" name="Submit" value="提交"> <input type="reset" name="Reset" value="重设"> <input type="button" name="ok" value="查看所有分堂" onclick="location.href='group.php'">
 </form>
<?
}else{
$grouprvrc=floor(($useri[16]/10-$group_rvrc)/10);
if($grouprvrc<1) $grouprvrc=1;
$groupofstar=floor(($useri[24]-$group_ofstar)/10);
if($groupofstar<10) $groupofstar=10;
?>
<form name="form1" method="post" action="setgroup.php">
<input type=hidden name="action" value="add">
<input type=hidden name="id" value="<?=$id?>">
<font color=#000000>
<b>输入分堂信息(创建分堂所需威望:<?=$group_rvrc?>,所需金钱:<?=$group_ofstar?>)</b><br><br>
<?=$tab_top?>
分堂名字:<input name="addgroup" type="text" size="10">(要想好哦,以后改名要钱的)<br>
分堂威望:<input name="addrvrc" type="text" size="3" maxlength="3" value=<?=$grouprvrc?> readonly>(你创建的分堂的初始威望,将随人数增多而且加大)<br>
分堂金钱:<input name="addofstar" type="text" size="4" maxlength="4" value=<?=$groupofstar?> readonly>(你创建的分堂的初始金钱,将随人数增多而且加大)<br>
分堂口号:<input name="groupad" type="text" size="30" maxlength="200" value=欢迎加入我们>(不要超过100个字)<br>
加入是否要经过掌门人同意:<INPUT type=radio value=1 name=addpermit>是 <INPUT type=radio value=0 checked name=addpermit>否<br>
<input type="submit" name="Submit" value="提交"><input type="reset" name="Reset" value="重设"><input type="button" name="ok" value="查看所有分堂" onclick="location.href='group.php'">
 </form>
<?}?>
<?=$tab_bottom?>
</font>
</td>
</tr>
  </table>
 </td>
 </tr>
</table>

<?
require("footer.php");echo"$footertp";
exit;
?>

⌨️ 快捷键说明

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