예제 #1
0
function farc_static($aid = 0)
{
    global $db, $tblprefix, $arc, $timestamp, $cms_abs, $infohtmldir, $templatedir, $G, $_no_dbhalt, $btags, $mconfigs, $_mp, $_actid, $_midarr, $_a_vars, $_a_var, $mpnav, $mptitle, $mpstart, $mpend, $mppre, $mpnext, $mppage, $mpcount, $mpacount;
    @extract($mconfigs, EXTR_SKIP);
    if ($aid) {
        $arc->init();
        $arc->arcid($aid);
    }
    if (empty($arc->aid)) {
        return false;
    }
    if (!$arc->archive['checked'] || !$arc->archive['startdate'] || $arc->archive['enddate'] && $arc->archive['enddate'] < $timestamp) {
        //失效信息,取消静态
        farc_unstatic(0);
        return false;
    }
    if (!($tplname = $arc->catalog['arctpl'])) {
        return false;
    }
    $namepre = $infohtmldir . '/a-' . $arc->aid . '-';
    $_da =& $arc->archive;
    $_o_content = ob_get_contents();
    ob_clean();
    $_no_dbhalt = true;
    $pcount = 1;
    for ($_pp = 1; $_pp <= $pcount; $_pp++) {
        $_mp = $G = array();
        $_mp['surlpre'] = $cms_abs . $namepre . '{$page}.html';
        $_mp['static'] = 1;
        $_mp['nowpage'] = $_pp;
        _aenter($_da, 1);
        @extract($btags);
        extract($_da, EXTR_OVERWRITE);
        tpl_refresh($tplname);
        @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
        $_content = ob_get_contents();
        ob_clean();
        str2file($_content, M_ROOT . $namepre . "{$_pp}.html");
        unset($_content);
        $pcount = @$_mp['pcount'];
    }
    echo $_o_content;
    unset($_o_content);
    $_no_dbhalt = false;
    $db->query("UPDATE {$tblprefix}farchives SET arcurl='a-" . $arc->aid . "-1.html' WHERE aid='" . $arc->aid . "'");
    return true;
}
예제 #2
0
            }
            $aedit = new cls_farcedit();
            $arc = new cls_farchive();
            foreach ($selectid as $aid) {
                $aedit->set_aid($aid);
                if (!empty($arcdeal['delete'])) {
                    $aedit->arc_delete();
                    continue;
                }
                if (!empty($arcdeal['check'])) {
                    $aedit->arc_check(1);
                } elseif (!empty($arcdeal['uncheck'])) {
                    $aedit->arc_check(0);
                }
                if (!empty($arcdeal['static'])) {
                    farc_static($aid);
                } elseif (!empty($arcdeal['unstatic'])) {
                    farc_unstatic($aid);
                }
                $aedit->updatedb();
                $aedit->init();
                $arc->init();
            }
            unset($aedit, $arc);
            adminlog(lang('freeinfo_admin'), lang('freeinfo_list_admin'));
            amessage('freeopefin', "?entry=farchives&action=farchivesedit&page={$page}{$filterstr}");
        }
    } else {
        include M_ROOT . $u_tplname;
    }
}