예제 #1
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;
}
예제 #2
0
파일: adminx.php 프로젝트: philum/cms
function select_mods_m()
{
    $r = msq_choose('users', ses('qb'), 'mods');
    sort($r);
    $nw = msq_find_next($r);
    $ret = slct_menus($r, '/?admin=console&slct_mods=', prmb(1), 'active', '', 'v') . ' ';
    $ret .= lkc("popbt", '/?admin=console&newfrom_mods=' . $nw, nms(99) . ':' . $nw) . ' ';
    //new
    $prmb = sql('config', 'qdu', 'v', 'name="' . ses('qb') . '"');
    $prmb1 = strprm($prmb, 1, '#');
    if ($prmb1 != prmb(1)) {
        $ret .= lkc("txtyl", '/?admin=console&adopt_mods==', nms(66)) . ' ';
    }
    //apply
    return btn('nbp', btn('txtsmall', 'mods') . ' ' . $ret) . hlpbt('console_mods') . ' ';
}
예제 #3
0
파일: mod.php 프로젝트: philum/cms
function rub_tags($t)
{
    $t = $t ? btn('txtcadr', $t) : '';
    //not tested
    $dayb = $_GET['dig'] ? calc_date($_GET['dig']) : $_SESSION['dayb'];
    $r = tag_arts($tag, $cat, $dayb);
    if ($r) {
        $tags = slct_menus($r, htac('rub_tag'), $_GET['rub_tag'], 'active', '', 'k');
    }
    return $t . btn("nb_pages", $tags) . br();
}
예제 #4
0
파일: _zip_prog.php 프로젝트: philum/cms
function plug__zip_prog()
{
    $r = array('philum', 'install', 'fonts', 'pictos', 'icons', 'bkg', 'avatar');
    return slct_menus($r, '?createzip=', $_GET['createzip'], "", "", "v");
}
예제 #5
0
파일: admin.php 프로젝트: philum/cms
function adm_update()
{
    $goto = '/?admin=update';
    $_GET['update'] = $_GET['update'] ? $_GET['update'] : '=';
    if ($_GET['updater']) {
        $pdst = 'plug/distribution';
        $d = read_file('http://philum.net/' . $pdst . '.php?page=../' . $pdst . '.php');
        write_file($pdst . '.php', '<' . '?php' . $d . '?' . '>');
    }
    //update_updater
    if ($_GET['updated'] == 'ok') {
        $uret .= update_ok();
    } else {
        $_SESSION['dlnb'] = 0;
        $uret .= picto('update', 32) . ' ' . lkc('txtbox', $goto . '&update=program', nms(59));
    }
    //$uret.=lj('txtx','popup_update','ok').' ';
    if (!is_file('fonts/philum.woff')) {
        $uret .= icon('alert§system/com') . ' ' . helps('updpictos') . br() . br();
    }
    $maj = checkupdate();
    if ($maj != $_SESSION['philum']) {
        $maj = 'local/distant=' . $_SESSION['philum'] . '/' . $maj;
    }
    $uret .= btn('popw', $maj) . ' ';
    //helps('update_help')
    $uret .= lkc('txtsmall2', '/?dev=dev', 'dev (progb)') . ' ';
    $uret .= lkc('txtsmall2', '/?admin=update_notes', picto('txt')) . br() . br();
    require_once 'plug/distribution.php';
    //echo $_SESSION['dlnb'];
    if ($_SESSION['updfirst']) {
        $uret .= lkc('txtyl', $goto . '&updater==', 'update_updater') . ' ';
    }
    $uret .= btn('nbp', slct_menus(array('/', 'prog', 'progb', 'msql', 'plug', 'js', 'gallery', 'fla', 'gdf', 'bkg', 'fonts', 'pictos', 'css', 'imgb/icons'), $goto . '&dest=', $_SESSION['dest'], 'active', '', 'v')) . ' ';
    $uret .= lkc('txtbox', $goto . '&update=all', picto('update') . ' ' . $_SESSION['dest']) . ' ';
    if ($_SESSION['dest'] == 'fonts') {
        $uret .= hlpbt('updfonts') . ' ' . lkc('txtbox', $goto . '&update=del', 'del_obsoletes');
    }
    $uret .= br() . br();
    $patch = '160101';
    //patches//set update_ok//150521
    if ($patch) {
        $pok = msql_read('server', 'program_patches', $patch);
        $ptch = msql_read('system', 'program_patches', $patch);
        if ($pok == 0 or $_GET['force']) {
            if ($_GET['patch']) {
                $uret .= plugin('patchs', $ptch['function']);
                if ($uret) {
                    modif_vars('server', 'program_patches', array(1), $patch);
                }
            } else {
                $uret .= divc('txtalert', lkc('txtyl', $goto . '&patch==', stripslashes($ptch['function'])) . ' ' . $ptch['explics']) . br();
            }
        } else {
            $uret .= divc('txtalert', lkc('txtyl', $goto . '&patch==&force==', 'force patch')) . br();
        }
    }
    //files
    $uret .= $plug_output;
    return $uret;
}
예제 #6
0
파일: admin.php 프로젝트: philum/cms
function dig_it($n, $send, $rid = '')
{
    $r = define_digr();
    $g = $_GET[$send];
    if (!$r[$n]) {
        $r[$n] = $n >= 365 ? round($n / 365, 2) : $n;
    }
    $cur = $r[$n];
    $nprev = time_prev($n);
    $r[$n] .= ' ' . ($n < 365 ? plurial($cur, 3) : plurial($cur, 7));
    if ($n != 1 && $n != 7) {
        $r[$n] = $r[$nprev] . ' ' . nms(36) . ' ' . $r[$n];
    }
    //from
    if ($n > 365) {
        $r[$n] = date('Y', calc_date($n));
    }
    //from
    //$dig=$_GET['dig']?$_GET['dig']:$_SESSION['nbj'];
    if ($_SESSION['rstr'][3] != '1') {
        if ($rid) {
            $ret = slctmenusja($r, 'load' . $rid . '_api___' . $send . ':' . ajx($g) . '_', $n);
        } else {
            $ret = slct_menus($r, htacb($send, $g, 'dig'), $n, "active", "", "");
        }
    }
    return btn('nb_pages', $ret);
}