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

📄 rtrash.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 ($action=="del") {
	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 ($forum_upid!="" && $detail[0]==$forum_upid && $detail[1]==$username) $check_user=1;
		if ($detail[0]==$forum_cid && $detail[1]==$username) $check_user=1;
	}
}

if ($usertype[22]=="1") $check_user=1;
if ($usertype[21]=="1") $check_user=1;
if ($can_rec!="1") $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 (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;
}

if ($action=="move" || $action=="copy") {
	$oldfilemove="{$idpath}forum$forumid/list.php";
	$forummove="{$idpath}forum$forumid";
	$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("$filemove","r");
		flock($fp,LOCK_SH);
		$oldlist=file("$filemove");
		fclose($fp);
		$count=count($oldlist);
		for ($i=0; $i<$count; $i++) {
			$detail=explode("|",$oldlist[$i]);
			if ($detail[5]!=$filename) {
            $woldlist.=$oldlist[$i];
			}else{
			$anewlist=$oldlist[$i];
			}
		}
		if ($action=="move") {
		//------Delete from the original list-------
			writetofile("{$idpath}forum$forumid/trash.php",$woldlist);
		}
//------move the file---------
		if (file_exists("$oldfilemove")) {
			$newlist=readfromfile("{$idpath}forum$forumid/list.php");
			$newlist.=$anewlist;
		}
//------write to the target LIST-----
		writetofile("$oldfilemove",$newlist);

		$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("manage2.php?action=btfront&step=2&filename=$filename&forumid=$forumid","$gl[2]",
"$gl[231]
<ul>
<li><a href='manage2.php?action=btfront&step=2&filename=$filename&forumid=$forumid'>$gl[232]</a></li><br><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;
	$title="$gl[173]";
	$content.="$gl[234]<br>
<br>$gl[235]<ul>
<li><a href='javascript:history.back(1)'>$gl[15]</a><br><br></li>
<li><a href='rtrash.php?action=move&forumid=$forumid&newforumid=trash&filename=$filename&step=2'>$gl[173]</a>
";
	$content.="</ul>";
	msg_box($title,$content);
}

⌨️ 快捷键说明

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