您当前的位置:首页 > CMS常见问题 > 帝国cms常见问题 >

帝国cms错误提示printerror()函数代码注释

0
<?php
//导入语言包
function LoadLang($file){
	global $ecms_config;
	return '../data/language/'.$ecms_config['sets']['elang'].'/'.$file;
	//return '../data/language/gb/'.$file;
}
function printerror($error="",$gotourl="",$ecms=0,$noautourl=0,$novar=0){
	global $empire,$editor,$public_r,$ecms_config;
	if($editor==1){
		$a="../";
	}elseif($editor==2){
		$a="../../";
	}elseif($editor==3){
		$a="../../../";
	}else{
		$a="";
	}
	if($ecms==1||$ecms==9){
		$a=ECMS_PATH."e/data/";
	}
	if(strstr($gotourl,"(")||empty($gotourl)){
		if(strstr($gotourl,"(-2")){
			$gotourl_js="history.go(-2)";
			$gotourl="javascript:history.go(-2)";
		}else{
			$gotourl_js="history:go(-1)";
			$gotourl="javascript:history.go(-1)";
		}
	}else{
		$gotourl_js='self.location.href="'.$gotourl.'";';
	}
	if(empty($error)){
		$error="DbError";
	}
	if($ecms==9)//前台弹出对话框
	{
		//包含前台信息提示语言包
		//@include $a."../data/language/gb/pub/q_message.php";
		@include $a.LoadLang("pub/q_message.php");
		$error=empty($novar)?$qmessage_r[$error]:$error;
		echo '<script>alert("'.$error.'");'.$gotourl_js."</script>";
		db_close();
		$empire=null;
		exit();
	}
	elseif($ecms==8)//后台弹出对话框
	{
		//包含后台信息提示语言包
		//@include $a."../data/language/gb/pub/message.php";
		@include $a.LoadLang("pub/message.php");
		$error=empty($novar)?$message_r[$error]:$error;
		echo '<script>alert("'.$error.'");'.$gotourl_js."</script>";
		db_close();
		$empire=null;
		exit();
	}
	elseif($ecms==7)//前台弹出对话框并关闭窗口
	{
		@include $a.LoadLang("pub/q_message.php");
		$error=empty($novar)?$qmessage_r[$error]:$error;
		echo '<script>alert("'.$error.'");window.close();</script>';
		db_close();
		$empire=null;
		exit();
	}
	elseif($ecms==6)//后台弹出对话框并关闭窗口
	{
		@include $a.LoadLang("pub/message.php");
		$error=empty($novar)?$message_r[$error]:$error;
		echo'<script>alert("'.$error.'");window.close();</script>';
		db_close();
		$empire=null;
		exit();
	}
	elseif($ecms==0)
	{
		@include $a.LoadLang("pub/message.php");
		$error=empty($novar)?$message_r[$error]:$error;
		@include($a."message.php");
	}
	else
	{
		@include $a.LoadLang("pub/q_message.php");
		$error=empty($novar)?$qmessage_r[$error]:$error;
		@include($a."../message/index.php");
	}
	db_close();
	$empire=null;
	exit();
}
?>
顶部中部底部