<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';
$zbp->Load();

$action='root';

if (!$zbp->CheckRights($action)) {$zbp->zhiyuanError(6);die();}

if (!$zbp->CheckPlugin('orangecms')) {$zbp->zhiyuanError(48);die();}

if($_GET['type'] == 'logo' ){

	global $zbp;

	foreach ($_FILES as $key => $value) {

		if(!strpos($key, "_php")){

			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {

				$tmp_name = $_FILES[$key]['tmp_name'];

				$name = $_FILES[$key]['name'];

				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/orangecms/style/images/logo.png');



			}

		}

	}

	$zbp->SetHint('good','修改成功');

	Redirect('main.php?act=pic');

}
if($_GET['type'] == 'favicon' ){

	global $zbp;

	foreach ($_FILES as $key => $value) {

		if(!strpos($key, "_php")){

			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {

				$tmp_name = $_FILES[$key]['tmp_name'];

				$name = $_FILES[$key]['name'];

				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/orangecms/style/images/favicon.ico');



			}

		}

	}

	$zbp->SetHint('good','修改成功');

	Redirect('main.php?act=pic');

}
if($_GET['type'] == 'tupian1' ){

	global $zbp;

	foreach ($_FILES as $key => $value) {

		if(!strpos($key, "_php")){

			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {

				$tmp_name = $_FILES[$key]['tmp_name'];

				$name = $_FILES[$key]['name'];

				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/orangecms/style/images/tupian1.jpg');



			}

		}

	}

	$zbp->SetHint('good','修改成功');

	Redirect('main.php?act=pic');

}
if($_GET['type'] == 'tupian2' ){

	global $zbp;

	foreach ($_FILES as $key => $value) {

		if(!strpos($key, "_php")){

			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {

				$tmp_name = $_FILES[$key]['tmp_name'];

				$name = $_FILES[$key]['name'];

				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/orangecms/style/images/tupian2.jpg');



			}

		}

	}

	$zbp->SetHint('good','修改成功');

	Redirect('main.php?act=pic');

}

if($_GET['type'] == 'weixin' ){

	global $zbp;

	foreach ($_FILES as $key => $value) {

		if(!strpos($key, "_php")){

			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {

				$tmp_name = $_FILES[$key]['tmp_name'];

				$name = $_FILES[$key]['name'];

				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/orangecms/style/images/weixin.jpg');



			}

		}

	}

	$zbp->SetHint('good','修改成功');

	Redirect('main.php?act=pic');

}


if($_GET['type'] == 'about' ){

	global $zbp;

	foreach ($_FILES as $key => $value) {

		if(!strpos($key, "_php")){

			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {

				$tmp_name = $_FILES[$key]['tmp_name'];

				$name = $_FILES[$key]['name'];

				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/orangecms/style/images/about.png');



			}

		}

	}

	$zbp->SetHint('good','修改成功');

	Redirect('main.php?act=pic');

}

?>