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

📄 manage3.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) || empty($filename) || empty($action) || !ereg("^f_[0-9]+$",$filename)) {
	$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 (!$filename || !$forumid || !ereg("^f_[0-9]+$",$filename)) exit;
if (!file_exists("{$idpath}forum$forumid/$filename")) exit;
$articlelist=file("{$idpath}forum$forumid/$filename");
$count=count($articlelist);
if (!$articlelist[0]) exit;
list($oldarticletitle,$author,$oldarticlecontent,$time,$area,$oldicon,$p,$bym,$pfzhe,$oldupload,$oldedit)=explode("|",$articlelist[0]);

if ($login_status==1 && $username==$admin_name) $check_user=1;
if ($login_status==1 && $check_user==0 && file_exists("datafile/admin.php")) {
	$adminlist=file("datafile/admin.php");
	$admincount=count($adminlist);
	for ($i=0; $i<$admincount; $i++) {
		$detail=explode("|", str_replace("\n","", $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[21]=="1") $check_user=1;
if ($usertype[22]=="1") $check_user=1;
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 (empty($step)) {
	include("header.php");
	navi_bar($gl[230],
"<a href=\"forums.php?forumid=$forumid\">$forum_name</a>",
"MA","no");
	print_confirm();
	include("footer.php");
	exit;
}
$actionreason=safe_convert($actionreason);
if ($action=="move" || $action=="copy") {
	$filemove="{$idpath}forum$forumid/list.php";
	$oldfilemove="{$idpath}forum$forumid/list.php";
	$forummove="{$idpath}forum$forumid";
	$filenewmove="{$idpath}forum$newforumid/list.php";
	if ($newforumid=="trash"){ 
		$filemove="{$idpath}forum$forumid/trash.php";
		$filenewmove="{$idpath}forum$forumid/trash.php";
	}
	if (!file_exists("{$idpath}forum$forumid/trash.php")) writetofile("{$idpath}forum$forumid/trash.php","");
	if (file_exists("$forummove/$filename")) {
//------get the line from the original list------
		$fp=fopen("$oldfilemove","r");
		flock($fp,LOCK_SH);
		$oldlist=file("$oldfilemove");
		fclose($fp);
		$count=count($oldlist);
		for ($i=0; $i<$count; $i++) {
			$detail=explode("|",$oldlist[$i]);
			if ($detail[5]!=$filename) {
	            $woldlist.=$oldlist[$i];
			}else{
				$topicname=$detail[0];
				$ruser=$detail[1];
				$newlist=$oldlist[$i];
			}
		}
		if ($action=="move") {
		//------Delete from the original list-------
			writetofile("{$idpath}forum$forumid/list.php",$woldlist);
		}
//------move the file---------
		if (file_exists("$filenewmove")) {
			$newlist.=@readfromfile("{$idpath}forum$forumid/trash.php");
		}
//------write to the target LIST-----
		writetofile("$filenewmove",$newlist);
		if($beforeactionmess=="yes"){
			mtou($ruser,"recycle",$topicname);
		}
		$tmptowte=@readfromfile("datafile/actlog/$forumid.log");
		writetofile("datafile/actlog/$forumid.log","$actionreason|$username|$oldarticletitle($author)|$timestamp|recycle|\n".$tmptowte);

		$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]--;
				$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_err() {
global $status,$gl;
	$title="$gl[53]";
	$content="$gl[233]<br>
<br>$status<br><ul>
<li><a href='javascript:history.back(1)'>$gl[15]</a></li>
</ul>";
	msg_box($title,$content);
}


function print_confirm() {
global $action,$forumid,$filename,$gl,$choose_reason;
	$title="$gl[173]";
	$chooser_t=explode("\n",$choose_reason);
	$cou=count($chooser_t);
	$chooser_c="<select name='reasonselection' onchange='document.reasons.actionreason.value=document.reasons.reasonselection.options[document.reasons.reasonselection.selectedIndex].value;'>";
	for($i=0;$i<$cou;$i++){
		$chooser_c.="<option value='{$chooser_t[$i]}'>{$chooser_t[$i]}</option>";
	}
	$chooser_c.="</select>";
	$content="<script language=\"JavaScript1.2\">
<!--
function validate(theform) {
if (theform.actionreason.value==\"\" || theform.actionreason.value==\"\") {
alert(\"$gl[455]\");
return false; } }
function change(theoption) {
this.reasons.actionreason.value=theoption;
}
//-->
</script>
<form name='reasons' onSubmit=\"return validate(this)\" action=\"manage3.php?action=move&forumid=$forumid&newforumid=trash&filename=$filename&step=2\" method=POST>$gl[234]<br>
<br>
$gl[235]<br><input type=checkbox name='beforeactionmess' value='yes' checked>$gl[425]<br>$gl[452] $chooser_c<input type=text name=actionreason><br><input type=submit value='$gl[173]'><br><br>
</form>";

	$content.="";
	msg_box($title,$content);
}
function mtou($ruser,$action,$topic) {
global $id_unique,$username,$actionreason,$gl,$timestamp,$bbs_title,$short_msg_max;
	if (file_exists("$id_unique/".urlencode($ruser).".rec")) {$msg=file("$id_unique/".urlencode($ruser).".rec");}else{ $msg[0]="";}
	$actionshow="$gl[453]";
	$user="$gl[426]";
	$content=$gl[428].$topic.$gl[429].$username.$actionshow."<br>".$gl[452]." ".$actionreason;
	$title="$gl[427]";
	$new="$user|$title|$timestamp|$content|0|\n";
	$oldcount=count($msg);
	if ($oldcount>$short_msg_max) {
		for ($i=$short_msg_max; $i<$oldcount; $i++) unset($msg);
	}
	$old=implode("",$msg);
	writetofile("$id_unique/".urlencode($ruser).".rec",$new.$old);
}

⌨️ 快捷键说明

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