예제 #1
0
function DelClasstemp($add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $tempid = (int) $add['tempid'];
    if (!$tempid) {
        printerror("EmptyClasstempid", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $r = $empire->fetch1("select tempname from " . GetDoTemptb("enewsclasstemp", $gid) . " where tempid={$tempid}");
    $sql = $empire->query("delete from " . GetDoTemptb("enewsclasstemp", $gid) . " where tempid={$tempid}");
    //删除备份记录
    DelEbakTempAll('classtemp', $gid, $tempid);
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        //删除动态模板缓存文件
        DelOneTempTmpfile('classtemp' . $tempid);
    }
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$r['tempname']}&gid={$gid}");
        printerror("DelClasstempSuccess", "ListClasstemp.php?classid={$add['cid']}&gid={$gid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #2
0
function DelVoteTemp($tempid, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $tempid;
    if (empty($tempid)) {
        printerror("NotChangeVoteTempid", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $_GET['gid'];
    $r = $empire->fetch1("select tempname from " . GetDoTemptb("enewsvotetemp", $gid) . " where tempid={$tempid}");
    $sql = $empire->query("delete from " . GetDoTemptb("enewsvotetemp", $gid) . " where tempid={$tempid}");
    //删除备份记录
    DelEbakTempAll('votetemp', $gid, $tempid);
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$r['tempname']}&gid={$gid}");
        printerror("DelVoteTempSuccess", "ListVotetemp.php?gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #3
0
function DelTempvar($varid, $cid, $userid, $username)
{
    global $empire, $dbtbpre;
    $varid = (int) $varid;
    if (!$varid) {
        printerror("NotDelTempvarid", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "tempvar");
    $gid = (int) $_GET['gid'];
    $r = $empire->fetch1("select myvar from " . GetDoTemptb("enewstempvar", $gid) . " where varid='{$varid}'");
    $sql = $empire->query("delete from " . GetDoTemptb("enewstempvar", $gid) . " where varid='{$varid}'");
    //删除备份记录
    DelEbakTempAll('tempvar', $gid, $varid);
    if ($sql) {
        //操作日志
        insert_dolog("varid=" . $varid . "<br>var=" . $r[myvar] . "&gid={$gid}");
        printerror("DelTempvarSuccess", "ListTempvar.php?classid={$cid}&gid={$gid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #4
0
function DelMSearchtemp($tempid, $add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $tempid;
    if (!$tempid) {
        printerror("NotDelTemplateid", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $tr = $empire->fetch1("select tempname,isdefault from " . GetDoTemptb("enewssearchtemp", $gid) . " where tempid='{$tempid}'");
    if ($tr[isdefault]) {
        printerror("NotDelDefaultTemp", "history.go(-1)");
    }
    $sql = $empire->query("delete from " . GetDoTemptb("enewssearchtemp", $gid) . " where tempid='{$tempid}'");
    $usql = $empire->query("update {$dbtbpre}enewsclass set searchtempid=0 where searchtempid='{$tempid}'");
    GetClass();
    //删除备份记录
    DelEbakTempAll('searchtemp', $gid, $tempid);
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $tempid . "<br>tempname=" . $tr[tempname] . "&gid={$gid}");
        printerror("DelMSearchTempSuccess", "ListSearchtemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #5
0
파일: ListBqtemp.php 프로젝트: novnan/meiju
function DelBqtemp($tempid, $add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $tempid;
    if (!$tempid) {
        printerror("NotDelTemplateid", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $r = $empire->fetch1("select tempname from " . GetDoTemptb("enewsbqtemp", $gid) . " where tempid='{$tempid}'");
    //删除模板
    $sql = $empire->query("delete from " . GetDoTemptb("enewsbqtemp", $gid) . " where tempid='{$tempid}'");
    //删除模板备份
    DelEbakTempAll('bqtemp', $gid, $tempid);
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $tempid . "<br>tempname=" . $r[tempname] . "&gid={$gid}");
        printerror("DelBqtempSuccess", "ListBqtemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #6
0
function DelIndexpage($tempid,$userid,$username){
	global $empire,$dbtbpre,$public_r;
	$tempid=(int)$tempid;
	if(empty($tempid))
	{
		printerror("NotChangeIndexpageid","history.go(-1)");
	}
	//验证权限
	CheckLevel($userid,$username,$classid,"template");
	$gid=(int)$_GET['gid'];
	$r=$empire->fetch1("select tempname from {$dbtbpre}enewsindexpage where tempid='$tempid'");
	$sql=$empire->query("delete from {$dbtbpre}enewsindexpage where tempid='$tempid'");
	if($tempid==$public_r['indexpageid'])
	{
		$empire->query("update {$dbtbpre}enewspublic set indexpageid=0");
		GetConfig();//更新缓存
	}
	//删除备份记录
	DelEbakTempAll('indexpage',1,$tempid);
	//刷新首页
	if($tempid==$public_r['indexpageid'])
	{
		$indextempr=$empire->fetch1("select indextemp from ".GetTemptb("enewspubtemp")." limit 1");
		$indextemp=$indextempr['indextemp'];
		NewsBq($classid,$indextemp,1,0);
		//删除动态模板缓存文件
		DelOneTempTmpfile('indexpage');
	}
	if($sql)
	{
		//操作日志
		insert_dolog("tempid=$tempid&tempname=$r[tempname]");
		printerror("DelIndexpageSuccess","ListIndexpage.php?gid=$gid".hReturnEcmsHashStrHref2(0));
	}
	else
	{
		printerror("DbError","history.go(-1)");
	}
}
예제 #7
0
function DelPrintTemp($add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $tempid = (int) $add[tempid];
    if (empty($tempid)) {
        printerror("NotChangePrintTempid", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $r = $empire->fetch1("select tempname,isdefault from " . GetDoTemptb("enewsprinttemp", $gid) . " where tempid={$tempid}");
    if ($r['isdefault']) {
        printerror("NotDelDefPrintTempid", "history.go(-1)");
    }
    $sql = $empire->query("delete from " . GetDoTemptb("enewsprinttemp", $gid) . " where tempid={$tempid}");
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        DelFiletext(ECMS_PATH . DASHBOARD . '/data/filecache/template/print' . $tempid . '.php');
    }
    //删除备份记录
    DelEbakTempAll('printtemp', $gid, $tempid);
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$r['tempname']}&gid={$gid}");
        printerror("DelPrintTempSuccess", "ListPrinttemp.php?gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #8
0
function DelListtemp($tempid, $add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $tempid = (int) $tempid;
    if (!$tempid) {
        printerror("NotDelTemplateid", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $tr = $empire->fetch1("select tempname from " . GetDoTemptb("enewslisttemp", $gid) . " where tempid='{$tempid}'");
    $sql = $empire->query("delete from " . GetDoTemptb("enewslisttemp", $gid) . " where tempid='{$tempid}'");
    //删除备份记录
    DelEbakTempAll('listtemp', $gid, $tempid);
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        //删除动态模板缓存文件
        DelOneTempTmpfile('list' . $tempid);
    }
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $tempid . "<br>tempname=" . $tr[tempname] . "&gid={$gid}");
        printerror("DelListTempSuccess", "ListListtemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #9
0
function DelNewsTemp($tempid, $add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $tempid = (int) $tempid;
    if (!$tempid) {
        printerror("NotDelTemplateid", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $r = $empire->fetch1("select tempname,modid from " . GetDoTemptb("enewsnewstemp", $gid) . " where tempid='{$tempid}'");
    $dotempname = $r['tempname'];
    $sql = $empire->query("delete from " . GetDoTemptb("enewsnewstemp", $gid) . " where tempid='{$tempid}'");
    //将信息设为未生成
    $mr = $empire->fetch1("select tbname from {$dbtbpre}enewsmod where mid='{$r['modid']}'");
    //$usql=$empire->query("update {$dbtbpre}ecms_".$mr[tbname]." set havehtml=0 where newstempid='$tempid'");
    //删除备份
    DelEbakTempAll('newstemp', $gid, $tempid);
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        //删除动态模板缓存文件
        DelOneTempTmpfile('text' . $tempid);
    }
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $tempid . "<br>tempname=" . $dotempname . "&gid={$gid}");
        printerror("DelNewsTempSuccess", "ListNewstemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #10
0
function DelJstemp($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $add['tempid'];
    if (!$tempid) {
        printerror("EmptyJstempid", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $r = $empire->fetch1("select tempname from " . GetDoTemptb("enewsjstemp", $gid) . " where tempid={$tempid}");
    $sql = $empire->query("delete from " . GetDoTemptb("enewsjstemp", $gid) . " where tempid={$tempid}");
    //删除备份记录
    DelEbakTempAll('jstemp', $gid, $tempid);
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$r['tempname']}&gid={$gid}");
        printerror("DelJstempSuccess", "ListJstemp.php?classid={$add['cid']}&gid={$gid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
예제 #11
0
function DelPagetemp($add,$userid,$username){
	global $empire,$dbtbpre;
	$tempid=(int)$add['tempid'];
	if(!$tempid)
	{
		printerror("EmptyPagetempid","history.go(-1)");
    }
	//验证权限
	CheckLevel($userid,$username,$classid,"template");
	$gid=(int)$add['gid'];
	$r=$empire->fetch1("select tempname from ".GetDoTemptb("enewspagetemp",$gid)." where tempid='$tempid'");
	$sql=$empire->query("delete from ".GetDoTemptb("enewspagetemp",$gid)." where tempid='$tempid'");
	//删除备份记录
	DelEbakTempAll('pagetemp',$gid,$tempid);
	if($sql)
	{
		//操作日志
		insert_dolog("tempid=$tempid&tempname=$r[tempname]&gid=$gid");
		printerror("DelPagetempSuccess","ListPagetemp.php?gid=$gid".hReturnEcmsHashStrHref2(0));
	}
	else
	{
		printerror("DbError","history.go(-1)");
	}
}