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

📄 modblacklist.php

📁 在综合英文版XOOPS 2.09, 2.091, 2.092 的基础上正式发布XOOPS 2.09中文版 XOOPS 2.09x 版主要是PHP5升级、bug修正和安全补正: 1 全面兼容PHP 5.
💻 PHP
字号:
<?php/* <Edit> */function add_magic_quotes($array) {    foreach ($array as $k => $v) {        if (is_array($v)) {            $array[$k] = add_magic_quotes($v);        } else {            $array[$k] = addslashes($v);        }    }    return $array;}if (!get_magic_quotes_gpc()) {    $_GET    = add_magic_quotes($_GET);    $_POST   = add_magic_quotes($_POST);    $_COOKIE = add_magic_quotes($_COOKIE);}$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder');for ($i=0; $i<count($wpvarstoreset); $i += 1) {    $wpvar = $wpvarstoreset[$i];    if (!isset($$wpvar)) {        if (empty($_POST["$wpvar"])) {            if (empty($_GET["$wpvar"])) {                $$wpvar = '';            } else {                $$wpvar = $_GET["$wpvar"];            }        } else {            $$wpvar = $_POST["$wpvar"];        }    }}switch($action) {	case 'export':			require_once('../wp-config.php');			$postquery ="SELECT * FROM {$wpdb->blacklist}";			$exportfile = '导出黑名单';        	$results = $wpdb->get_results($postquery);        	foreach ($results as $result) {        		$exportfile .=$result->domain."\n";        		}        		//Send the headers to control the download			header('Content-Type: text/comma-separated-values');			header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');			header('Content-Disposition: inline; filename="blacklist.txt"');			echo $exportfile;        	die();	case 'import':			$title = '从文件导入黑名单';			$standalone = 0;			require_once ('./admin-header.php');			?>			<div class="wrap">			Import Blacklist Results<br/><br/>			<?php			$blfilename = $_POST["blfilename"];			$domain = @file($blfilename);			if (!$domain)				echo "File not found. Please check the path or copy the file to the wp-admin directory.";			$answer = '';			for ($i=0; $i<count($domain); $i++) {			     //echo $domain[$i]."<br/>";			     $data = $domain[$i];			     $temp = "";			     for ($j=0; $j<strlen($data); $j++)  {			     	if ($data[$j]==" " || $data[$j] == "#")			     		break;			     	else $temp.=$data[$j];			     	continue;			     	}			     //echo $temp."<br/>";			     if ($temp!="") {			     	$request = $wpdb->get_row("SELECT id FROM {$wpdb->blacklist} WHERE domain='$temp'");			     	if (!$request)			     		$request1 = $wpdb->query("INSERT INTO {$wpdb->blacklist} (domain) VALUES ('$temp')");			     	if (!$request1)						$answer = "部分成功";					else $answer = '导入成功!';				 }     		}			echo $answer."<br/>";			if ($user_level > 0) {				include('blacklistForm.php');				}			else {			?>			<div class="wrap">						<p>Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to modify the Blacklist.<br />							You can also <a href="mailto:<?php echo $admin_email ?>?subject=Blog posting permission">e-mail the admin</a> to ask for a promotion.<br />							When you&#8217;re promoted, just reload this page to play with the Blacklist. :)</p>			</div>			<?php			}			break;	case 'adddomain':			$title = '添加黑名单';			$standalone = 0;			require_once ('./admin-header.php');			?>			<div class="wrap">			添加黑名单<br/><br/>			<?php			$temp = $_POST["domain"];			$answer = '添加成功!';			$request = $wpdb->get_row("SELECT id FROM {$wpdb->blacklist} WHERE domain='$temp'");			if (!$request)				$request = $wpdb->query("INSERT INTO {$wpdb->blacklist} (domain) VALUES ('$temp')");			if (!$request)				$answer = "部分成功";			echo $answer."<br/></div>";			if ($user_level > 0) {				include('blacklistForm.php');				}			else {			?>			<div class="wrap">						<p>Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to modify the Blacklist.<br />							You can also <a href="mailto:<?php echo $admin_email ?>?subject=Blog posting permission">e-mail the admin</a> to ask for a promotion.<br />							When you&#8217;re promoted, just reload this page to play with the Blacklist. :)</p>			</div>			<?php			}			break;    default:		$title = '黑名单管理';        $standalone = 0;        require_once ('./admin-header.php');        if ($user_level > 0) { 			include('blacklistForm.php');            } else {?><div class="wrap">            <p>Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to modify the Blacklist.<br />				You can also <a href="mailto:<?php echo $admin_email ?>?subject=Blog posting permission">e-mail the admin</a> to ask for a promotion.<br />				When you&#8217;re promoted, just reload this page to play with the Blacklist. :)</p></div><?php        }        break;} // end switch/* </Edit> */include('admin-footer.php');?>

⌨️ 快捷键说明

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