fetch1("select * from {$dbtbpre}enewstempdt where tempid='$tempid'");
	if(!$tempr['tempid'])
	{
		printerror('ErrorUrl','');
	}
	$file=ECMS_PATH.$tempr['tempfile'];
	if(!file_exists($file))
	{
		printerror('FileNotExist','');
	}
	$tempr['temptext']=ReadFiletext($file);
	return $tempr;
}
//修改动态模板内容
function EditDtTempFiletext($add,$userid,$username){
	global $empire,$dbtbpre;
	//操作权限
	CheckLevel($userid,$username,$classid,'dttemp');
	$tempid=(int)$add['tempid'];
	if(!$tempid)
	{
		printerror('ErrorUrl','');
	}
	$tempr=$empire->fetch1("select tempid,tempname,tempvar,tempfile from {$dbtbpre}enewstempdt where tempid='$tempid'");
	if(!$tempr['tempid'])
	{
		printerror('ErrorUrl','');
	}
	$file=ECMS_PATH.$tempr['tempfile'];
	if(!file_exists($file))
	{
		printerror('FileNotExist','');
	}
	$temptext=ClearAddsData($add['temptext']);
	WriteFiletext_n($file,$temptext);
	//操作日志
	insert_dolog("tempid=".$tempid."
tempname=".$tempr['tempname']);
	printerror("EditDttempSuccess","EditDttemp.php?tempid=$tempid".hReturnEcmsHashStrHref2(0));
}
//操作
$enews=$_POST['enews'];
if(empty($enews))
{$enews=$_GET['enews'];}
if($enews)
{
	hCheckEcmsRHash();
	include("../../class/tempfun.php");
}
//增加模板
if($enews=="EditDtTempFiletext")
{
	EditDtTempFiletext($_POST,$logininid,$loginin);
}
else
{}
//修改
$tempid=(int)$_GET['tempid'];
$r=GetDtTempFiletext($tempid);
$url="修改动态页面模板: ".$r['tempname'];
db_close();
$empire=null;
?>
| 位置:=$url?> |