//验证用户 $lur = is_login(); $logininid = $lur['userid']; $loginin = $lur['username']; $loginrnd = $lur['rnd']; $loginlevel = $lur['groupid']; $loginadminstyleid = $lur['adminstyleid']; //ehash $ecms_hashur = hReturnEcmsHashStrAll(); $ztid = (int) $_GET['ztid']; if (empty($ztid)) { $ztid = (int) $_POST['ztid']; } //验证权限 //CheckLevel($logininid,$loginin,$classid,"zt"); $returnandlevel = CheckAndUsernamesLevel('dozt', $ztid, $logininid, $loginin, $loginlevel); $enews = $_POST['enews']; if (empty($enews)) { $enews = $_GET['enews']; } if ($enews) { hCheckEcmsRHash(); include '../../class/classfun.php'; } if ($enews == "TogZt") { include '../../data/dbcache/class.php'; $re = TogZt($_POST, $logininid, $loginin); } elseif ($enews == 'SaveTogZtInfo') { SaveTogZtInfo($_POST, $logininid, $loginin); } elseif ($enews == 'DelTogZtInfo') { DelTogZtInfo($_GET, $logininid, $loginin);
function EditZt($add, $userid, $username) { global $empire, $class_r, $dbtbpre, $loginlevel; $add[ztid] = (int) $add[ztid]; $add[ztpath] = trim($add[ztpath]); if (!$add[ztname] || !$add[listtempid] || !$add[ztpath] || !$add[ztid]) { printerror("EmptyZt", ""); } $add = DoPostZtVar($add); //CheckLevel($userid,$username,$classid,"zt"); $returnandlevel = CheckAndUsernamesLevel('dozt', $add[ztid], $userid, $username, $loginlevel); $upusernames = ''; if ($returnandlevel == 2) { $upusernames = ",usernames='{$add['usernames']}'"; } //改变目录 if ($add[oldztpath] != $add[ztpath]) { $createpath = '../../' . $add[ztpath]; if (file_exists($createpath)) { printerror("ReZtpath", ""); } if ($add['oldpripath'] == $add['pripath']) { $new = "../../"; @rename($new . $add[oldztpath], $new . $add[ztpath]); //改变目录名 } else { CreateZtPath($add[ztpath]); //建立专题目录 } } //取得表名 $tabler = GetModTable(GetListtempMid($add[listtempid])); $tabler[tid] = (int) $tabler[tid]; $sql = $empire->query("update {$dbtbpre}enewszt set ztname='{$add['ztname']}',ztnum={$add['ztnum']},listtempid={$add['listtempid']},ztpath='{$add['ztpath']}',zttype='{$add['zttype']}',zturl='{$add['zturl']}',classid={$add['classid']},islist={$add['islist']},maxnum={$add['maxnum']},reorder='{$add['reorder']}',intro='{$add['intro']}',ztimg='{$add['ztimg']}',zcid={$add['zcid']},showzt={$add['showzt']},ztpagekey='{$add['ztpagekey']}',classtempid='{$add['classtempid']}',myorder={$add['myorder']},usezt='{$add['usezt']}',yhid='{$add['yhid']}',endtime='{$add['endtime']}',closepl='{$add['closepl']}',checkpl='{$add['checkpl']}',pltempid='{$add['pltempid']}'" . $upusernames . " where ztid='{$add['ztid']}'"); //副表 $ret_zr = ReturnZtAddF($add, 1); $empire->query("update {$dbtbpre}enewsztadd set classtext='" . eaddslashes2($add[classtext]) . "'" . $ret_zr[0] . " where ztid='{$add['ztid']}'"); //更新专题子类 if ($add['endtime'] != $add['oldendtime']) { $empire->query("update {$dbtbpre}enewszttype set endtime='{$add['endtime']}' where ztid='{$add['ztid']}'"); } //更新附件 UpdateTheFileEditOther(2, $add['ztid'], 'other'); GetClass(); //更新缓存 //生成页面 if ($add[islist] == 0 || $add[islist] == 2) { $classtemp = $add[islist] == 2 ? GetZtText($add[ztid]) : GetClassTemp($add['classtempid']); NewsBq($add[ztid], $classtemp, 3, 1); } if ($sql) { $returnurl = 'special/ListZt.php' . hReturnEcmsHashStrHref2(1); if ($add['from']) { $returnurl = 'special/AddZt.php?enews=EditZt&ztid=' . $add[ztid] . '&from=1' . hReturnEcmsHashStrHref2(0); } insert_dolog("ztid=" . $add[ztid] . "<br>ztname=" . $add[ztname]); //操作日志 printerror("EditZtSuccess", $returnurl); } else { printerror("DbError", ""); } }