Example #1
0
function EditZtType($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add = DoPostZtTypeVar($add);
    $ztid = (int) $add['ztid'];
    $cid = (int) $add['cid'];
    if (!$ztid || !$cid || !$add[cname]) {
        printerror("EmptyZtType", "history.go(-1)");
    }
    //验证权限
    //CheckLevel($userid,$username,$classid,"zt");
    $r = $empire->fetch1("select ztid,cname from {$dbtbpre}enewszttype where cid='{$cid}' and ztid='{$ztid}' limit 1");
    if (!$r['ztid']) {
        printerror('ErrorUrl', '');
    }
    $sql = $empire->query("update {$dbtbpre}enewszttype set cname='{$add['cname']}',myorder='{$add['myorder']}',islist='{$add['islist']}',listtempid='{$add['listtempid']}',maxnum='{$add['maxnum']}',tnum='{$add['tnum']}',reorder='{$add['reorder']}',ttype='{$add['ttype']}' where cid='{$cid}'");
    $empire->query("update {$dbtbpre}enewszttypeadd set classtext='" . eaddslashes2($add[classtext]) . "' where cid='{$cid}'");
    //生成页面
    ListHtmlIndex($cid, '', 1);
    if ($sql) {
        //操作日志
        insert_dolog("ztid=" . $ztid . "<br>cid=" . $cid . "<br>cname=" . $add[cname]);
        printerror("EditZtTypeSuccess", "ZtType.php?ztid={$ztid}" . hReturnEcmsHashStrHref2(0));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Example #2
0
function DoReZtListHtml($ztid, $ecms = 0)
{
    global $empire, $dbtbpre, $public_r;
    ListHtmlIndex($ztid, $ret_r, 0);
    //刷新专题子类
    if ($ecms == 1) {
        $csql = $empire->query("select cid from {$dbtbpre}enewszttype where ztid='{$ztid}'");
        while ($cr = $empire->fetch($csql)) {
            ListHtmlIndex($cr['cid'], $ret_r, 1);
        }
    }
}
Example #3
0
function DoTimeRepage($time)
{
    global $empire, $dbtbpre;
    if (empty($time)) {
        $time = 120;
    }
    echo "<meta http-equiv=\"refresh\" content=\"" . $time . ";url=DoTimeRepage.php" . hReturnEcmsHashStrHref(1) . "\">";
    DoAutoUpAndDownInfo();
    //自动上/下线
    $todaytime = time();
    $b = 0;
    $sql = $empire->query("select doing,classid,doid from {$dbtbpre}enewsdo where isopen=1 and lasttime+dotime*60<{$todaytime}");
    while ($r = $empire->fetch($sql)) {
        $b = 1;
        if ($r[doing] == 1) {
            $cr = explode(',', $r[classid]);
            $count = count($cr) - 1;
            for ($i = 1; $i < $count; $i++) {
                if (empty($cr[$i])) {
                    continue;
                }
                $cr[$i] = (int) $cr[$i];
                ReListHtml($cr[$i], 1);
            }
        } elseif ($r[doing] == 2) {
            $cr = explode(',', $r[classid]);
            $count = count($cr) - 1;
            for ($i = 1; $i < $count; $i++) {
                if (empty($cr[$i])) {
                    continue;
                }
                $cr[$i] = (int) $cr[$i];
                ListHtmlIndex($cr[$i], $ret_r[0], 0);
            }
        } elseif ($r[doing] == 3) {
            $cr = explode(',', $r[classid]);
            $count = count($cr) - 1;
            for ($i = 1; $i < $count; $i++) {
                if (empty($cr[$i])) {
                    continue;
                }
                $cr[$i] = (int) $cr[$i];
                $ur = $empire->fetch1("select listid,pagetitle,filepath,filetype,totalsql,listsql,maxnum,lencord,listtempid,pagekeywords,pagedescription from {$dbtbpre}enewsuserlist where listid='" . $cr[$i] . "'");
                ReUserlist($ur, "");
            }
        } elseif ($r[doing] == 4) {
            $cr = explode(',', $r[classid]);
            $count = count($cr) - 1;
            for ($i = 1; $i < $count; $i++) {
                if (empty($cr[$i])) {
                    continue;
                }
                $cr[$i] = (int) $cr[$i];
                $ur = $empire->fetch1("select id,path,pagetext,title,pagetitle,pagekeywords,pagedescription,tempid from {$dbtbpre}enewspage where id='" . $cr[$i] . "'");
                ReUserpage($ur[id], $ur[pagetext], $ur[path], $ur[title], $ur[pagetitle], $ur[pagekeywords], $ur[pagedescription], $ur[tempid]);
            }
        } elseif ($r[doing] == 5) {
            $cr = explode(',', $r[classid]);
            $count = count($cr) - 1;
            for ($i = 1; $i < $count; $i++) {
                if (empty($cr[$i])) {
                    continue;
                }
                $cr[$i] = (int) $cr[$i];
                $ur = $empire->fetch1("select jsid,jsname,jssql,jstempid,jsfilename from {$dbtbpre}enewsuserjs where jsid='" . $cr[$i] . "'");
                ReUserjs($ur, '');
            }
        } elseif ($r[doing] == 6) {
            $cr = explode(',', $r[classid]);
            $count = count($cr) - 1;
            for ($i = 1; $i < $count; $i++) {
                if (empty($cr[$i])) {
                    continue;
                }
                $cr[$i] = (int) $cr[$i];
                ListHtml($cr[$i], $ret_r, 5);
            }
        } else {
            $indextemp = GetIndextemp();
            NewsBq($classid, $indextemp, 1, 0);
        }
        $empire->query("update {$dbtbpre}enewsdo set lasttime={$todaytime} where doid='{$r['doid']}'");
    }
    if ($b) {
        echo "最后执行时间:" . date("Y-m-d H:i:s", $todaytime) . "<br><br>";
    }
}