示例#1
0
文件: chtmlfun.php 项目: novnan/meiju
function ReUserjsAll($start = 0, $from, $userid, $username)
{
    global $empire, $public_r, $fun_r, $dbtbpre;
    $start = (int) $start;
    $b = 0;
    $sql = $empire->query("select jsid,jsname,jssql,jstempid,jsfilename from {$dbtbpre}enewsuserjs where jsid>{$start} order by jsid limit " . $public_r['reuserjsnum']);
    while ($r = $empire->fetch($sql)) {
        $b = 1;
        $newstart = $r[jsid];
        ReUserjs($r, "");
    }
    //完毕
    if (empty($b)) {
        //操作日志
        insert_dolog("");
        printerror("ReUserjsAllSuccess", $from);
    }
    echo $fun_r['OneReUserjsSuccess'] . "(ID:<font color=red><b>" . $newstart . "</b></font>)<script>self.location.href='ecmschtml.php?enews=ReUserjsAll&start={$newstart}&from=" . urlencode($from) . hReturnEcmsHashStrHref(0) . "';</script>";
    exit;
}
示例#2
0
function DoReUserjs($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //操作权限
    CheckLevel($userid, $username, $classid, "userjs");
    $jsid = $add['jsid'];
    $count = count($jsid);
    if (!$count) {
        printerror("EmptyReUserjsid", "history.go(-1)");
    }
    for ($i = 0; $i < $count; $i++) {
        $jsid[$i] = (int) $jsid[$i];
        if (empty($jsid[$i])) {
            continue;
        }
        $ur = $empire->fetch1("select jsid,jsname,jssql,jstempid,jsfilename from {$dbtbpre}enewsuserjs where jsid='" . $jsid[$i] . "'");
        ReUserjs($ur, '../');
    }
    //操作日志
    insert_dolog("");
    printerror("DoReUserjsSuccess", $_SERVER['HTTP_REFERER']);
}
function DoTimeRepage($time)
{
    global $empire, $dbtbpre;
    if (empty($time)) {
        $time = 120;
    }
    echo "<meta http-equiv=\"refresh\" content=\"" . $time . ";url=DoTimeRepage.php\">";
    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;
                }
                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;
                }
                ListHtml($cr[$i], $ret_r[0], 1);
            }
        } elseif ($r[doing] == 3) {
            $cr = explode(',', $r[classid]);
            $count = count($cr) - 1;
            for ($i = 1; $i < $count; $i++) {
                if (empty($cr[$i])) {
                    continue;
                }
                $ur = $empire->fetch1("select listid,pagetitle,filepath,filetype,totalsql,listsql,maxnum,lencord,listtempid 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;
                }
                $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;
                }
                $ur = $empire->fetch1("select jsid,jsname,jssql,jstempid,jsfilename from {$dbtbpre}enewsuserjs where jsid='" . $cr[$i] . "'");
                ReUserjs($ur, '');
            }
        } 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>";
    }
}