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

📄 recycle.php

📁 很好的一套PHP树形论坛程序
💻 PHP
字号:
<?php
!function_exists('adminmsg') && exit('Forbidden');
$basename="$admin_file?adminjob=recycle";

include_once(R_P.'require/forum.php');
require_once(R_P.'require/updateforum.php');

if ($admin_gid == 5){
	list($allowfid,$forumcache) = GetAllowForum($admin_name);
	$sql = "WHERE r.fid IN($allowfid)";
} else {
	include D_P.'data/bbscache/forumcache.php';
	list($hidefid,$hideforum) = GetHiddenForum();
	if($admin_gid == 3){
		$forumcache .= $hideforum;
		$sql = "WHERE 1";
	} else{
		$sql = "WHERE r.fid NOT IN($hidefid)";
	}
}

if(!$action){
	is_numeric($fid) && $sql .= " AND r.fid='$fid'";
	$admin && $sql .= " AND r.admin='$admin'";
	if($username){
		$rt  = $db->get_one("SELECT uid FROM pw_members WHERE username='$username'");
		$uid = $rt['uid'];
	}
	if(is_numeric($uid)){
		$sql  .= " AND t.authorid='$uid'";
		$J_sql ="LEFT JOIN pw_threads t USING(tid)";
	}else{
		$J_sql = '';
	}

	(!is_numeric($page) || $page<1) && $page = 1;
	$limit = "LIMIT ".($page-1)*$db_perpage.",$db_perpage";
	$rt    = $db->get_one("SELECT COUNT(*) AS sum FROM pw_recycle r $J_sql $sql");
	$pages = numofpage($rt['sum'],$page,ceil($rt['sum']/$db_perpage),"$basename&fid=$fid&uid=$uid&admin=$admin&");

	$query=$db->query("SELECT r.*,t.subject,t.author,t.authorid FROM pw_recycle r LEFT JOIN pw_threads t USING(tid) $sql ORDER BY fid,deltime DESC $limit");
	while($rt=$db->fetch_array($query)){
		$rt['deltime'] = get_date($rt['deltime']);
		$rt['subject'] = substrs($rt['subject'],50);
		$rt['fname']   = $forum[$rt['fid']]['name'];
		$recycledb[]   = $rt;
	}
	include PrintEot('recycle');exit;
} elseif($_POST['action'] == 'revert' || $_POST['action'] == 'del'){
	$selids = '';
	$fids  = array();
	foreach($selid as $key => $value){
		if(is_numeric($value)){
			$selids .= $key.',';
			if($action == 'revert'){
				$fids[]=$value;
				$db->update("UPDATE pw_threads SET fid='$value' WHERE tid='$key'");
			}
		}
	}
	if($action == 'revert'){
		$fids = array_unique($fids);
		foreach($fids as $key => $value){
			updateforum($value);
		}
		updateforum($db_recycle);
	}
	if($selids){
		$selids = substr($selids,0,-1);
		$db->update("DELETE FROM pw_recycle WHERE tid IN ($selids)");
	}
	adminmsg('operate_success');
}
?>

⌨️ 快捷键说明

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