Example #1
0
function DoReUserpage($add,$userid,$username){
	global $empire,$dbtbpre;
	//操作权限
	CheckLevel($userid,$username,$classid,"userpage");
	$id=$add['id'];
	$count=count($id);
	if(!$count)
	{
		printerror("EmptyReUserpageid","history.go(-1)");
    }
	for($i=0;$i<$count;$i++)
	{
		$id[$i]=(int)$id[$i];
		if(empty($id[$i]))
		{
			continue;
		}
		$ur=$empire->fetch1("select id,path,pagetext,title,pagetitle,pagekeywords,pagedescription,tempid from {$dbtbpre}enewspage where id='".$id[$i]."'");
		ReUserpage($ur[id],$ur[pagetext],$ur[path],$ur[title],$ur[pagetitle],$ur[pagekeywords],$ur[pagedescription],$ur[tempid]);
	}
	//操作日志
	insert_dolog("");
	printerror("DoReUserpageSuccess",$_SERVER['HTTP_REFERER']);
}
Example #2
0
function ReUserpageAll($start = 0, $from, $userid, $username)
{
    global $empire, $public_r, $fun_r, $dbtbpre;
    $start = (int) $start;
    $b = 0;
    $sql = $empire->query("select id,path,pagetext,title,pagetitle,pagekeywords,pagedescription,tempid from {$dbtbpre}enewspage where id>{$start} order by id limit " . $public_r['reuserpagenum']);
    while ($r = $empire->fetch($sql)) {
        $b = 1;
        $newstart = $r[id];
        ReUserpage($r[id], $r[pagetext], $r[path], $r[title], $r[pagetitle], $r[pagekeywords], $r[pagedescription], $r[tempid]);
    }
    //完毕
    if (empty($b)) {
        //操作日志
        insert_dolog("");
        printerror("ReUserpageAllSuccess", $from);
    }
    echo $fun_r['OneReUserpageSuccess'] . "(ID:<font color=red><b>" . $newstart . "</b></font>)<script>self.location.href='ecmschtml.php?enews=ReUserpageAll&start={$newstart}&from=" . urlencode($from) . hReturnEcmsHashStrHref(0) . "';</script>";
    exit;
}
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>";
    }
}