Exemplo n.º 1
0
function EditJstemp($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $add['tempid'];
    if (!$tempid || !$add[tempname] || !$add[temptext]) {
        printerror("EmptyJstempname", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $add[tempname] = hRepPostStr($add[tempname], 1);
    $modid = (int) $add['modid'];
    $classid = (int) $add['classid'];
    $subnews = (int) $add['subnews'];
    $subtitle = (int) $add['subtitle'];
    $add[temptext] = str_replace("\r\n", "", $add[temptext]);
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewsjstemp", $gid) . " set tempname='{$add['tempname']}',temptext='" . eaddslashes2($add[temptext]) . "',classid={$classid},showdate='{$add['showdate']}',modid='{$modid}',subnews='{$subnews}',subtitle='{$subtitle}' where tempid={$tempid}");
    //备份模板
    AddEBakTemp('jstemp', $gid, $tempid, $add[tempname], $add[temptext], $subnews, 0, '', 0, $modid, $add[showdate], $subtitle, $classid, 0, $userid, $username);
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$add['tempname']}&gid={$gid}");
        printerror("EditJstempSuccess", "ListJstemp.php?classid={$add['cid']}&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 2
0
function EditBqtemp($tempid, $tempname, $modid, $subnews, $rownum, $showdate, $temptext, $listvar, $add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $tempid;
    if (!$tempname || !$temptext || !$modid || !$listvar || !$tempid) {
        printerror("EmptyTempname", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $classid = (int) $add['classid'];
    $tempname = hRepPostStr($tempname, 1);
    $temptext = RepPhpAspJspcode($temptext);
    $listvar = RepPhpAspJspcode($listvar);
    if ($add['autorownum']) {
        $rownum = substr_count($temptext, '<!--list.var');
    }
    //变量处理
    $modid = (int) $modid;
    $subnews = (int) $subnews;
    $rownum = (int) $rownum;
    $docode = (int) $add[docode];
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewsbqtemp", $gid) . " set tempname='{$tempname}',temptext='" . eaddslashes2($temptext) . "',modid={$modid},showdate='{$showdate}',listvar='" . eaddslashes2($listvar) . "',subnews={$subnews},rownum={$rownum},classid={$classid},docode='{$docode}' where tempid='{$tempid}'");
    //备份模板
    AddEBakTemp('bqtemp', $gid, $tempid, $tempname, $temptext, $subnews, 0, $listvar, $rownum, $modid, $showdate, 0, $classid, $docode, $userid, $username);
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $tempid . "<br>tempname=" . $tempname . "&gid={$gid}");
        printerror("EditBqtempSuccess", "ListBqtemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 3
0
function EditMSearchtemp($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[tempid] = (int) $add[tempid];
    if (!$add[tempname] || !$add[temptext] || !$add[listvar] || !$add[modid] || !$add[tempid]) {
        printerror("EmptySearchTempname", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $classid = (int) $add['classid'];
    $add[temptext] = RepPhpAspJspcode($add[temptext]);
    $add[listvar] = RepPhpAspJspcode($add[listvar]);
    if ($add['autorownum']) {
        $add[rownum] = substr_count($add[temptext], '<!--list.var');
    }
    //变量处理
    $add[subnews] = (int) $add[subnews];
    $add[rownum] = (int) $add[rownum];
    $add[modid] = (int) $add[modid];
    $add[subtitle] = (int) $add[subtitle];
    $docode = (int) $add[docode];
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewssearchtemp", $gid) . " set subnews={$add['subnews']},tempname='{$add['tempname']}',temptext='" . addslashes($add[temptext]) . "',listvar='" . addslashes($add[listvar]) . "',rownum={$add['rownum']},modid={$add['modid']},showdate='{$add['showdate']}',subtitle={$add['subtitle']},classid={$classid},docode='{$docode}' where tempid='{$add['tempid']}'");
    //备份模板
    AddEBakTemp('searchtemp', $gid, $add[tempid], $add[tempname], $add[temptext], $add[subnews], 0, $add[listvar], $add[rownum], $add[modid], $add[showdate], $add[subtitle], $classid, $docode, $userid, $username);
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $add[tempid] . "<br>tempname=" . $add[tempname] . "&gid={$gid}");
        printerror("EditMSearchTempSuccess", "ListSearchtemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 4
0
function EditPrintTemp($add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $tempid = (int) $add[tempid];
    if (!$tempid || !$add[tempname] || !$add[temptext]) {
        printerror("EmptyPrintTemp", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $add[tempname] = hRepPostStr($add[tempname], 1);
    $add[temptext] = RepPhpAspJspcode($add[temptext]);
    $add[modid] = (int) $add[modid];
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewsprinttemp", $gid) . " set tempname='" . $add[tempname] . "',temptext='" . eaddslashes2($add[temptext]) . "',showdate='{$add['showdate']}',modid='{$add['modid']}' where tempid='{$tempid}'");
    //备份模板
    AddEBakTemp('printtemp', $gid, $tempid, $add[tempname], $add[temptext], 0, 0, '', 0, $add[modid], $add[showdate], 0, 0, 0, $userid, $username);
    //更新页面
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        GetPrintPage($tempid);
    }
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$add['tempname']}&gid={$gid}");
        printerror("EditPrintTempSuccess", "ListPrinttemp.php?gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 5
0
function EditIndexpage($add,$userid,$username){
	global $empire,$dbtbpre,$public_r;
	$tempid=(int)$add[tempid];
	if(!$tempid||!$add[tempname]||!$add[temptext])
	{
		printerror("EmptyIndexpageName","history.go(-1)");
	}
	//验证权限
	CheckLevel($userid,$username,$classid,"template");
	$gid=(int)$add['gid'];
	$add[tempname]=hRepPostStr($add[tempname],1);
	$add[temptext]=RepPhpAspJspcode($add[temptext]);
	$sql=$empire->query("update {$dbtbpre}enewsindexpage set tempname='".$add[tempname]."',temptext='".eaddslashes2($add[temptext])."' where tempid='$tempid'");
	//备份模板
	AddEBakTemp('indexpage',1,$tempid,$add[tempname],$add[temptext],0,0,'',0,0,'',0,0,0,$userid,$username);
	//刷新首页
	if($tempid==$public_r['indexpageid'])
	{
		NewsBq($classid,eaddslashes($add[temptext]),1,0);
		//删除动态模板缓存文件
		DelOneTempTmpfile('indexpage');
	}
	if($sql)
	{
		//操作日志
		insert_dolog("tempid=$tempid&tempname=$add[tempname]");
		printerror("EditIndexpageSuccess","ListIndexpage.php?gid=$gid".hReturnEcmsHashStrHref2(0));
	}
	else
	{
		printerror("DbError","history.go(-1)");
	}
}
Exemplo n.º 6
0
function EditTempvar($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[varid] = (int) $add['varid'];
    if (!$add[varid] || !$add[myvar] || !$add[varvalue] || !$add[varname]) {
        printerror("EmptyTempvar", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "tempvar");
    $add[varvalue] = RepPhpAspJspcode($add[varvalue]);
    $classid = (int) $add[classid];
    $isclose = (int) $add[isclose];
    $add[myorder] = (int) $add[myorder];
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewstempvar", $gid) . " set myvar='{$add['myvar']}',varname='{$add['varname']}',varvalue='" . addslashes($add[varvalue]) . "',classid={$classid},isclose={$isclose},myorder={$add['myorder']} where varid='{$add['varid']}'");
    //备份模板
    AddEBakTemp('tempvar', $gid, $add[varid], $add[myvar], $add[varvalue], $add[myorder], 0, $add[varname], 0, 0, '', 0, $classid, $isclose, $userid, $username);
    if ($sql) {
        //操作日志
        insert_dolog("varid=" . $add[varid] . "<br>var=" . $add[myvar] . "&gid={$gid}");
        printerror("EditTempvarSuccess", "ListTempvar.php?classid={$add['cid']}&gid={$gid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 7
0
function EditNewsTemplate($add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $add[tempid] = (int) $add[tempid];
    if (!$add[tempid] || !$add[tempname] || !$add[temptext] || !$add[modid]) {
        printerror("EmptyTempname", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $classid = (int) $add['classid'];
    $add[tempname] = hRepPostStr($add[tempname], 1);
    $add[temptext] = RepPhpAspJspcode($add[temptext]);
    $add[temptext] = RepTemplateJsUrl($add[temptext], 1, 0);
    //替换JS地址
    $add[modid] = (int) $add[modid];
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewsnewstemp", $gid) . " set tempname='{$add['tempname']}',temptext='" . eaddslashes2($add[temptext]) . "',showdate='{$add['showdate']}',modid={$add['modid']},classid={$classid} where tempid='{$add['tempid']}'");
    //将信息设为未生成
    $mr = $empire->fetch1("select tbname from {$dbtbpre}enewsmod where mid='{$add['modid']}'");
    //$usql=$empire->query("update {$dbtbpre}ecms_".$mr[tbname]." set havehtml=0 where newstempid='$add[tempid]'");
    //备份模板
    AddEBakTemp('newstemp', $gid, $add[tempid], $add[tempname], $add[temptext], 0, 0, '', 0, $add[modid], $add[showdate], 0, $classid, 0, $userid, $username);
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        //删除动态模板缓存文件
        DelOneTempTmpfile('text' . $add[tempid]);
    }
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $add[tempid] . "<br>tempname=" . $add[tempname] . "&gid={$gid}");
        printerror("EditNewsTempSuccess", "ListNewstemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 8
0
function EditPagetemp($add,$userid,$username){
	global $empire,$dbtbpre;
	$tempid=(int)$add['tempid'];
	if(!$tempid||!$add[tempname]||!$add[temptext])
	{
		printerror("EmptyPagetempname","history.go(-1)");
    }
	//验证权限
	CheckLevel($userid,$username,$classid,"template");
	$gid=(int)$add['gid'];
	$add[tempname]=hRepPostStr($add[tempname],1);
	$add[temptext]=RepPhpAspJspcode($add[temptext]);
	$sql=$empire->query("update ".GetDoTemptb("enewspagetemp",$gid)." set tempname='$add[tempname]',temptext='".eaddslashes2($add[temptext])."' where tempid='$tempid'");
	//备份模板
	AddEBakTemp('pagetemp',$gid,$tempid,$add[tempname],$add[temptext],0,0,'',0,0,'',0,0,0,$userid,$username);
	if($sql)
	{
		//操作日志
		insert_dolog("tempid=$tempid&tempname=$add[tempname]&gid=$gid");
		printerror("EditPagetempSuccess","ListPagetemp.php?gid=$gid".hReturnEcmsHashStrHref2(0));
	}
	else
	{
		printerror("DbError","history.go(-1)");
	}
}
Exemplo n.º 9
0
function EditClasstemp($add,$userid,$username){
	global $empire,$dbtbpre,$public_r;
	$tempid=(int)$add['tempid'];
	if(!$tempid||!$add[tempname]||!$add[temptext])
	{
		printerror("EmptyClasstempname","history.go(-1)");
    }
	//验证权限
	CheckLevel($userid,$username,$classid,"template");
	$classid=(int)$add['classid'];
	$gid=(int)$add['gid'];
	$add[tempname]=hRepPostStr($add[tempname],1);
	$add[temptext]=RepPhpAspJspcode($add[temptext]);
	$sql=$empire->query("update ".GetDoTemptb("enewsclasstemp",$gid)." set tempname='$add[tempname]',temptext='".eaddslashes2($add[temptext])."',classid=$classid where tempid=$tempid");
	//备份模板
	AddEBakTemp('classtemp',$gid,$tempid,$add[tempname],$add[temptext],0,0,'',0,0,'',0,$classid,0,$userid,$username);
	if($gid==$public_r['deftempid']||(!$public_r['deftempid']&&($gid==1||$gid==0)))
	{
		//删除动态模板缓存文件
		DelOneTempTmpfile('classtemp'.$tempid);
	}
	if($sql)
	{
		//操作日志
		insert_dolog("tempid=$tempid&tempname=$add[tempname]&gid=$gid");
		printerror("EditClasstempSuccess","ListClasstemp.php?classid=$add[cid]&gid=$gid".hReturnEcmsHashStrHref2(0));
	}
	else
	{
		printerror("DbError","history.go(-1)");
	}
}
Exemplo n.º 10
0
function EditVoteTemp($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $add[tempid];
    if (!$tempid || !$add[tempname] || !$add[temptext]) {
        printerror("EmptyVoteTempname", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewsvotetemp", $gid) . " set tempname='" . $add[tempname] . "',temptext='" . addslashes($add[temptext]) . "' where tempid='{$tempid}'");
    //备份模板
    AddEBakTemp('votetemp', $gid, $tempid, $add[tempname], $add[temptext], 0, 0, '', 0, 0, '', 0, 0, 0, $userid, $username);
    if ($sql) {
        //操作日志
        insert_dolog("tempid={$tempid}&tempname={$add['tempname']}&gid={$gid}");
        printerror("EditVoteTempSuccess", "ListVotetemp.php?gid={$gid}");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 11
0
function EditListtemp($add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    $add[tempid] = (int) $add[tempid];
    if (!$add[tempname] || !$add[temptext] || !$add[listvar] || !$add[modid] || !$add[tempid]) {
        printerror("EmptyListTempname", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "template");
    $classid = (int) $add['classid'];
    $add[tempname] = hRepPostStr($add[tempname], 1);
    $add[temptext] = RepPhpAspJspcode($add[temptext]);
    $add[listvar] = RepPhpAspJspcode($add[listvar]);
    if ($add['autorownum']) {
        $add[rownum] = substr_count($add[temptext], '<!--list.var');
    }
    $add[subnews] = (int) $add[subnews];
    $add[rownum] = (int) $add[rownum];
    $add[modid] = (int) $add[modid];
    $add[subtitle] = (int) $add[subtitle];
    $docode = (int) $add[docode];
    $gid = (int) $add['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewslisttemp", $gid) . " set subnews={$add['subnews']},tempname='{$add['tempname']}',temptext='" . eaddslashes2($add[temptext]) . "',listvar='" . eaddslashes2($add[listvar]) . "',rownum={$add['rownum']},modid={$add['modid']},showdate='{$add['showdate']}',subtitle={$add['subtitle']},classid={$classid},docode='{$docode}' where tempid='{$add['tempid']}'");
    //备份模板
    AddEBakTemp('listtemp', $gid, $add[tempid], $add[tempname], $add[temptext], $add[subnews], 0, $add[listvar], $add[rownum], $add[modid], $add[showdate], $add[subtitle], $classid, $docode, $userid, $username);
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        //删除动态模板缓存文件
        DelOneTempTmpfile('list' . $add[tempid]);
    }
    if ($sql) {
        //操作日志
        insert_dolog("tempid=" . $add[tempid] . "<br>tempname=" . $add[tempname] . "&gid={$gid}");
        printerror("EditListTempSuccess", "ListListtemp.php?classid={$add['cid']}&modid={$add['mid']}&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 12
0
function EditIndextemp($temptext, $userid, $username)
{
    global $empire, $dbtbpre, $public_r;
    if (!$temptext) {
        printerror("EmptyIndexTemp", "history.go(-1)");
    }
    CheckLevel($userid, $username, $classid, "template");
    //操作权限
    $temptext = RepPhpAspJspcode($temptext);
    $gid = (int) $_POST['gid'];
    $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set indextemp='" . eaddslashes2($temptext) . "'");
    //备份模板
    AddEBakTemp('pubindextemp', $gid, 1, '', $temptext, 0, 0, '', 0, 0, '', 0, 0, 0, $userid, $username);
    //刷新首页
    if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
        NewsBq($classid, eaddslashes($temptext), 1, 0);
        //删除动态模板缓存文件
        DelOneTempTmpfile('indexpage');
    }
    if ($sql) {
        insert_dolog("gid={$gid}");
        //操作日志
        printerror("EditPublicTempSuccess", "template/EditPublicTemp.php?tname=indextemp&gid={$gid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}