Esempio n. 1
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)");
    }
}
Esempio n. 2
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)");
	}
}
Esempio n. 3
0
function DoPostInfoTypeVar($add){
	if(empty($add['ttype']))
	{
		$add['ttype']='.html';
	}
	$add['tname']=eaddslashes(ehtmlspecialchars($add['tname']));
	$add['mid']=(int)$add['mid'];
	$add['myorder']=(int)$add['myorder'];
	$add['yhid']=(int)$add['yhid'];
	$add['tnum']=(int)$add['tnum'];
	$add['listtempid']=(int)$add['listtempid'];
	$add['maxnum']=(int)$add['maxnum'];
	$add['reorder']=RepPostVar2($add['reorder']);
	$add['intro']=eaddslashes(RepPhpAspJspcode($add['intro']));
	$add['pagekey']=eaddslashes(RepPhpAspJspcode($add['pagekey']));
	$add['newline']=(int)$add['newline'];
	$add['hotline']=(int)$add['hotline'];
	$add['goodline']=(int)$add['goodline'];
	$add['hotplline']=(int)$add['hotplline'];
	$add['firstline']=(int)$add['firstline'];
	$add['jstempid']=(int)$add['jstempid'];
	$add['nrejs']=(int)$add['nrejs'];
	$add['listdt']=(int)$add['listdt'];
	$add['repagenum']=(int)$add['repagenum'];
	//目录
	$add['tpath']=trim($add['tpath']);
	$add['tpath']=$add['pripath'].$add['tpath'];
	$add['tpath']=eaddslashes($add['tpath']);
	return $add;
}
Esempio n. 4
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)");
	}
}
Esempio n. 5
0
function EditPubVar($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[varid] = (int) $add['varid'];
    $add[myvar] = RepPostVar($add[myvar]);
    if (!$add[varid] || !$add[myvar] || !$add[varname]) {
        printerror("EmptyPubVar", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "pubvar");
    if ($add[myvar] != $add[oldmyvar]) {
        $num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewspubvar where myvar='{$add['myvar']}' and varid<>{$add['varid']} limit 1");
        if ($num) {
            printerror("RePubVar", "history.go(-1)");
        }
    }
    $add[varvalue] = AddAddsData(RepPhpAspJspcode($add[varvalue]));
    $classid = (int) $add[classid];
    $tocache = (int) $add[tocache];
    $add[myorder] = (int) $add[myorder];
    $sql = $empire->query("update {$dbtbpre}enewspubvar set myvar='{$add['myvar']}',varname='{$add['varname']}',varvalue='" . $add[varvalue] . "',varsay='{$add['varsay']}',myorder='{$add['myorder']}',classid='{$classid}',tocache='{$tocache}' where varid='{$add['varid']}'");
    if ($tocache || $add['oldtocache']) {
        GetConfig();
    }
    if ($sql) {
        //操作日志
        insert_dolog("varid=" . $add[varid] . "<br>var=" . $add[myvar]);
        printerror("EditPubVarSuccess", "ListPubVar.php?classid={$add['cid']}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Esempio n. 6
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)");
	}
}
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)");
    }
}
Esempio n. 8
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)");
    }
}
Esempio n. 9
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)");
    }
}
Esempio n. 10
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)");
    }
}
Esempio n. 11
0
function DoPostZtTypeVar($add)
{
    if (empty($add['ttype'])) {
        $add['ttype'] = '.html';
    }
    $add['cname'] = eaddslashes(ehtmlspecialchars($add['cname']));
    $add['myorder'] = (int) $add['myorder'];
    $add['islist'] = (int) $add['islist'];
    $add['listtempid'] = (int) $add['listtempid'];
    $add['maxnum'] = (int) $add['maxnum'];
    $add['tnum'] = (int) $add['tnum'];
    $add['reorder'] = RepPostVar2($add['reorder']);
    $add['classtext'] = RepPhpAspJspcode($add['classtext']);
    return $add;
}
Esempio n. 12
0
function EditNotcj($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //验证权限
    CheckLevel($userid, $username, $classid, "notcj");
    $id = (int) $add['id'];
    if (empty($add[word]) || !$id) {
        printerror("EmptyNotcjWord", "history.go(-1)");
    }
    $word = RepPhpAspJspcode($add[word]);
    $sql = $empire->query("update {$dbtbpre}enewsnotcj set word='" . addslashes($word) . "' where id='{$id}'");
    GetNotcj();
    if ($sql) {
        //操作日志
        insert_dolog("id={$id}");
        printerror("EditNotcjSuccess", "NotCj.php");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Esempio n. 13
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)");
    }
}
Esempio n. 14
0
function EditUserpage($add,$userid,$username){
	global $empire,$dbtbpre;
	//操作权限
	CheckLevel($userid,$username,$classid,"userpage");
	$id=(int)$add['id'];
	$classid=(int)$add[classid];
	$title=$add['title'];
	$path=$add['path'];
	$pagetext=$add['pagetext'];
	if(!$id||empty($title)||empty($path))
	{
		printerror("EmptyUserpagePath","history.go(-1)");
    }
	//改变地址
	if($add['oldpath']<>$path)
	{
		DelFiletext($add['oldpath']);
	}
	$pagetext=RepPhpAspJspcode($pagetext);
	$pagetitle=RepPhpAspJspcode($add[pagetitle]);
	$pagekeywords=RepPhpAspJspcode($add[pagekeywords]);
	$pagedescription=RepPhpAspJspcode($add[pagedescription]);
	$tempid=(int)$add['tempid'];
	$gid=(int)$add['gid'];
	$sql=$empire->query("update {$dbtbpre}enewspage set title='$title',path='$path',pagetext='".eaddslashes2($pagetext)."',classid='$classid',pagetitle='".eaddslashes($pagetitle)."',pagekeywords='".eaddslashes($pagekeywords)."',pagedescription='".eaddslashes($pagedescription)."',tempid='$tempid' where id='$id'");
	ReUserpage($id,$pagetext,$path,$title,$pagetitle,$pagekeywords,$pagedescription,$tempid);
	if($sql)
	{
		//操作日志
	    insert_dolog("id=$id&title=$title");
		printerror("EditUserpageSuccess","template/ListPage.php?classid=$add[cid]&gid=$gid".hReturnEcmsHashStrHref2(0));
	}
	else
	{
		printerror("DbError","history.go(-1)");
	}
}
Esempio n. 15
0
function DoPostClassVar($add)
{
    if (empty($add[classtype])) {
        $add[classtype] = ".html";
    }
    $add[classname] = addslashes(htmlspecialchars($add[classname]));
    $add[intro] = addslashes(RepPhpAspJspcode($add[intro]));
    $add[classpagekey] = addslashes(RepPhpAspJspcode($add[classpagekey]));
    //过滤字符
    $add[listorder] = RepPostVar2($add[listorder]);
    $add[reorder] = RepPostVar2($add[reorder]);
    //处理变量
    $add[jstempid] = (int) $add['jstempid'];
    $add[bclassid] = (int) $add[bclassid];
    $add[link_num] = (int) $add[link_num];
    $add[newstempid] = (int) $add[newstempid];
    $add[islast] = (int) $add[islast];
    $add[filename] = (int) $add[filename];
    $add[openpl] = (int) $add[openpl];
    $add[openadd] = (int) $add[openadd];
    $add[newline] = (int) $add[newline];
    $add[hotline] = (int) $add[hotline];
    $add[goodline] = (int) $add[goodline];
    $add[groupid] = (int) $add[groupid];
    $add[hotplline] = (int) $add[hotplline];
    $add[modid] = (int) $add[modid];
    $add[checked] = (int) $add[checked];
    $add[firstline] = (int) $add[firstline];
    $add[islist] = (int) $add[islist];
    $add[searchtempid] = (int) $add[searchtempid];
    $add[checkpl] = (int) $add[checkpl];
    $add[down_num] = (int) $add[down_num];
    if (empty($add[down_num])) {
        $add[down_num] = 1;
    }
    $add[online_num] = (int) $add[online_num];
    if (empty($add[online_num])) {
        $add[online_num] = 1;
    }
    $add[addinfofen] = (int) $add[addinfofen];
    $add[listdt] = (int) $add[listdt];
    $add[showdt] = (int) $add[showdt];
    $add[maxnum] = (int) $add[maxnum];
    $add[showclass] = (int) $add[showclass];
    $add[checkqadd] = (int) $add[checkqadd];
    $add[qaddlist] = (int) $add[qaddlist];
    $add[qaddgroupid] = DoPostClassQAddGroupid($add[qaddgroupidck]);
    $add[qaddshowkey] = (int) $add[qaddshowkey];
    $add[adminqinfo] = (int) $add[adminqinfo];
    $add[doctime] = (int) $add[doctime];
    $add[nreclass] = (int) $add[nreclass];
    $add[nreinfo] = (int) $add[nreinfo];
    $add[nrejs] = (int) $add[nrejs];
    $add[nottobq] = (int) $add[nottobq];
    $add[lencord] = (int) $add[lencord];
    $add[listtempid] = (int) $add[listtempid];
    $add[dtlisttempid] = (int) $add[dtlisttempid];
    $add[classtempid] = (int) $add[classtempid];
    if (empty($add[bname])) {
        $add[bname] = $add[classname];
    }
    $add[myorder] = (int) $add[myorder];
    if ($add[infopath] == 0) {
        $add[ipath] = '';
    }
    $add[addreinfo] = (int) $add[addreinfo];
    $add[haddlist] = (int) $add[haddlist];
    $add[sametitle] = (int) $add[sametitle];
    $add[definfovoteid] = (int) $add[definfovoteid];
    $add[qeditchecked] = (int) $add[qeditchecked];
    $add[wapstyleid] = (int) $add[wapstyleid];
    $add[repreinfo] = (int) $add[repreinfo];
    $add[pltempid] = (int) $add[pltempid];
    $add[classtext] = RepPhpAspJspcode($add[classtext]);
    $add[yhid] = (int) $add[yhid];
    $add[wfid] = (int) $add[wfid];
    if ($add['islist'] == 3) {
        $add['bdinfoid'] = RepPostVar($add['bdinfoid']);
    } else {
        $add['bdinfoid'] = '';
    }
    //设置访问权限
    $add[cgroupid] = DoPostClassQAddGroupid($add[cgroupidck]);
    $add[cgtoinfo] = (int) $add[cgtoinfo];
    if ($add[cgroupid]) {
        $add[classtype] = '.php';
        if ($add[cgtoinfo]) {
            $add[filetype] = '.php';
        }
    } else {
        $add[cgtoinfo] = 0;
    }
    return $add;
}
Esempio n. 16
0
function EditUserlist($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $cid = (int) $add['cid'];
    $listid = (int) $add['listid'];
    $listtempid = (int) $add['listtempid'];
    $maxnum = (int) $add['maxnum'];
    $lencord = (int) $add['lencord'];
    if (!$listid || !$add[listname] || !$listtempid || !$add[listsql] || !$add[totalsql] || !$add[filepath] || !$add[filetype] || !$add[lencord]) {
        printerror("EmptyUserListname", "history.go(-1)");
    }
    $query_first = substr($add['totalsql'], 0, 7);
    $query_firstlist = substr($add['listsql'], 0, 7);
    if (!($query_first == "select " || $query_first == "SELECT " || $query_firstlist == "select " || $query_firstlist == "SELECT ")) {
        printerror("ListSqlError", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "userlist");
    /*
    //删除旧文件
    if(!($add['oldfilepath']<>$add['filepath']||$add['oldfiletype']<>$add['filetype']))
    {
    	DelFiletext($add['oldjsfilename']);
    }
    */
    if (empty($add['pagetitle'])) {
        $add['pagetitle'] = $add['listname'];
    }
    $add['listname'] = ehtmlspecialchars($add['listname']);
    $add['pagetitle'] = AddAddsData(RepPhpAspJspcode($add['pagetitle']));
    $add['pagekeywords'] = AddAddsData(RepPhpAspJspcode($add['pagekeywords']));
    $add['pagedescription'] = AddAddsData(RepPhpAspJspcode($add['pagedescription']));
    $add[totalsql] = ClearAddsData($add[totalsql]);
    $add[listsql] = ClearAddsData($add[listsql]);
    $add['classid'] = (int) $add['classid'];
    $sql = $empire->query("update {$dbtbpre}enewsuserlist set listname='{$add['listname']}',pagetitle='{$add['pagetitle']}',filepath='{$add['filepath']}',filetype='{$add['filetype']}',totalsql='" . addslashes($add['totalsql']) . "',listsql='" . addslashes($add['listsql']) . "',maxnum={$maxnum},lencord={$lencord},listtempid={$listtempid},pagekeywords='{$add['pagekeywords']}',pagedescription='{$add['pagedescription']}',classid='{$add['classid']}' where listid={$listid}");
    //刷新列表
    ReUserlist($add, "../");
    if ($sql) {
        //操作日志
        insert_dolog("listid={$listid}&listname={$add['listname']}");
        printerror("EditUserlistSuccess", "ListUserlist.php?classid={$cid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Esempio n. 17
0
function DoRepTemp($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $oldword = RepPhpAspJspcode(eaddslashes2($add['oldword']));
    $newword = RepPhpAspJspcode(eaddslashes2($add['newword']));
    if (!$oldword) {
        printerror("EmptyRepTemp", "history.go(-1)");
    }
    $gid = (int) $add['gid'];
    //公共表
    if ($add['indextemp'] || $add['cptemp'] || $add['sformtemp'] || $add['otherlinktemp'] || $add['gbooktemp'] || $add['loginiframe'] || $add['pljstemp'] || $add['schalltemp'] || $add['loginjstemp'] || $add['downpagetemp']) {
        $set = '';
        //首页模板
        if ($add['indextemp']) {
            $set .= ",indextemp=REPLACE(indextemp,'" . $oldword . "','" . $newword . "')";
        }
        //控制面板模板
        if ($add['cptemp']) {
            $set .= ",cptemp=REPLACE(cptemp,'" . $oldword . "','" . $newword . "')";
        }
        //搜索表单模板
        if ($add['sformtemp']) {
            $set .= ",searchtemp=REPLACE(searchtemp,'" . $oldword . "','" . $newword . "')";
        }
        //相关信息模板
        if ($add['otherlinktemp']) {
            $set .= ",otherlinktemp=REPLACE(otherlinktemp,'" . $oldword . "','" . $newword . "')";
        }
        //留言板模板
        if ($add['gbooktemp']) {
            $set .= ",gbooktemp=REPLACE(gbooktemp,'" . $oldword . "','" . $newword . "')";
        }
        //登陆状态模板
        if ($add['loginiframe']) {
            $set .= ",loginiframe=REPLACE(loginiframe,'" . $oldword . "','" . $newword . "')";
        }
        //评论JS模板
        if ($add['pljstemp']) {
            $set .= ",pljstemp=REPLACE(pljstemp,'" . $oldword . "','" . $newword . "')";
        }
        //全站搜索模板
        if ($add['schalltemp']) {
            $set .= ",schalltemp=REPLACE(schalltemp,'" . $oldword . "','" . $newword . "')";
        }
        //JS调用登陆状态模板
        if ($add['loginjstemp']) {
            $set .= ",loginjstemp=REPLACE(loginjstemp,'" . $oldword . "','" . $newword . "')";
        }
        //最终下载页模板
        if ($add['downpagetemp']) {
            $set .= ",downpagetemp=REPLACE(downpagetemp,'" . $oldword . "','" . $newword . "')";
        }
        $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set id=1" . $set . " limit 1");
    }
    //修改栏目封面模板
    if ($add['classtemp']) {
        $empire->query("update " . GetDoTemptb("enewsclasstemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "')");
    }
    //修改标签模板
    if ($add['bqtemp']) {
        $empire->query("update " . GetDoTemptb("enewsbqtemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "'),listvar=REPLACE(listvar,'" . $oldword . "','" . $newword . "')");
    }
    //修改列表模板
    if ($add['listtemp']) {
        $empire->query("update " . GetDoTemptb("enewslisttemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "'),listvar=REPLACE(listvar,'" . $oldword . "','" . $newword . "')");
    }
    //修改内容模板
    if ($add['newstemp']) {
        $empire->query("update " . GetDoTemptb("enewsnewstemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "')");
    }
    //修改搜索模板
    if ($add['searchtemp']) {
        $empire->query("update " . GetDoTemptb("enewssearchtemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "'),listvar=REPLACE(listvar,'" . $oldword . "','" . $newword . "')");
    }
    //修改自定义页面
    if ($add['userpage']) {
        $empire->query("update {$dbtbpre}enewspage set pagetext=REPLACE(pagetext,'" . $oldword . "','" . $newword . "')");
    }
    //修改自定义页面模板
    if ($add['pagetemp']) {
        $empire->query("update " . GetDoTemptb("enewspagetemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "')");
    }
    //评论列表模板
    if ($add['pltemp']) {
        $empire->query("update " . GetDoTemptb("enewspltemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "')");
    }
    //打印模板
    if ($add['printtemp']) {
        $empire->query("update " . GetDoTemptb("enewsprinttemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "')");
    }
    //模板变量
    if ($add['tempvar']) {
        $empire->query("update " . GetDoTemptb("enewstempvar", $gid) . " set varvalue=REPLACE(varvalue,'" . $oldword . "','" . $newword . "')");
    }
    //修改JS模板
    if ($add['jstemp']) {
        $empire->query("update " . GetDoTemptb("enewsjstemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "')");
    }
    //修改投票模板
    if ($add['votetemp']) {
        $empire->query("update " . GetDoTemptb("enewsvotetemp", $gid) . " set temptext=REPLACE(temptext,'" . $oldword . "','" . $newword . "')");
    }
    //反馈表单模板
    if ($add['feedbackbtemp']) {
        $empire->query("update {$dbtbpre}enewsfeedbackclass set btemp=REPLACE(btemp,'" . $oldword . "','" . $newword . "')");
    }
    //操作日志
    insert_dolog("gid={$gid}");
    printerror("RepTempSuccess", "history.go(-1)");
}