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

📄 manage4.php

📁 bmb的论坛
💻 PHP
字号:
<?
/*
 BMForum Plus! Bulletin Board Systems
 Version : Plus!
 
 This is a freeware, but don't change the copyright information.
 A SourceForge Project - GNU Licence project.
 Web Site: http://www.bmforum.com
 Copyright (C) Bluview Technology
*/           

require("datafile/config.php");
require("getskin.php");

get_forum_info();
if (empty($forumid) || !is_numeric($forumid) || (($action=="move" || $action=="copy") && $step==2 && !is_numeric($newforumid))  ||  empty($action) || empty($listfilename) || ($listfilename=="trash.php" && $action!="del") || empty($filenamebym)) {
	$status="$gl[229]";
	include("header.php");
	navi_bar("$gl[230]",
"<a href=\"forums.php?forumid=$forumid\">$forum_name</a>",
"MA Program","no");
	print_err();
	include("footer.php");
	exit;
}
//---------check-----------
$check_user=0;
if ($login_status==1 && $username==$admin_name) $check_user=1;
if ($check_user==0 && $login_status==1 && file_exists("datafile/admin.php")) {
	$adminlist=file("datafile/admin.php");
	$admincount=count($adminlist);
	for ($i=0; $i<$admincount; $i++) {
		$detail=explode("|", trim($adminlist[$i]));
		if ($detail[0]==$forumid && $detail[1]==$username) { $check_user=1; }
		if ($detail[0]==$forum_cid && $detail[1]==$username) { $check_user=1;  }
		if ($forum_upid!="" && $detail[0]==$forum_upid && $detail[1]==$username) $check_user=1;
	}
}
if ($usertype[22]=="1" || $usertype[21]=="1") $check_user=1;
if ($del_true!="1" && $action==del && $listfilename=="list.php") $check_user=0;
if ($del_rec!="1" && $action==del && $listfilename=="trash.php") $check_user=0;
if ($check_user==0) {
	$status=$gl[217];
	include("header.php");
	navi_bar($gl[230],
"<a href=\"forums.php?forumid=$forumid\">$forum_name</a>",
"MA","no");
	print_err();
	include("footer.php");
	exit;
}
if ($action=="hebing"){
	if (empty($step)) {
		require("header.php");
		$num=count($filenamebym);
		$filenamewebdi=implode("|",$filenamebym);
		print_bar1();
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 bgcolor=$titlecolor> 
    <td class=title background=$header_tile>$gl[342]</td>
  </tr><tr><td bgcolor=$list_color2>
$gl[343] $num $gl[344]<br>
<FORM METHOD=POST ACTION="manage4.php">
EOT;
		for ($i=0;$i<$num;$i++){
			$filelist=file("{$idpath}forum$forumid/$filenamebym[$i]");
			list($title,$author,$content,$time,$aaa,$icon)=explode("|",$filelist[0]);
			$select="<INPUT TYPE=\"radio\" NAME=\"webdi\" value=\"$filenamebym[$i]\">";
			$select.="<a href=topic.php?forumid=$forumid&filename=$filenamebym[$i] target=_blank>$title</a> $gl[225] $author <br><br>";
			echo $select;
		}
?>
<?=$gl[345]?><br>
<INPUT TYPE="text" NAME="newtitle" size=20 value=""> 
<INPUT TYPE="submit" value="OK">
<INPUT TYPE="hidden" name=step value=2>
<INPUT TYPE="hidden" name=action value=hebing><INPUT TYPE="hidden" name=listfilename value=<?=$listfilename?>>
<INPUT TYPE="hidden" name=forumid value=<?=$forumid?>>
<INPUT TYPE="hidden" name=filenamewebdi value="<?=$filenamewebdi?>">
<INPUT TYPE="hidden" name=filenamebym value="<?=$filenamebym?>">
</FORM>
  </td></tr>
</table>  
</tr>
</table>
<?
		require("footer.php");
		exit;
	}else{ 
		$filenamewebdi=explode("|",$filenamewebdi);
		$countw=count($filenamewebdi);
		if ($webdi=="" && $newtitle==""){
			$status="$gl[346]";
			include("header.php");
			print_bar1();
			print_err();
			include("footer.php");
			exit;
		}
		$webdititle="";
		if ($webdi<>""){
			$webdilist=file("{$idpath}forum$forumid/$webdi");
			$webdititlelist=explode("|",$webdilist[0]);
			$webdititle=$webdititlelist[0]; // title
		}
		$titlefile=$webdititle;
		if ($newtitle<>"") $titlefile=$newtitle;    //title
		if ($webdi=="") {
			$newtitlefile=$filenamewebdi[0];   //title file name
		}else{
			$newtitlefile=$webdi;   //title file name
		}
		$oldlist=readfromfile("{$idpath}forum$forumid/$newtitlefile");
		$oldlist=explode("\n",$oldlist);
		$listcount=count($oldlist);
		$listdetail=explode("|",$oldlist[0]);
		$listdetail[0]=$titlefile;
		$oldlist[0]=implode("|",$listdetail);
		$oldlist=implode("\n",$oldlist);
		writetofile("{$idpath}forum$forumid/$newtitlefile",$oldlist);//-edit title
		$nowcount=$countw-1;
		$listall2=readfromfile("{$idpath}forum$forumid/list.php");
		$listall2=explode("\n",$listall2);
		$allcount2=count($listall2);
		for ($ac=0;$ac<$allcount2;$ac++){
			$ll=explode("|",$listall2[$ac]);
			if ($ll[5]==$newtitlefile){
				$ll[0]=$titlefile;
			}
			$listall2[$ac]=implode("|",$ll);
		}
		$listall2=implode("\n",$listall2);
		writetofile("{$idpath}forum$forumid/list.php",$listall2);

		$listall=readfromfile("{$idpath}forum$forumid/list.php");
		$listall=explode("\n",$listall);
		$allcount=count($listall);
		$readcount=0;
		$hitcount=0;
		for ($z=0;$z<$countw;$z++){
			if (trim($filenamewebdi[$z])<>trim($newtitlefile)){
				$addnext=readfromfile("{$idpath}forum$forumid/$filenamewebdi[$z]");
				writetofile("{$idpath}forum$forumid/$newtitlefile",$addnext,"a");
				unlink("{$idpath}forum$forumid/$filenamewebdi[$z]");
				for ($ac=0;$ac<$allcount;$ac++){
					$art=explode("|",$listall[$ac]);
					if ($filenamewebdi[$z]==$art[5]){
					$readcount=$readcount+$art[6]+1;
					$hitcount=$hitcount+$art[7];
					unset($listall[$ac]);
				}else{
					$listall[$ac]=implode("|",$art);
				}
			}
		}
	}

	$listall=implode("\n",$listall);
	writetofile("{$idpath}forum$forumid/list.php",$listall);

	$listall3=readfromfile("{$idpath}forum$forumid/list.php");
	$listall3=explode("\n",$listall3);
	$allcount3=count($listall3);
	for ($acc=0;$acc<$allcount3;$acc++){
		$lll=explode("|",$listall3[$acc]);
		if ($lll[5]==$newtitlefile){
			$lll[6]=$lll[6]+$readcount;
			$lll[7]=$lll[7]+$hitcount;
		}
		$listall3[$acc]=implode("|",$lll);
	}
	$listall3=implode("\n",$listall3);
	writetofile("{$idpath}forum$forumid/list.php",$listall3);

		$flist=file("{$idpath}forum$forumid/list.php");
		$ffcount=count($flist);
	    for ($xfxi=0; $xfxi<$ffcount; $xfxi++) {
	      $notop=explode("|",$flist[$xfxi]);
	      if ($notop[10]<3) {
	    	  $xxxft=explode(",",$notop[8]); 
	      	  $ntoptime=$xxxft[2];
		      $nft=$notop[8].",".$notop[5]; 
		      break; 
	      }elseif ($notop[10]>2){
		      $xxxft=explode(",",$notop[8]); 
		      if($xxxft[2]>$ftoptime)  { 
			      $ftoptime=$xxxft[2]; 
			      $ft=$notop[8].",".$notop[5]; 
		      }
	      }
	    }

		if($ftoptime>$ntoptime) $trueft=$ft; else $trueft=$nft; 
		
		$all_lastmo=@file("datafile/lastreply.php");
		$all_count=count($all_lastmo)+1;
		for($i=0;$i<$all_count;$i++){
			$all_lastmo_detail=explode('|',$all_lastmo[$i]);
			if($all_lastmo_detail[1]==$forumid || $all_lastmo_detail[1]=="" || $all_lastmo_detail[1]=="\n"){
				$all_lastmo_detail[4]=$all_lastmo_detail[4]-$num+1;
				$all_lastmo_detail[3]=$all_lastmo_detail[3]+$num-1;
				$new_sline="<?exit;?>|$forumid|$trueft|$all_lastmo_detail[3]|$all_lastmo_detail[4]|\n";
				unset($all_lastmo[$i]);
				break;
			}
		}

		$oldline=implode("",$all_lastmo);
		writetofile("datafile/lastreply.php",$new_sline.$oldline);

	jump_page("forums.php?forumid=$forumid","$gl[2]",
"$gl[231]
<ul>
<li><a href='forums.php?forumid=$forumid'>$gl[4]</a></li><br><br>
<li><a href='index.php'>$gl[5]</a></li><br>
</ul><br>");
	}
}
function print_bar1() {
global $forum_name,$forumid,$listfilename,$gl,$bbs_title;
	navi_bar("$gl[230]",
"<a href=\"forums.php?forumid=$forumid\">$forum_name</a>",
"MA","no");
}

if (empty($step)) {
	include("header.php");
	$filenamebym=implode("|",$filenamebym);
	navi_bar("$gl[230]",
"<a href=\"forums.php?forumid=$forumid\">$forum_name</a>",
"MA","no");
	print_confirm();
	include("footer.php");
	exit;
}
global $listfilename;
//鍒犻櫎璐村瓙寮

⌨️ 快捷键说明

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