예제 #1
0
파일: ajax.php 프로젝트: philum/cms
if ($n == 'call' or $n == 'callp') {
    if ($n == 'callp') {
        $t = $va;
    }
    if ($res) {
        list($s, $h) = split('-', $res);
    }
    $s = $s ? $s : 640;
    if ($id) {
        req(str_replace('-', ',', $id));
    }
    $ret = call_user_func_array($va, array($opt, $optb, $res));
}
$eye = array('art', 'popart', 'popartmod');
if ($eye[$n]) {
    eye();
}
if ($tt && $pp) {
    $t = $tt;
}
if ($t == 'pagup') {
    $ret = pagup($ret);
} elseif ($t) {
    $ret = popup($t, $ret, $s, $p);
}
//
if (Head::$add) {
    Head::add('meta', array('http-equiv', 'Content-Type', 'text/html; charset=' . $_SESSION['enc']));
    echo Head::generate();
} else {
    header('Content-Type:text/html; charset=' . $_SESSION['enc']);
예제 #2
0
파일: rss.php 프로젝트: philum/cms
function plug_rss($hub, $preview)
{
    if ($hub) {
        $_GET['hub'] = $hub;
    }
    if ($preview == '=' or !$preview) {
        $preview = 2;
    }
    if (!$hub) {
        return slct_menus(ses('mn'), '/plug/rss/', '', '', '', 'kv');
    }
    require_once '../prog/lib.php';
    req('pop,art');
    require '../plug/sys.php';
    require '../plug/lib.php';
    $fnod = $_SESSION["qb"] . '_cache';
    $main = msql_read_b('users', $fnod, '', 1);
    $nb_arts = count($main);
    $lastid = lastid('qda');
    $last_art = $main[$lastid];
    $newest = key($main);
    $oldest = array_pop($main);
    $nb_days = round((time() - $oldest[0]) / 86400);
    $cache = 1;
    $f = '../plug/_data/' . $_SESSION["qb"] . '_' . $newest . '_' . $preview . '.xml';
    if (is_file($f) && !$_GET['rebuild'] && $cache) {
        return read_file($f);
    } else {
        $http = host();
        if ($preview) {
            req('tri,pop,art');
        }
        //spe,mod
        $xml .= '<' . '?xml version="1.0" encoding="iso-8859-1"?' . '>' . "\n";
        $xml .= '<rss version="2.0">' . "\n";
        $xml .= '<channel>' . "\n";
        $xml .= bal('title', $_SESSION['qb']) . "\n";
        $xml .= bal('link', $http) . "\n";
        $xml .= bal('description', $nb_arts . ' articles / ' . $nb_days . ' days - preview=' . $preview . ' - static url=' . $http . substr($f, 2)) . "\n";
        $xml .= bal('language', 'fr') . "\n";
        $xml .= bal('lastBuildDate', date("r", $last_art[0])) . "\n";
        if ($main) {
            $xml .= flux_xml($main, $preview) . "\n";
        }
        $xml .= '</channel>' . "\n";
        $xml .= '</rss>' . "\n";
        write_file($f, $xml);
        rss_del_old($newest);
    }
    //eye
    eye('rss');
    return $xml;
}