<?php
define('THIS_SCRIPT', 'ccvideo');
include_once 'global.php';
define('CCVIDEOCONFIGPATH', CACHE_PATH.'ccvideo.config.php');
include_once CCVIDEOCONFIGPATH;
if (defined('MAIN_DOMAIN_NAME')) {
	exit('0@@@Access denied!@@@');
}
$lang = load_lang($lang,'ccvideo');
head();
checklogin();

if ( strpos($sysinfo['flag'],'59,') === false ){
	show_msg($lang['readme_tit'],$lang['ccvideo.err1'],0,'','','','');
	exit;
}
PageLoad();
function Pageload(){
	global $lang,$reaction,$charset,$ccvideo;
	if($reaction==="save"){
		global $_POST;
		if(!$fp=fopen(CCVIDEOCONFIGPATH,"wb")){
			show_msg("{$lang["ccvideo.save"]}","{$lang["ccvideo.save"]}{$lang["ccvideo.fail"]}
			<BR>{$lang["ccvideo.fail_case"]}",0,'','',"?","{$lang["ccvideo.back"]}");
		}else{
			if(!$ccvideo=$_POST['p']){
				show_msg("{$lang["ccvideo.save"]}","{$lang["ccvideo.save"]}{$lang["ccvideo.fail"]}
			    <BR>{$lang["ccvideo.fail_errpost"]}",0,'','',"?","{$lang["ccvideo.back"]}");
			}else{
				$content="<?php\n".varstoscript("ccvideo",$ccvideo).";\n?>";
				fputs($fp,$content);
				@fclose($fp);
				show_msg("{$lang["ccvideo.save"]}","{$lang["ccvideo.save"]}{$lang["ccvideo.ok"]}",1,'',''
				,"?","{$lang["ccvideo.back"]}");
			}
		}
		exit;
	}

	include printout('ccvideo');
	footer();
}
?>