Exemplo n.º 1
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.º 2
0
function EditMemberConnect($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[id] = (int) $add[id];
    if (empty($add[appname]) || !$add[id]) {
        printerror("EmptyMemberConnect", "history.go(-1)");
    }
    $add[isclose] = (int) $add[isclose];
    $add[myorder] = (int) $add[myorder];
    $add[appname] = eaddslashes(ehtmlspecialchars($add[appname]));
    $add[appid] = eaddslashes($add[appid]);
    $add[appkey] = eaddslashes($add[appkey]);
    $add[qappname] = eaddslashes($add[qappname]);
    $add[appsay] = eaddslashes($add[appsay]);
    $sql = $empire->query("update {$dbtbpre}enewsmember_connect_app set appname='{$add['appname']}',appid='{$add['appid']}',appkey='{$add['appkey']}',isclose='{$add['isclose']}',myorder='{$add['myorder']}',qappname='{$add['qappname']}',appsay='{$add['appsay']}' where id='{$add['id']}'");
    $appr = $empire->fetch1("select apptype from {$dbtbpre}enewsmember_connect_app where id='{$add['id']}'");
    if ($sql) {
        GetConfig();
        //操作日志
        insert_dolog("id=" . $add[id] . "&apptype=" . $appr[apptype] . "<br>appname=" . $add[appname]);
        printerror("EditMemberConnectSuccess", "MemberConnect.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 3
0
function EditLink($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[lid] = (int) $add[lid];
    if (!$add[lname] || !$add[lurl] || !$add[lid]) {
        printerror("EmptyLname", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "link");
    $add[lname] = hRepPostStr($add[lname], 1);
    $add[lpic] = hRepPostStr($add[lpic], 1);
    $add[lurl] = hRepPostStr($add[lurl], 1);
    $add[email] = hRepPostStr($add[email], 1);
    $add[onclick] = (int) $add[onclick];
    $add[myorder] = (int) $add[myorder];
    $add[ltype] = (int) $add[ltype];
    $add[checked] = (int) $add[checked];
    $add[classid] = (int) $add[classid];
    $add[cid] = (int) $add[cid];
    $sql = $empire->query("update {$dbtbpre}enewslink set lname='" . $add[lname] . "',lpic='" . $add[lpic] . "',lurl='" . $add[lurl] . "',onclick={$add['onclick']},width='{$add['width']}',height='{$add['height']}',target='{$add['target']}',myorder={$add['myorder']},email='" . $add[email] . "',lsay='" . eaddslashes($add[lsay]) . "',ltype={$add['ltype']},checked={$add['checked']},classid={$add['classid']} where lid='{$add['lid']}'");
    if ($sql) {
        //操作日志
        insert_dolog("lid=" . $add[lid] . "<br>lname=" . $add[lname]);
        printerror("EditLinkSuccess", "ListLink.php?classid={$add['cid']}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 4
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;
}
Exemplo n.º 5
0
function SetRewrite($add, $userid, $username)
{
    global $empire, $dbtbpre;
    CheckLevel($userid, $username, $classid, "public");
    //验证权限
    $sql = $empire->query("update {$dbtbpre}enewspublic set rewriteinfo='" . eaddslashes($add[rewriteinfo]) . "',rewriteclass='" . eaddslashes($add[rewriteclass]) . "',rewriteinfotype='" . eaddslashes($add[rewriteinfotype]) . "',rewritetags='" . eaddslashes($add[rewritetags]) . "',rewritepl='" . eaddslashes($add[rewritepl]) . "' limit 1");
    if ($sql) {
        GetConfig();
        //操作日志
        insert_dolog("");
        printerror("SetRewriteSuccess", "SetRewrite.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 6
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;
}
Exemplo n.º 7
0
function EditPlayer($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[id] = (int) $add[id];
    if (!$add[player] || !$add[filename] || !$add[id]) {
        printerror("EmptyPlayerName", "history.go(-1)");
    }
    CheckPlayerFilename($add[filename]);
    $add['player'] = hRepPostStr($add['player'], 1);
    $add['bz'] = hRepPostStr($add['bz'], 1);
    $sql = $empire->query("update {$dbtbpre}enewsplayer set player='" . $add['player'] . "',filename='" . eaddslashes($add[filename]) . "',bz='" . $add['bz'] . "' where id='{$add['id']}'");
    if ($sql) {
        //操作日志
        insert_dolog("id={$add['id']}<br>player={$add['player']}");
        printerror("EditPlayerSuccess", "player.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 8
0
function EditPs($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[pid] = (int) $add[pid];
    if (empty($add[pname]) || !$add[pid]) {
        printerror("EmptyPayname", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "shopps");
    $add[price] = (double) $add[price];
    $add['isclose'] = (int) $add['isclose'];
    $sql = $empire->query("update {$dbtbpre}enewsshopps set pname='" . eaddslashes($add[pname]) . "',price='{$add['price']}',otherprice='{$add['otherprice']}',psay='" . eaddslashes($add[psay]) . "',isclose='{$add['isclose']}' where pid='{$add['pid']}'");
    if ($sql) {
        //操作日志
        insert_dolog("pid=" . $add[pid] . "<br>pname=" . $add[pname]);
        printerror("EditPayfsSuccess", "ListPs.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 9
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='" . eaddslashes($word) . "' where id='{$id}'");
    GetNotcj();
    if ($sql) {
        //操作日志
        insert_dolog("id={$id}");
        printerror("EditNotcjSuccess", "NotCj.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 10
0
function EditWord($wordid, $oldword, $newword, $userid, $username)
{
    global $empire, $dbtbpre;
    if (!$oldword || !$wordid) {
        printerror("EmptyWord", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "word");
    $wordid = (int) $wordid;
    $sql = $empire->query("update {$dbtbpre}enewswords set oldword='" . eaddslashes($oldword) . "',newword='" . eaddslashes($newword) . "' where wordid='{$wordid}'");
    GetConfig();
    //更新缓存
    if ($sql) {
        //操作日志
        insert_dolog("wordid=" . $wordid);
        printerror("EditWordSuccess", "word.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 11
0
function SetPl($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //验证权限
    CheckLevel($userid, $username, $classid, "public");
    $add['pltime'] = (int) $add['pltime'];
    $add['plsize'] = (int) $add['plsize'];
    $add['plincludesize'] = (int) $add['plincludesize'];
    $add['plkey_ok'] = (int) $add['plkey_ok'];
    $add['plfacenum'] = (int) $add['plfacenum'];
    $add['plgroupid'] = (int) $add['plgroupid'];
    $add['pl_num'] = (int) $add['pl_num'];
    $add['plmaxfloor'] = (int) $add['plmaxfloor'];
    $sql = $empire->query("update {$dbtbpre}enewspl_set set pltime='{$add['pltime']}',plsize='{$add['plsize']}',plincludesize='{$add['plincludesize']}',plkey_ok='{$add['plkey_ok']}',plfacenum='{$add['plfacenum']}',plgroupid='{$add['plgroupid']}',plclosewords='" . eaddslashes($add[plclosewords]) . "',pl_num='{$add['pl_num']}',plurl='{$add['plurl']}',plmaxfloor='{$add['plmaxfloor']}',plquotetemp='" . eaddslashes2($add[plquotetemp]) . "' limit 1");
    GetConfig();
    //更新缓存
    if ($sql) {
        insert_dolog("");
        //操作日志
        printerror('SetPlSuccess', 'pl/SetPl.php' . hReturnEcmsHashStrHref2(1));
    } else {
        printerror('DbError', 'history.go(-1)');
    }
}
Exemplo n.º 12
0
function eaddslashes($string, $force = 1) {
	if (is_array($string)) {
		$keys = array_keys($string);
		foreach ($keys as $key) {
			$val = $string[$key];
			unset($string[$key]);
			$string[$key] = eaddslashes($val, $force);
		}
	} else {
		$string = htmlspecialchars(trim($string));
		if(!front::$isadmin){
			front::check_type($string,'safe');
		}
	}
	return $string;
}
Exemplo n.º 13
0
function SetEnews($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //操作权限
    CheckLevel($userid, $username, $classid, "public");
    $add[newsurl] = ehtmlspecialchars($add[newsurl], ENT_QUOTES);
    if (empty($add[indextype])) {
        $add[indextype] = ".html";
    }
    if (empty($add[searchtype])) {
        $add[searchtype] = ".html";
    }
    //备份目录
    if (empty($add[bakdbpath])) {
        $add[bakdbpath] = "bdata";
    }
    if (!file_exists("ebak/" . RepPathStr($add[bakdbpath]))) {
        printerror("NotBakDbPath", "");
    }
    if (empty($add[bakdbzip])) {
        $add[bakdbzip] = "zip";
    }
    if (!file_exists("ebak/" . RepPathStr($add[bakdbzip]))) {
        printerror("NotbakZipPath", "");
    }
    //函数是否存在
    if (!function_exists($add['listpagefun']) || !function_exists($add['textpagefun']) || !function_exists($add['listpagelistfun'])) {
        printerror("NotPageFun", "history.go(-1)");
    }
    //adfile
    $add['adfile'] = RepFilenameQz($add['adfile']);
    //修改ftp密码
    if ($add[ftppassword]) {
        $a = "ftppassword='******'ftppassword']}',";
    }
    //变量处理
    $add[filesize] = (int) $add[filesize];
    $add[hotnum] = (int) $add[hotnum];
    $add[newnum] = (int) $add[newnum];
    $add[relistnum] = (int) $add[relistnum];
    $add[renewsnum] = (int) $add[renewsnum];
    $add[min_keyboard] = (int) $add[min_keyboard];
    $add[max_keyboard] = (int) $add[max_keyboard];
    $add[search_num] = (int) $add[search_num];
    $add[search_pagenum] = (int) $add[search_pagenum];
    $add[newslink] = (int) $add[newslink];
    $add[checked] = (int) $add[checked];
    $add[searchtime] = (int) $add[searchtime];
    $add[loginnum] = (int) $add[loginnum];
    $add[logintime] = (int) $add[logintime];
    $add[addnews_ok] = (int) $add[addnews_ok];
    $add[register_ok] = (int) $add[register_ok];
    $add[goodlencord] = (int) $add[goodlencord];
    $add[goodnum] = (int) $add[goodnum];
    $add[exittime] = (int) $add[exittime];
    $add[smalltextlen] = (int) $add[smalltextlen];
    $add[defaultgroupid] = (int) $add[defaultgroupid];
    $add[phpmode] = (int) $add[phpmode];
    $add[install] = (int) $add[install];
    $add[hotplnum] = (int) $add[hotplnum];
    $add[dorepnum] = (int) $add[dorepnum];
    $add[loadtempnum] = (int) $add[loadtempnum];
    $add[firstnum] = (int) $add[firstnum];
    $add[min_userlen] = (int) $add[min_userlen];
    $add[max_userlen] = (int) $add[max_userlen];
    $add[min_passlen] = (int) $add[min_passlen];
    $add[max_passlen] = (int) $add[max_passlen];
    $add[filechmod] = (int) $add[filechmod];
    $add[sametitle] = (int) $add[sametitle];
    $add[addrehtml] = (int) $add[addrehtml];
    $add[loginkey_ok] = (int) $add[loginkey_ok];
    $add[limittype] = (int) $add[limittype];
    $add[redodown] = (int) $add[redodown];
    $add[candocode] = (int) $add[candocode];
    $add[opennotcj] = (int) $add[opennotcj];
    $add[reuserpagenum] = (int) $add[reuserpagenum];
    $add[revotejsnum] = (int) $add[revotejsnum];
    $add[readjsnum] = (int) $add[readjsnum];
    $add[qaddtran] = (int) $add[qaddtran];
    $add[qaddtransize] = (int) $add[qaddtransize];
    $add[ebakthisdb] = (int) $add[ebakthisdb];
    $add[delnewsnum] = (int) $add[delnewsnum];
    $add[markpos] = (int) $add[markpos];
    $add[adminloginkey] = (int) $add[adminloginkey];
    $add[php_outtime] = (int) $add[php_outtime];
    $add[addreinfo] = (int) $add[addreinfo];
    $add[rssnum] = (int) $add[rssnum];
    $add[rsssub] = (int) $add[rsssub];
    $add[dorepdlevelnum] = (int) $add[dorepdlevelnum];
    $add[listpagelistnum] = (int) $add[listpagelistnum];
    $add[infolinknum] = (int) $add[infolinknum];
    $add[searchgroupid] = (int) $add[searchgroupid];
    $add[opencopytext] = (int) $add[opencopytext];
    $add[reuserjsnum] = (int) $add[reuserjsnum];
    $add[reuserlistnum] = (int) $add[reuserlistnum];
    $add[opentitleurl] = (int) $add[opentitleurl];
    $add['qaddtranfile'] = (int) $add['qaddtranfile'];
    $add['qaddtranfilesize'] = (int) $add['qaddtranfilesize'];
    $add['sendmailtype'] = (int) $add['sendmailtype'];
    $add['loginemail'] = (int) $add['loginemail'];
    $add['feedbacktfile'] = (int) $add['feedbacktfile'];
    $add['feedbackfilesize'] = (int) $add['feedbackfilesize'];
    $add['searchtempvar'] = (int) $add['searchtempvar'];
    $add['showinfolevel'] = (int) $add['showinfolevel'];
    $add['spicwidth'] = (int) $add['spicwidth'];
    $add['spicheight'] = (int) $add['spicheight'];
    $add['spickill'] = (int) $add['spickill'];
    $add['jpgquality'] = (int) $add['jpgquality'];
    $add['markpct'] = (int) $add['markpct'];
    $add['redoview'] = (int) $add['redoview'];
    $add['reggetfen'] = (int) $add['reggetfen'];
    $add['regbooktime'] = (int) $add['regbooktime'];
    $add['revotetime'] = (int) $add['revotetime'];
    $add['fpath'] = (int) $add['fpath'];
    $add['openmembertranimg'] = (int) $add['openmembertranimg'];
    $add['memberimgsize'] = (int) $add['memberimgsize'];
    $add['openmembertranfile'] = (int) $add['openmembertranfile'];
    $add['memberfilesize'] = (int) $add['memberfilesize'];
    $add['openspace'] = (int) $add['openspace'];
    $add['realltime'] = (int) $add['realltime'];
    $add['textpagelistnum'] = (int) $add['textpagelistnum'];
    $add['memberlistlevel'] = (int) $add['memberlistlevel'];
    $add['ebakcanlistdb'] = (int) $add['ebakcanlistdb'];
    $add['keytog'] = (int) $add['keytog'];
    $add['keytime'] = (int) $add['keytime'];
    $add['regkey_ok'] = (int) $add['regkey_ok'];
    $add['opengetdown'] = (int) $add['opengetdown'];
    $add['gbkey_ok'] = (int) $add['gbkey_ok'];
    $add['fbkey_ok'] = (int) $add['fbkey_ok'];
    $add['newaddinfotime'] = (int) $add['newaddinfotime'];
    $add['classnavline'] = (int) $add['classnavline'];
    $add['docnewsnum'] = (int) $add['docnewsnum'];
    $add['dtcanbq'] = (int) $add['dtcanbq'];
    $add['dtcachetime'] = (int) $add['dtcachetime'];
    $add['regretime'] = (int) $add['regretime'];
    $add['regemailonly'] = (int) $add['regemailonly'];
    $add['repkeynum'] = (int) $add['repkeynum'];
    $add['getpasstime'] = (int) $add['getpasstime'];
    $add['acttime'] = (int) $add['acttime'];
    $add['regacttype'] = (int) $add['regacttype'];
    $add['opengetpass'] = (int) $add['opengetpass'];
    $add['hlistinfonum'] = (int) $add['hlistinfonum'];
    if (empty($add['hlistinfonum'])) {
        $add['hlistinfonum'] = 30;
    }
    $add['qlistinfonum'] = (int) $add['qlistinfonum'];
    if (empty($add['qlistinfonum'])) {
        $add['qlistinfonum'] = 30;
    }
    $add['dtncanbq'] = (int) $add['dtncanbq'];
    $add['dtncachetime'] = (int) $add['dtncachetime'];
    $add['readdinfotime'] = (int) $add['readdinfotime'];
    $add['qeditinfotime'] = (int) $add['qeditinfotime'];
    $add['ftpmode'] = (int) $add['ftpmode'];
    $add['ftpssl'] = (int) $add['ftpssl'];
    $add['ftppasv'] = (int) $add['ftppasv'];
    $add['ftpouttime'] = (int) $add['ftpouttime'];
    $add['onclicktype'] = (int) $add['onclicktype'];
    $add['onclickfilesize'] = (int) $add['onclickfilesize'];
    $add['onclickfiletime'] = (int) $add['onclickfiletime'];
    $add['closeqdt'] = (int) $add['closeqdt'];
    $add['settop'] = (int) $add['settop'];
    $add['qlistinfomod'] = (int) $add['qlistinfomod'];
    $add['gb_num'] = (int) $add['gb_num'];
    $add['member_num'] = (int) $add['member_num'];
    $add['space_num'] = (int) $add['space_num'];
    $add['infolday'] = (int) $add['infolday'];
    $add['filelday'] = (int) $add['filelday'];
    $add['baktempnum'] = (int) $add['baktempnum'];
    $add['dorepkey'] = (int) $add['dorepkey'];
    $add['dorepword'] = (int) $add['dorepword'];
    $add['indexpagedt'] = (int) $add['indexpagedt'];
    $add['closeqdtmsg'] = AddAddsData($add['closeqdtmsg']);
    $add['openfileserver'] = (int) $add['openfileserver'];
    $add['fieldandtop'] = (int) $add['fieldandtop'];
    $add['fieldandclosetb'] = $add['fieldandclosetb'] ? ',' . $add['fieldandclosetb'] . ',' : '';
    $add['firsttitlename'] = ehtmlspecialchars(str_replace("\r\n", "|", $add['firsttitlename']));
    $add['isgoodname'] = ehtmlspecialchars(str_replace("\r\n", "|", $add['isgoodname']));
    $add['closelisttemp'] = ehtmlspecialchars($add['closelisttemp']);
    $add['ipaddinfonum'] = (int) $add['ipaddinfonum'];
    $add['ipaddinfotime'] = (int) $add['ipaddinfotime'];
    $add['indexaddpage'] = (int) $add['indexaddpage'];
    $add['modmemberedittran'] = (int) $add['modmemberedittran'];
    $add['modinfoedittran'] = (int) $add['modinfoedittran'];
    //提交IP
    $doiptypes = '';
    $doiptype = $add['doiptype'];
    $doiptypecount = count($doiptype);
    if ($doiptypecount) {
        $doiptypes = ',';
        for ($di = 0; $di < $doiptypecount; $di++) {
            $doiptypes .= $doiptype[$di] . ',';
        }
    }
    //关闭相关模块
    $closemodss = '';
    $closemods = $add['closemods'];
    $closemodscount = count($closemods);
    if ($closemodscount) {
        $closemodss = ',';
        for ($cmi = 0; $cmi < $closemodscount; $cmi++) {
            $closemodss .= $closemods[$cmi] . ',';
        }
    }
    //关闭后台菜单
    $closehmenus = '';
    $closehmenu = $add['closehmenu'];
    $closehmenucount = count($closehmenu);
    if ($closehmenucount) {
        $closehmenus = ',';
        for ($chmi = 0; $chmi < $closehmenucount; $chmi++) {
            $closehmenus .= $closehmenu[$chmi] . ',';
        }
    }
    //限制操作的时间点
    $timecloses = '';
    $timeclose = $add['timeclose'];
    $timeclosecount = count($timeclose);
    if ($timeclosecount) {
        $timecloses = ',';
        for ($tci = 0; $tci < $timeclosecount; $tci++) {
            $timecloses .= $timeclose[$tci] . ',';
        }
    }
    //限制使用时间的操作
    $timeclosedos = '';
    $timeclosedo = $add['timeclosedo'];
    $timeclosedocount = count($timeclosedo);
    if ($timeclosedocount) {
        $timeclosedos = ',';
        for ($tcdi = 0; $tcdi < $timeclosedocount; $tcdi++) {
            $timeclosedos .= $timeclosedo[$tcdi] . ',';
        }
    }
    $add[filetype] = "|" . $add[filetype] . "|";
    $add[qimgtype] = "|" . $add['qaddtranimgtype'] . "|";
    $add[qfiletype] = "|" . $add['qaddtranfiletype'] . "|";
    $add[feedbackfiletype] = "|" . $add['feedbackfiletype'] . "|";
    $add[memberimgtype] = "|" . $add['memberimgtype'] . "|";
    $add[memberfiletype] = "|" . $add['memberfiletype'] . "|";
    $sql = $empire->query("update {$dbtbpre}enewspublic set " . $a . "sitename='{$add['sitename']}',newsurl='{$add['newsurl']}',email='{$add['email']}',filetype='{$add['filetype']}',filesize={$add['filesize']},hotnum={$add['hotnum']},newnum={$add['newnum']},relistnum={$add['relistnum']},renewsnum={$add['renewsnum']},min_keyboard={$add['min_keyboard']},max_keyboard={$add['max_keyboard']},search_num={$add['search_num']},search_pagenum={$add['search_pagenum']},newslink={$add['newslink']},checked={$add['checked']},searchtime={$add['searchtime']},loginnum={$add['loginnum']},logintime={$add['logintime']},addnews_ok={$add['addnews_ok']},register_ok={$add['register_ok']},indextype='{$add['indextype']}',goodlencord={$add['goodlencord']},goodtype='{$add['goodtype']}',goodnum={$add['goodnum']},searchtype='{$add['searchtype']}',exittime={$add['exittime']},smalltextlen={$add['smalltextlen']},defaultgroupid={$add['defaultgroupid']},fileurl='{$add['fileurl']}',phpmode={$add['phpmode']},ftphost='{$add['ftphost']}',ftpport='{$add['ftpport']}',ftpusername='******'ftpusername']}',ftppath='{$add['ftppath']}',ftpmode='{$add['ftpmode']}',install={$add['install']},hotplnum={$add['hotplnum']},dorepnum={$add['dorepnum']},loadtempnum={$add['loadtempnum']},firstnum={$add['firstnum']},bakdbpath='{$add['bakdbpath']}',bakdbzip='{$add['bakdbzip']}',downpass='******'downpass']}',min_userlen={$add['min_userlen']},max_userlen={$add['max_userlen']},min_passlen={$add['min_passlen']},max_passlen={$add['max_passlen']},filechmod={$add['filechmod']},loginkey_ok={$add['loginkey_ok']},limittype={$add['limittype']},redodown={$add['redodown']},candocode={$add['candocode']},opennotcj={$add['opennotcj']},reuserpagenum={$add['reuserpagenum']},revotejsnum={$add['revotejsnum']},readjsnum={$add['readjsnum']},qaddtran={$add['qaddtran']},qaddtransize={$add['qaddtransize']},ebakthisdb={$add['ebakthisdb']},delnewsnum={$add['delnewsnum']},markpos={$add['markpos']},markimg='{$add['markimg']}',marktext='{$add['marktext']}',markfontsize='{$add['markfontsize']}',markfontcolor='{$add['markfontcolor']}',markfont='{$add['markfont']}',adminloginkey={$add['adminloginkey']},php_outtime={$add['php_outtime']},listpagefun='{$add['listpagefun']}',textpagefun='{$add['textpagefun']}',adfile='{$add['adfile']}',notsaveurl='{$add['notsaveurl']}',rssnum={$add['rssnum']},rsssub={$add['rsssub']},dorepdlevelnum={$add['dorepdlevelnum']},listpagelistfun='{$add['listpagelistfun']}',listpagelistnum={$add['listpagelistnum']},infolinknum={$add['infolinknum']},searchgroupid={$add['searchgroupid']},opencopytext={$add['opencopytext']},reuserjsnum={$add['reuserjsnum']},reuserlistnum={$add['reuserlistnum']},opentitleurl='{$add['opentitleurl']}',qaddtranimgtype='{$add['qimgtype']}',qaddtranfile={$add['qaddtranfile']},qaddtranfilesize={$add['qaddtranfilesize']},qaddtranfiletype='{$add['qfiletype']}',sendmailtype={$add['sendmailtype']},smtphost='{$add['smtphost']}',fromemail='{$add['fromemail']}',loginemail={$add['loginemail']},emailusername='******'emailusername']}',emailpassword='******'emailpassword']}',smtpport='{$add['smtpport']}',emailname='{$add['emailname']}',feedbacktfile={$add['feedbacktfile']},feedbackfilesize={$add['feedbackfilesize']},feedbackfiletype='{$add['feedbackfiletype']}',searchtempvar={$add['searchtempvar']},showinfolevel={$add['showinfolevel']},navfh='" . eaddslashes($add[navfh]) . "',spicwidth={$add['spicwidth']},spicheight={$add['spicheight']},spickill={$add['spickill']},jpgquality={$add['jpgquality']},markpct={$add['markpct']},redoview={$add['redoview']},reggetfen={$add['reggetfen']},regbooktime={$add['regbooktime']},revotetime={$add['revotetime']},fpath={$add['fpath']},filepath='{$add['filepath']}',openmembertranimg={$add['openmembertranimg']},memberimgsize={$add['memberimgsize']},openmembertranfile={$add['openmembertranfile']},memberfilesize={$add['memberfilesize']},memberimgtype='{$add['memberimgtype']}',memberfiletype='{$add['memberfiletype']}',canposturl='{$add['canposturl']}',openspace='{$add['openspace']}',realltime={$add['realltime']},closeip='{$add['closeip']}',openip='{$add['openip']}',hopenip='{$add['hopenip']}',closewords='{$add['closewords']}',closewordsf='{$add['closewordsf']}',textpagelistnum={$add['textpagelistnum']},memberlistlevel={$add['memberlistlevel']},ebakcanlistdb={$add['ebakcanlistdb']},keytog='{$add['keytog']}',keyrnd='{$add['keyrnd']}',keytime='{$add['keytime']}',regkey_ok='{$add['regkey_ok']}',opengetdown='{$add['opengetdown']}',gbkey_ok='{$add['gbkey_ok']}',fbkey_ok='{$add['fbkey_ok']}',newaddinfotime='{$add['newaddinfotime']}',classnavline='{$add['classnavline']}',classnavfh='" . eaddslashes($add[classnavfh]) . "',sitekey='{$add['sitekey']}',siteintro='{$add['siteintro']}',docnewsnum='{$add['docnewsnum']}',dtcanbq='{$add['dtcanbq']}',dtcachetime='{$add['dtcachetime']}',regretime='{$add['regretime']}',regclosewords='{$add['regclosewords']}',regemailonly='{$add['regemailonly']}',repkeynum='{$add['repkeynum']}',getpasstime='{$add['getpasstime']}',acttime='{$add['acttime']}',regacttype='{$add['regacttype']}',acttext='" . eaddslashes($add[acttext]) . "',getpasstext='" . eaddslashes($add[getpasstext]) . "',acttitle='" . eaddslashes($add[acttitle]) . "',getpasstitle='" . eaddslashes($add[getpasstitle]) . "',opengetpass='******'opengetpass']}',hlistinfonum='{$add['hlistinfonum']}',qlistinfonum='{$add['qlistinfonum']}',dtncanbq='{$add['dtncanbq']}',dtncachetime='{$add['dtncachetime']}',readdinfotime='{$add['readdinfotime']}',qeditinfotime='{$add['qeditinfotime']}',ftpssl='{$add['ftpssl']}',ftppasv='{$add['ftppasv']}',ftpouttime='{$add['ftpouttime']}',onclicktype='{$add['onclicktype']}',onclickfilesize='{$add['onclickfilesize']}',onclickfiletime='{$add['onclickfiletime']}',closeqdt='{$add['closeqdt']}',settop='{$add['settop']}',qlistinfomod='{$add['qlistinfomod']}',gb_num='{$add['gb_num']}',member_num='{$add['member_num']}',space_num='{$add['space_num']}',opendoip='{$add['opendoip']}',closedoip='{$add['closedoip']}',doiptype='{$doiptypes}',infolday='{$add['infolday']}',filelday='{$add['filelday']}',baktempnum='{$add['baktempnum']}',dorepkey='{$add['dorepkey']}',dorepword='{$add['dorepword']}',onclickrnd='{$add['onclickrnd']}',indexpagedt='{$add['indexpagedt']}',keybgcolor='{$add['keybgcolor']}',keyfontcolor='{$add['keyfontcolor']}',keydistcolor='{$add['keydistcolor']}',closeqdtmsg='{$add['closeqdtmsg']}',openfileserver='{$add['openfileserver']}',closemods='{$closemodss}',fieldandtop='{$add['fieldandtop']}',fieldandclosetb='{$add['fieldandclosetb']}',firsttitlename='" . eaddslashes($add[firsttitlename]) . "',isgoodname='" . eaddslashes($add[isgoodname]) . "',closelisttemp='" . eaddslashes($add[closelisttemp]) . "',chclasscolor='" . eaddslashes($add[chclasscolor]) . "',timeclose='" . eaddslashes($timecloses) . "',timeclosedo='" . eaddslashes($timeclosedos) . "',ipaddinfonum='{$add['ipaddinfonum']}',ipaddinfotime='{$add['ipaddinfotime']}',closehmenu='{$closehmenus}',indexaddpage='{$add['indexaddpage']}',modmemberedittran='{$add['modmemberedittran']}',modinfoedittran='{$add['modinfoedittran']}';");
    DoSetFileServer($add);
    //远程附件更新
    GetConfig();
    //首页动态文件
    if ($add['indexpagedt'] != $add['oldindexpagedt']) {
        if ($add['indexpagedt']) {
            DelFiletext(ECMS_PATH . 'index' . $add[indextype]);
            @copy(ECMS_PATH . DASHBOARD . '/data/template/dtindexpage.txt', ECMS_PATH . 'index.php');
        } else {
            DelFiletext(ECMS_PATH . 'index.php');
            $indextemp = GetIndextemp();
            NewsBq(0, $indextemp, 1, 0);
        }
    }
    if ($sql) {
        insert_dolog("");
        //操作日志
        printerror("SetPublicSuccess", "SetEnews.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 14
0
function EditPrecode($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add['id'] = (int) $add['id'];
    if (!$add['prename'] || !$add['precode'] || !$add['premoney'] || !$add['id']) {
        printerror("EmptyPrecode", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "precode");
    $add['precode'] = RepPostVar($add['precode']);
    $num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewsshop_precode where precode='{$add['precode']}' and id<>" . $add[id] . " limit 1");
    if ($num) {
        printerror("RePrecode", "history.go(-1)");
    }
    $time = (int) $add['time'];
    $add['prename'] = eaddslashes(ehtmlspecialchars($add['prename']));
    $add['premoney'] = (int) $add['premoney'];
    $add['pretype'] = (int) $add['pretype'];
    $add['reuse'] = (int) $add['reuse'];
    $add['endtime'] = $add['endtime'] ? to_time($add['endtime']) : 0;
    $add['musttotal'] = (int) $add['musttotal'];
    $add['usenum'] = (int) $add['usenum'];
    $groupids = ReturnPreGroupids($add['groupid']);
    $add['classid'] = trim($add['classid']);
    $classids = $add['classid'] ? ',' . $add['classid'] . ',' : '';
    $sql = $empire->query("update {$dbtbpre}enewsshop_precode set prename='{$add['prename']}',precode='{$add['precode']}',premoney='{$add['premoney']}',pretype='{$add['pretype']}',reuse='{$add['reuse']}',endtime='{$add['endtime']}',groupid='{$groupids}',classid='{$classids}',musttotal='{$add['musttotal']}',usenum='{$add['usenum']}' where id='{$add['id']}'");
    if ($sql) {
        //操作日志
        insert_dolog("id={$add['id']}&precode={$add['precode']}<br>premoney={$add['premoney']}&pretype={$add['pretype']}");
        printerror("EditPrecodeSuccess", "ListPrecode.php?time={$time}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 15
0
function EditInfoClass($bclassid, $newsclassid, $add, $ztid, $userid, $username)
{
    global $empire, $class_r, $dbtbpre;
    if (!$add[classid] || !$add[classname]) {
        printerror("EmptyInfoTitleSuccess", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "cj");
    //父节点与原节点一样
    if ($add[classid] == $bclassid) {
        printerror("OldInfoidNotSingle", "history.go(-1)");
    }
    //选择栏目
    if ($newsclassid) {
        if (!$class_r[$newsclassid][islast]) {
            printerror("CjClassidMustLast", "history.go(-1)");
        }
        //返回采集页面地址
        $add[infourl] = ReturnInfoUrl($add);
        //取得采集字段
        $mr = $empire->fetch1("select cj,tid,tbname from {$dbtbpre}enewsmod where mid='" . $class_r[$newsclassid][modid] . "'");
    }
    if (empty($add[startday])) {
        $add[startday] = date("Y-m-d");
    }
    if (empty($add[endday])) {
        $add[endday] = "2099-12-31";
    }
    if (empty($add[relistnum])) {
        $add[relistnum] = 1;
    }
    if (empty($add[renum])) {
        $add[renum] = 2;
    }
    if (empty($add[insertnum])) {
        $add[insertnum] = 10;
    }
    //处理变量
    $add[classid] = (int) $add[classid];
    $bclassid = (int) $bclassid;
    $newsclassid = (int) $newsclassid;
    $add[num] = (int) $add[num];
    $add[copyimg] = (int) $add[copyimg];
    $add[renum] = (int) $add[renum];
    $add[titlelen] = (int) $add[titlelen];
    $add[retitlewriter] = (int) $add[retitlewriter];
    $add[smalltextlen] = (int) $add[smalltextlen];
    $add[relistnum] = (int) $add[relistnum];
    $add[keynum] = (int) $add[keynum];
    $add[insertnum] = (int) $add[insertnum];
    $add[copyflash] = (int) $add[copyflash];
    $mr[tid] = (int) $mr[tid];
    $add[pagetype] = (int) $add[pagetype];
    $add[mark] = (int) $add[mark];
    $add[enpagecode] = (int) $add[enpagecode];
    $add[recjtheurl] = (int) $add[recjtheurl];
    $add[hiddenload] = (int) $add[hiddenload];
    $add[justloadin] = (int) $add[justloadin];
    $add[justloadcheck] = (int) $add[justloadcheck];
    $add[delloadinfo] = (int) $add[delloadinfo];
    $add[getfirstpic] = (int) $add[getfirstpic];
    $add[getfirstspic] = (int) $add[getfirstspic];
    $add[getfirstspicw] = (int) $add[getfirstspicw];
    $add[getfirstspich] = (int) $add[getfirstspich];
    $add[doaddtextpage] = (int) $add[doaddtextpage];
    $add[infourlispage] = (int) $add[infourlispage];
    $keeptime = (int) $add['keeptime'];
    $newstextisnull = (int) $add['newstextisnull'];
    //主表
    $sql = $empire->query("update {$dbtbpre}enewsinfoclass set bclassid={$bclassid},classname='" . eaddslashes($add[classname]) . "',infourl='" . eaddslashes2($add[infourl]) . "',newsclassid={$newsclassid},startday='{$add['startday']}',endday='{$add['endday']}',bz='" . eaddslashes2($add[bz]) . "',num={$add['num']},copyimg={$add['copyimg']},renum={$add['renum']},keyboard='" . eaddslashes2($add[keyboard]) . "',oldword='" . eaddslashes2($add[oldword]) . "',newword='" . eaddslashes2($add[newword]) . "',titlelen={$add['titlelen']},retitlewriter={$add['retitlewriter']},smalltextlen={$add['smalltextlen']},zz_smallurl='" . eaddslashes2($add[zz_smallurl]) . "',zz_newsurl='" . eaddslashes2($add[zz_newsurl]) . "',httpurl='" . eaddslashes2($add[httpurl]) . "',repad='" . eaddslashes2($add[repad]) . "',imgurl='" . eaddslashes2($add[imgurl]) . "',relistnum={$add['relistnum']},zz_titlepicl='" . eaddslashes2($add[zz_titlepicl]) . "',z_titlepicl='" . eaddslashes2($add[z_titlepicl]) . "',qz_titlepicl='" . eaddslashes2($add[qz_titlepicl]) . "',save_titlepicl='{$add['save_titlepicl']}',keynum={$add['keynum']},insertnum={$add['insertnum']},copyflash={$add['copyflash']},tid={$mr['tid']},tbname='{$mr['tbname']}',pagetype={$add['pagetype']},smallpagezz='" . eaddslashes2($add[smallpagezz]) . "',pagezz='" . eaddslashes2($add[pagezz]) . "',smallpageallzz='" . eaddslashes2($add[smallpageallzz]) . "',pageallzz='" . eaddslashes2($add[pageallzz]) . "',mark={$add['mark']},enpagecode={$add['enpagecode']},recjtheurl={$add['recjtheurl']},hiddenload={$add['hiddenload']},justloadin={$add['justloadin']},justloadcheck={$add['justloadcheck']},delloadinfo={$add['delloadinfo']},pagerepad='" . eaddslashes2($add[pagerepad]) . "',getfirstpic={$add['getfirstpic']},oldpagerep='" . eaddslashes2($add[oldpagerep]) . "',newpagerep='" . eaddslashes2($add[newpagerep]) . "',keeptime='{$keeptime}',newstextisnull={$newstextisnull},getfirstspic={$add['getfirstspic']},getfirstspicw={$add['getfirstspicw']},getfirstspich={$add['getfirstspich']},doaddtextpage={$add['doaddtextpage']},infourlispage={$add['infourlispage']} where classid='{$add['classid']}'");
    if ($newsclassid) {
        //是否已有记录
        $havenum = $empire->num("select count(*) as total from {$dbtbpre}ecms_infoclass_" . $mr[tbname] . " where classid='{$add['classid']}' limit 1");
        //原本是父栏目
        if (empty($add[oldnewsclassid]) && !$havenum) {
            $ret_r = ReturnAddCj($add, $mr[cj], 0);
            //写入副表
            $usql = $empire->query("insert into {$dbtbpre}ecms_infoclass_" . $mr[tbname] . "(classid" . $ret_r[0] . ") values({$add['classid']}" . $ret_r[1] . ");");
        } else {
            $ret_r = ReturnAddCj($add, $mr[cj], 1);
            //副表
            $usql = $empire->query("update {$dbtbpre}ecms_infoclass_" . $mr[tbname] . " set classid='{$add['classid']}'" . $ret_r[0] . " where classid='{$add['classid']}'");
        }
    }
    //来源
    if ($_POST['from']) {
        $returnurl = "ListPageInfoClass.php";
    } else {
        $returnurl = "ListInfoClass.php";
    }
    if ($sql) {
        //操作日志
        insert_dolog("classid=" . $add[classid] . "<br>classname=" . $add[classname]);
        printerror("EditInfoClassSuccess", $returnurl . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 16
0
function EditMemberF($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //验证权限
    CheckLevel($userid, $username, $classid, "memberf");
    $fid = (int) $add['fid'];
    $add[f] = RepPostVar($add[f]);
    $add[oldf] = RepPostVar($add[oldf]);
    if (empty($add[f]) || empty($add[fname]) || !$fid) {
        printerror("EmptyF", "history.go(-1)");
    }
    if ($add[f] != $add[oldf]) {
        //字段是否重复
        $s = $empire->query("SHOW FIELDS FROM {$dbtbpre}enewsmemberadd");
        $b = 0;
        while ($r = $empire->fetch($s)) {
            if ($r[Field] == $add[f]) {
                $b = 1;
                break;
            }
        }
        if ($b) {
            printerror("ReF", "history.go(-1)");
        }
        $s = $empire->query("SHOW FIELDS FROM {$dbtbpre}enewsmember");
        $b = 0;
        while ($r = $empire->fetch($s)) {
            if ($r[Field] == $add[f]) {
                $b = 1;
                break;
            }
        }
        if ($b) {
            printerror("ReF", "");
        }
    }
    $add[fvalue] = ReturnMFvalue($add[fvalue]);
    //初始化值
    //字段类型
    if ($add[ftype] == "TINYINT" || $add[ftype] == "SMALLINT" || $add[ftype] == "INT" || $add[ftype] == "BIGINT" || $add[ftype] == "FLOAT" || $add[ftype] == "DOUBLE") {
        $def = " default '0'";
    } elseif ($add[ftype] == "VARCHAR") {
        $def = " default ''";
    } else {
        $def = "";
    }
    $type = $add[ftype];
    //VARCHAR
    if ($add[ftype] == 'VARCHAR' && empty($add[flen])) {
        $add[flen] = '255';
    }
    //字段长度
    if ($add[flen]) {
        if ($add[ftype] != "TEXT" && $add[ftype] != "MEDIUMTEXT" && $add[ftype] != "LONGTEXT") {
            $type .= "(" . $add[flen] . ")";
        }
    }
    $field = "`" . $add[f] . "` " . $type . " NOT NULL" . $def;
    $usql = $empire->query("alter table {$dbtbpre}enewsmemberadd change `" . $add[oldf] . "` " . $field);
    //替换代码
    if ($add[f] != $add[oldf] || $add[fform] != $add[oldfform] || $add[fvalue] != $add[oldfvalue] || $add[fformsize] != $add[oldfformsize]) {
        $fhtml = GetMemberFform($add[fform], $add[f], $add[fvalue], $add[fformsize]);
        if ($add[fform] == 'select' || $add[fform] == 'radio' || $add[fform] == 'checkbox') {
            $fhtml = str_replace("\$r[", "\$addr[", $fhtml);
        }
    } else {
        $fhtml = $add[fhtml];
    }
    //处理变量
    $add[myorder] = (int) $add[myorder];
    $sql = $empire->query("update {$dbtbpre}enewsmemberf set f='{$add['f']}',fname='{$add['fname']}',fform='{$add['fform']}',fhtml='" . eaddslashes2($fhtml) . "',fzs='" . eaddslashes($add[fzs]) . "',myorder={$add['myorder']},ftype='{$add['ftype']}',flen='{$add['flen']}',fvalue='" . eaddslashes2($add[fvalue]) . "',fformsize='{$add['fformsize']}' where fid={$fid}");
    //更新表单
    $record = "<!--record-->";
    $field = "<!--field--->";
    $like = $field . $add[oldf] . $record;
    $newlike = $field . $add[f] . $record;
    $slike = "," . $add[oldf] . ",";
    $newslike = "," . $add[f] . ",";
    $csql = $empire->query("select fid,ftemp,enter,mustenter,filef,imgf,tobrf,viewenter,searchvar,canaddf,caneditf,checkboxf from {$dbtbpre}enewsmemberform where enter like '%{$like}%'");
    while ($cr = $empire->fetch($csql)) {
        $setf = "";
        $newftemp = str_replace('[!--' . $add[oldf] . '--]', '[!--' . $add[f] . '--]', stripSlashes($cr['ftemp']));
        $setf .= ",ftemp='" . addslashes($newftemp) . "'";
        if (strstr($cr['mustenter'], $slike)) {
            $setf .= ",mustenter=REPLACE(mustenter,'{$slike}','{$newslike}')";
        }
        if (strstr($cr['filef'], $slike)) {
            $setf .= ",filef=REPLACE(filef,'{$slike}','{$newslike}')";
        }
        if (strstr($cr['imgf'], $slike)) {
            $setf .= ",imgf=REPLACE(imgf,'{$slike}','{$newslike}')";
        }
        if (strstr($cr['tobrf'], $slike)) {
            $setf .= ",tobrf=REPLACE(tobrf,'{$slike}','{$newslike}')";
        }
        if (strstr($cr[viewenter], $like)) {
            $setf .= ",viewenter=REPLACE(viewenter,'{$like}','{$newlike}')";
        }
        if (strstr($cr['searchvar'], $slike)) {
            $setf .= ",searchvar=REPLACE(searchvar,'{$slike}','{$newslike}')";
        }
        if (strstr($cr['canaddf'], $slike)) {
            $setf .= ",canaddf=REPLACE(canaddf,'{$slike}','{$newslike}')";
        }
        if (strstr($cr['caneditf'], $slike)) {
            $setf .= ",caneditf=REPLACE(caneditf,'{$slike}','{$newslike}')";
        }
        if (strstr($cr['checkboxf'], $slike)) {
            $setf .= ",checkboxf=REPLACE(checkboxf,'{$slike}','{$newslike}')";
        }
        $cusql = $empire->query("update {$dbtbpre}enewsmemberform set enter=REPLACE(enter,'{$like}','{$newlike}')" . $setf . " where fid='{$cr['fid']}'");
        //生成表单页面
        ChangeMemberForm($cr[fid], $newftemp);
    }
    if ($usql && $sql) {
        insert_dolog("fid=" . $fid . "<br>f=" . $add[f]);
        //操作日志
        printerror("EditFSuccess", "member/ListMemberF.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Exemplo n.º 17
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)");
	}
}
Exemplo n.º 18
0
function DoPostClassVar($add)
{
    if (empty($add[classtype])) {
        $add[classtype] = ".html";
    }
    $add[classname] = eaddslashes(ehtmlspecialchars($add[classname]));
    $add[intro] = eaddslashes(RepPhpAspJspcode($add[intro]));
    $add[classpagekey] = eaddslashes(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]);
    if (!$add[qaddgroupid]) {
        $add[addinfofen] = 0;
    }
    $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];
    $add['repagenum'] = (int) $add['repagenum'];
    $add['keycid'] = (int) $add['keycid'];
    $add['filepass'] = (int) $add['filepass'];
    $add[pripath] = eaddslashes($add[pripath]);
    $add[classpath] = eaddslashes($add[classpath]);
    if ($add['islist'] == 3) {
        $add['bdinfoid'] = RepPostVar($add['bdinfoid']);
    } else {
        $add['bdinfoid'] = '';
    }
    if ($add[islast] && $add['smallbdinfoid']) {
        $add['smallbdinfoid'] = RepPostVar($add['smallbdinfoid']);
    } else {
        $add['smallbdinfoid'] = '';
    }
    //设置访问权限
    $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;
}
Exemplo n.º 19
0
function ShopSys_EditPretotal($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //验证权限
    CheckLevel($userid, $username, $classid, "shopdd");
    $ddid = (int) $add['ddid'];
    $bz = eaddslashes(ehtmlspecialchars($add['bz']));
    $pretotal = (double) $add['pretotal'];
    if (!$ddid) {
        printerror('ErrorUrl', '');
    }
    $r = $empire->fetch1("select ddid,ddno,pretotal from {$dbtbpre}enewsshopdd where ddid='{$ddid}'");
    if (!$r['ddid']) {
        printerror('ErrorUrl', '');
    }
    $sql = $empire->query("update {$dbtbpre}enewsshopdd set pretotal='{$pretotal}' where ddid='{$ddid}'");
    if ($sql) {
        $log_bz = $bz;
        $log_addbz = "oldpre={$r['pretotal']}&newpre={$pretotal}";
        ShopSys_DdInsertLog($ddid, 'EditPretotal', $log_bz, $log_addbz);
        //订单日志
        insert_dolog("ddid={$ddid}&ddno={$r['ddno']}<br>oldpre={$r['pretotal']}&newpre={$pretotal}");
        //操作日志
        printerror('DdEditPretotalSuccess', "ShowDd.php?ddid={$ddid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror('DbError', 'history.go(-1)');
    }
}
Exemplo n.º 20
0
function AddEBakTemp($temptype, $gid, $tempid, $tempname, $temptext, $subnews, $isdefault, $listvar, $rownum, $modid, $showdate, $subtitle, $classid, $docode, $userid, $username)
{
    global $empire, $dbtbpre;
    $tempid = (int) $tempid;
    $gid = (int) $gid;
    if (!$gid) {
        $gid = GetDoTempGid();
    }
    if ($temptype == 'indexpage') {
        $gid = 1;
    }
    $pr = DelEBakTemp($temptype, $gid, $tempid);
    if (!$pr['baktempnum']) {
        return '';
    }
    $subnews = (int) $subnews;
    $isdefault = (int) $isdefault;
    $rownum = (int) $rownum;
    $modid = (int) $modid;
    $subtitle = (int) $subtitle;
    $classid = (int) $classid;
    $docode = (int) $docode;
    $baktime = time();
    $empire->query("insert into {$dbtbpre}enewstempbak(tempid,tempname,temptext,subnews,isdefault,listvar,rownum,modid,showdate,subtitle,classid,docode,baktime,temptype,gid,lastuser) values('{$tempid}','" . eaddslashes($tempname) . "','" . eaddslashes2($temptext) . "','{$subnews}','{$isdefault}','" . eaddslashes2($listvar) . "','{$rownum}','{$modid}','" . eaddslashes($showdate) . "','{$subtitle}','{$classid}','{$docode}','{$baktime}','{$temptype}','{$gid}','{$username}');");
}
Exemplo n.º 21
0
function EditSysF($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $tid = (int) $add['tid'];
    $tbname = RepPostVar($add['tbname']);
    $fid = (int) $add['fid'];
    $f = RepPostVar($add['f']);
    if (!$fid || !$tid || !$tbname || !$f || !$add[fname]) {
        printerror("EmptyF", "history.go(-1)");
    }
    CheckLevel($userid, $username, $classid, "f");
    //验证权限
    //字段
    $addupdate = '';
    if ($f == 'title' || $f == 'titlepic') {
        if (!empty($add['flen'])) {
            $field = $f . " " . $add['ftype'] . "(" . $add['flen'] . ") NOT NULL default ''";
            //信息表
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . " change " . $f . " " . $field);
            //归档表
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_doc change " . $f . " " . $field);
            //审核表
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_check change " . $f . " " . $field);
            //采集临时表
            $empire->query("alter table {$dbtbpre}ecms_infotmp_" . $tbname . " change " . $f . " " . $field);
        }
        $addupdate = ",ftype='{$add['ftype']}'";
    }
    //索引
    $iskey = (int) $add['iskey'];
    if ($f == 'title' || $f == 'titlepic') {
        if ($iskey == 1) {
            if ($add['oldiskey'] == 0) {
                $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . " ADD INDEX(" . $f . ")");
                $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_doc ADD INDEX(" . $f . ")");
                $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_check ADD INDEX(" . $f . ")");
            }
        } elseif ($add['oldiskey'] == 1 && $iskey == 0) {
            $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . " DROP INDEX " . $f);
            $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_doc DROP INDEX " . $f);
            $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_check DROP INDEX " . $f);
        }
    }
    //处理变量
    $add[isonly] = (int) $add[isonly];
    $add[myorder] = (int) $add[myorder];
    //替换代码
    if ($add[fform] != $add[oldfform] || $add[fvalue] != $add[oldfvalue] || $add[oldlinkfieldtb] != $add[linkfieldtb] || $add[oldlinkfieldshow] != $add[linkfieldshow] || $add[linkfieldval] != $add[oldlinkfieldval] || $add[fformsize] != $add[oldfformsize]) {
        $fhtml = GetFform($add[fform], $add[f], $add[fvalue], $add[linkfieldval], $add[fformsize], $add);
    } else {
        $fhtml = $add[fhtml];
    }
    if ($add[fform] != $add[oldfform] || $add[fvalue] != $add[oldfvalue] || $add[oldlinkfieldtb] != $add[linkfieldtb] || $add[oldlinkfieldshow] != $add[linkfieldshow] || $add[linkfieldval] != $add[oldlinkfieldval] || $add[fformsize] != $add[oldfformsize]) {
        $qfhtml = GetQFform($add[fform], $add[f], $add[fvalue], $add[fformsize], $add);
    } else {
        $qfhtml = $add[qfhtml];
    }
    $sql = $empire->query("update {$dbtbpre}enewsf set fname='{$add['fname']}',fform='{$add['fform']}',fhtml='" . eaddslashes2($fhtml) . "',fzs='" . eaddslashes($add[fzs]) . "',myorder={$add['myorder']},flen='{$add['flen']}',fvalue='" . eaddslashes2($add[fvalue]) . "',iskey={$iskey},qfhtml='" . eaddslashes2($qfhtml) . "',isonly='{$add['isonly']}',linkfieldval='{$add['linkfieldval']}',samedata='{$add['samedata']}',fformsize='{$add['fformsize']}',adddofun='{$add['adddofun']}',editdofun='{$add['editdofun']}',qadddofun='{$add['qadddofun']}',qeditdofun='{$add['qeditdofun']}',linkfieldtb='{$add['linkfieldtb']}',linkfieldshow='{$add['linkfieldshow']}'" . $addupdate . " where fid='{$fid}'");
    TogSaveTxtF(1);
    //公共变量
    //更新表单
    $fsql = $empire->query("select mid,mtemp,tid,qmtemp from {$dbtbpre}enewsmod where tid='{$tid}'");
    while ($fr = $empire->fetch($fsql)) {
        ChangeMForm($fr[mid], $fr[tid], $fr[mtemp]);
        ChangeQmForm($fr[mid], $fr[tid], $fr[qmtemp]);
    }
    GetConfig(1);
    //更新缓存
    if ($sql) {
        insert_dolog("fid=" . $fid . "<br>f=" . $f);
        //操作日志
        printerror("EditFSuccess", "db/EditSysF.php?tid={$tid}&tbname={$tbname}&fid={$fid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}