📄 getmg.php
字号:
list($nouse,$thiscount)=explode("_",$temp[3]);
if ($thiscount>$filecount) $filecount=$thiscount;
}
$filecount++;
while (file_exists("userdata/getmg/f_$filecount")) $filecount++;
return("f_$filecount");
}
//----push the Held Topics to the beginning of the list------
function push_heldtopic($list) {
$list=explode("\n",$list,12);
$count=count($list);
for ($i=0; $i<$count-1; $i++) {
$detail = explode("|",$list[$i]);
if ($detail[10] > 2) {
$held_topics[]=$list[$i];
unset($list[$i]);
}}
if ($held_topics) $list= implode("\n",$held_topics)."\n".implode("\n",$list);
else $list=implode("\n",$list);
return $list;
}
if ($job=="list") {
global $ftbConfig,$sysleConfig;
require("header.php");echo"$headertp";
headguide('你现在正在<b>'.$ftbConfig['bbs_title'].'</b><br>的版主申请程式中','版主申请表','','no');
$perpage=15;//每页显示记录
?>
<table cellspacing=1 cellpadding=0 width=<?=$tablewidth?> bgcolor=<?=$bordercolor?> border=0 align=center>
<tr align=center height=24>
<td <?=$titlecolor?> width=10% class=title>申请人</td>
<td <?=$titlecolor?> width=15% class=title>来源地</td>
<td <?=$titlecolor?> width=10% class=title>申请版块</td>
<td <?=$titlecolor?> width=15% class=title>申请表</td>
<td <?=$titlecolor?> width=15% class=title>申请时间</td>
<td <?=$titlecolor?> width=5% class=title>支持度</td>
<td <?=$titlecolor?> width=5% class=title>反对度</td>
<td <?=$titlecolor?> width=10% class=title>管理员批核</td>
</tr>
<?
showform();
?>
<tr> <td colspan=4 height=24 align=left <?=$titlecolor?> class=title>
<input type="button" value="论坛首页"
onClick="location.href='index.php'"
style="color: #000000; background-color: #f3f3f3; border-style: solid; border-width: 1" onMouseOver ="this.style.backgroundColor='#FFFFFF'" onMouseOut ="this.style.backgroundColor='#f3f3f3'" name="button">
<input type="button" value="返回前页"
onClick="location.href='javascript:history.back(1)';"
style="color: #000000; background-color: #f3f3f3; border-style: solid; border-width: 1" onMouseOver ="this.style.backgroundColor='#FFFFFF'" onMouseOut ="this.style.backgroundColor='#f3f3f3'" name="button2">
<?
if ($maxpageno==1) echo "<b>申请表列表只有一页,共 $form_count 条记录</b>";
else {
if($page<5) $ib=1;else $ib=$page-4;
if($page<$maxpageno-5) $ie=$page+4;else $ie=$maxpageno;
$multi_page_bar=" <b>申请表列表有 $maxpageno 页,每页 $perpage 条,共 $form_count 条记录</b> [ ";
if($page>5) $multi_page_bar.="<a style='color:green' href=\"getmg.php?page=1\"><b>1</b></a> ...";
for ($i=$ib; $i<=$ie; $i++) {
if ($i!=$page)
$multi_page_bar.=" <a href=\"getmg.php?page=$i\"><b>$i</b></a> ";
else $multi_page_bar.="<b> <font color=red>$i</font><b>";
}
if($page<$maxpageno-5) $multi_page_bar.=" ... <a style='color:green' href=\"getmg.php?page=$maxpageno\">$maxpageno</a>";
$multi_page_bar.=" 页]</b> ";
echo $multi_page_bar;}
?>
<td align=right valign=top colspan=4 bgcolor=<?=$titlecolor?> class=title>
<FORM action=getmg.php method=get>
<b>我也要申请:</b><select name=forumid id=forumid onchange="if(this.options[this.selectedIndex].value != '') {
window.location=(this.options[this.selectedIndex].value) }">
<option value="" selected>请选择版块
<script language=JavaScript>
<!--
function menu(){
var URL = document.jump.jumpto.options[document.jump.jumpto.selectedIndex].value;
top.location.href = URL; target = '_self';
}
// -->
</script>
<?
if (file_exists("bbsdata/forumdata.php")) {
$forumdata=file("bbsdata/forumdata.php");
$count=count($forumlist)-1;
for ($i=0; $i<=$count; $i++) {
$forum_info=explode("|",$forumlist[$i]);
if ($forum_info[0]!="category") {
if ($forum_info[4]==0 || $forum_info[4]=="") { echo "<OPTION target=_self value=\"getmg.php?job=new&forumid=$forum_info[3]\">$forum_info[1] </option>";}
else echo "<OPTION target=_self value=\"getmg.php?job=new&forumid=$forum_info[3]\"> |- $forum_info[1] </option>";}
}}
?>
</option></select><b>版主</b>
</td></form>
</tr>
</table>
<br>
<?
require("footer.php");echo"$footertp";}
?>
<?
function getforumname1($forumid){
$flist=file("bbsdata/forumdata.php");
$c=count($flist);
for ($k=0; $k<$c; $k++) {
$d=explode("|", trim($flist[$k]));
if ($d[3]==$forumid) {
return $d[1];
break; }}
return "无此版块";}
function showform() {
global $forumid,$page,$perpage,$maxpageno,$form_count,$ftbConfig,$manager,$superadmin,$username,$login_status,$forumcolorone,$forumcolortwo;
if (file_exists('userdata/getmg/list.php'))
$form_array=explode("\n",readfromfile('userdata/getmg/list.php'));
$count=count($form_array);
for ($i=0;$i<$count;$i++){
$detail=explode("|",$form_array[$i]);
if(($detail[0]==$forumid||empty($forumid))&&($form_array[$i]!="")) {$former_array[]=$form_array[$i];}}
$form_count=count($former_array);
if ($form_count%$perpage==0) $maxpageno=$form_count/$perpage;
else $maxpageno=floor($form_count/$perpage)+1;
if($page=="") $page=1;
if ($page>$maxpageno) $page=$maxpageno;
if(!ereg("^[0-9]*$",$page)) $page=1;
$pagemin=min( ($page-1)*$perpage , $form_count-1);
$pagemax=min( $pagemin+$perpage-1, $form_count-1);
if($form_count==0) {$pagemin=1;$pagemax=0;$maxpageno=1;}
for ($i=$pagemin; $i<=$pagemax; $i++) {
list($forumid,$user_name,$formtime,$filename,$ip)=explode("|",$former_array[$i]);
$time=date("Y-m-d h:m:s",$formtime);
get_forum_info();
$title="<a href='getmg.php?job=show&filename=$filename'>进入浏览申请表</a>";
if (file_exists("userdata/getmg/$filename")) {
list($user,$forum,$city,$work,$useremail,$qq,$times,$ismod,$activeforum,$reason,$forumtopic,$howtodo,$forumbest,$suggest,$asktime,$yes,$no,$ok)
= explode("|",readfromfile("userdata/getmg/$filename"));}
$forum_name=getforumname1($forumid);
$p_admin==0; $d_admin=0;
if($login_status==1 && $username==$manager) { $p_admin=1; $d_admin=1;}
if (file_exists("bbsdata/superadmin.php")) {
include("bbsdata/superadmin.php");
if ($login_status==1 && $superadmin && in_array($username,$superadmin)) {$p_admin=1; $d_admin=1;}}
if($login_status==1 && $username=="$user") {$d_admin=1;}
if ($p_admin ==1) {
$admpass="[<a href=getmg.php?job=pass&forumid=$forumid&filename=$filename&userid=$user_name>同意上任</a>]";}
else {$admpass="";}
if($ok =="") {$checked="待审核";}
else {$checked="<font color=red>已经通过审批</font><br>操作人:$ok "; $admpass="";}
if ($d_admin ==1) {
$deled="<a href=getmg.php?job=del&filename=$filename&fid=$i title=删除该申请表>[删除]</a>";
}else {$deled="";}
$ipfrom=convert_ip($ip);
if ($d_admin ==1) {$ip="$ip";}else {$ip="已经设置了保密"; }
$yeslist=explode(",",$yes);
$yescount=count($yeslist)-2;
$nolist=explode(",",$no);
$nocount=count($nolist)-1;
if($yes=="") $yescount=0;
if($no=="") $nocount=0;
echo '<tr height=22 bgcolor=$forumcolorone>';
echo "<td bgcolor=$forumcolorone align=center><a href='profile.php?job=show&target=$user_name' title=查看{$user_name}资料>$user_name</a> </td>";
echo "<td bgcolor=$forumcolorone align=center><a title='$ip'>$ip</a></td>";
echo "<td bgcolor=$forumcolortwo align=center><a href='thread.php?forumid=$forumid' title=进入$forum_name>$forum_name</a></td>";
echo "<td bgcolor=$forumcolorone align=center>$title $deled</td>";
echo "<td bgcolor=$forumcolortwo align=center>$time</td>";
echo "<td bgcolor=$forumcolorone align=center><font color=blue>$yescount</font></td>";
echo "<td bgcolor=$forumcolortwo align=center><font color=red>$nocount</font></td>";
echo "<td bgcolor=$forumcolorone align=center>$checked <br>$admpass</td>";
echo '</tr>'; }}
function makeyes() {
global $userpath,$msgpath,$login_status,$ftbConfig,$action,$username,$filename,$superadmin,$manager;
if (file_exists("userdata/getmg/$filename")) {
$useri=explode("|",readfromfile("userdata/getmg/$filename")); }
$check_user=0;
$yeslist=explode(",",$useri[15]);//已经添加
$count1=count($yeslist);
for ($y=0; $y<$count1; $y++) {
if ($login_status==1 && $yeslist[$y]==$username) $check_user=1;}
$nolist=explode(",",$useri[16]);//已经添加
$count2=count($nolist);
for ($n=0; $n<$count2; $n++) {
if ($login_status==1 && $nolist[$n]==$username) $check_user=1;}
if ($check_user==1){
require("header.php");echo"$headertp";
headguide('你现在正在<b>'.$ftbConfig['bbs_title'].'</b><br>的版主申请程式中','版主申请表','','no');
msg_box('对不起!!','<center>你已经参加了投票了,请不要再投!!<br><ul><li><a href="javascript:history.back(1)">返回前页</a></li><br><li><a href="index.php">返回首页</li></ul></center>');
require("footer.php");echo"$footertp";
exit;}
if ($useri[15]=="") {
$u=""; $u=$username.",";
}else{ $u=$username.","; }
$useri[15]=$useri[15].$u;
$uu=implode('|',$useri);
writetofile("userdata/getmg/$filename",$uu);
jump_page("getmg.php","投票成功",
"<br>成功投了一票。<br><br>现在返回申请表列表.<br><br>");}
function postmsg($user,$title,$pmsg,$name="系统信息"){
global $userpath,$msgpath,$timestamp;
if (file_exists("userdata/$msgpath/{$user}1.php")) $msg=file("userdata/$msgpath/{$user}1.php"); else $msg[0]="";
$new="<?die;?>|$name|$title|$timestamp|$pmsg|0|\n";
$old=implode("",$msg);
if (file_exists("$userpath/$user.php")&&$user!="."&&$user!=".."&&$user!="") writetofile("userdata/$msgpath/{user}1.php",$new.$old);
}
function makeno() {
global $userpath,$login_status,$ftbConfig,$action,$username,$filename,$superadmin,$manager;
if (file_exists("userdata/getmg/$filename")) {
$useri=explode("|",readfromfile("userdata/getmg/$filename")); }
$check_user=0;
$yeslist=explode(",",$useri[15]);//已经添加
$count1=count($yeslist);
for ($y=0; $y<$count1; $y++) {
if ($login_status==1 && $yeslist[$y]==$username) $check_user=1;}
$nolist=explode(",",$useri[16]);//已经添加
$count2=count($nolist);
for ($n=0; $n<$count2; $n++) {
if ($login_status==1 && $nolist[$n]==$username) $check_user=1;}
if ($check_user==1){
require("header.php");echo"$headertp";
headguide('你现在正在<b>'.$ftbConfig['bbs_title'].'</b><br>的版主申请程式中','版主申请表','','no');
msg_box('对不起!!','<center>你已经参加了投票了,请不要再投!!<br><ul><li><a href="javascript:history.back(1)">返回前页</a></li><br><li><a href="index.php">返回首页</li></ul></center>');
require("footer.php");echo"$footertp";
exit;}
if ($useri[16]=="") {
$u=""; $u=$username.",";
}else{ $u=$username.","; }
$useri[16]=$useri[16].$u;
$uu=implode('|',$useri);
writetofile("userdata/getmg/$filename",$uu);
jump_page("getmg.php","投票成功",
"<br>成功投了一票。<br><br>现在返回申请表列表.<br><br>");
}
$adminfile="bbsdata/admin.php";
if ($job=="pass")
{
if ($login_status!=1 || (($superadmin && !in_array($username,$superadmin)) && $username!=$manager)) {
require("header.php");echo"$headertp";
headguide("你正处在<br>{$site_name}<br>的{$rztitle}申请程式中","{$rztitle}申请表");
msg_box('对不起!!','<center>此操作是非法操作!!或是你不是总坛主,请你不要乱来!!<br><ul><li><a href="javascript:history.back(1)">返回前页</a></li><br><li><a href="login.php">现在登录</li></ul></center>');
require("footer.php");echo"$footertp";
exit;}
$fp=fopen($adminfile,"a");
flock($fp,LOCK_EX);
fputs($fp,"$forumid|$userid|\n");
fclose($fp);
if (file_exists("userdata/getmg/$filename")) { //1
$p_admin==0;
if($login_status==1 && $username==$manager) { $p_admin=1;}
if (file_exists("bbsdata/superadmin.php")) {//2
include("bbsdata/superadmin.php");
if ($login_status==1 && $superadmin && in_array($username,$superadmin)) {$p_admin=1;}
}//2
$useri=explode("|",readfromfile("userdata/getmg/$filename"));
$useri[17]="$username";
$uu=implode("|",$useri);
writetofile("userdata/getmg/$filename",$uu);
}//1
postmsg($useri[0],"$username 同意你的申请","感谢你对流星论坛的支持。<br>以后好好地干吧!!请记住超过10天不来的将去除您斑竹的头衔");
jump_page("getmg.php","成功添加了 1 名版主,现在返回申请表列表");exit;
}
if ($job=="del") {
require("header.php");echo"$headertp";
list($user,$forum,$city,$work,$useremail,$qq,$times,$ismod,$activeforum,$reason,$forumtopic,$howtodo,$forumbest,$suggest,$asktime,$yes,$no,$ok)
= explode("|",readfromfile("userdata/getmg/$filename"));
$check=0;
if (file_exists("bbsdata/superadmin.php")) {
include("bbsdata/superadmin.php");
if ($username==$manager) $check=1;
if ($check!=1|| empty($filename)) {
headguide("你正处在<br>{$ftbConfig['bbs_title']}<br>的版主申请程式中","版主申请表");
msg_box('对不起!!','<center>此操作是非法操作!!或是你不是总坛主,请你不要乱来!!<br><ul><li><a href="javascript:history.back(1)">返回前页</a></li><br><li><a href="login.php">现在登录</li></ul></center>');
require("footer.php");echo"$footertp";
exit;}}
if(file_exists("userdata/getmg/list.php")){
$form_list=file("userdata/getmg/list.php");
$form_count=count($form_list);
$form_file=fopen("userdata/getmg/list.php","w");
for($i=0;$i<$form_count;$i++){
if($i!=$fid) fputs($form_file,$form_list[$i]);}
fclose($form_file);
if (file_exists("userdata/getmg/$filename")) unlink("userdata/getmg/$filename");
jump_page("getmg.php","申请表删除成功",
"<b>成功删除了版主申请表</b><br><br>
你现在可以选择:<br><ul><li><a href='getmg.php'>返回申请表列表</a></li>
<br><br><li><a href='index.php'>返回论坛首页</a></li></ul>");
require("footer.php");echo"$footertp";
exit;}}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -