示例#1
0
文件: search.php 项目: philum/cms
function next_sptime($d)
{
    //,4015,4380,4745,5110,5475,5840
    $r = array(1, 7, 30, 90, 365);
    for ($i = 5; $i < 20; $i++) {
        $r[] = $r[$i - 1] + 365;
    }
    $k = in_array_b($d, $r);
    if ($r[$k + 1]) {
        return $_GET['dig'] = $r[$k + 1];
    }
}
示例#2
0
文件: bubs.php 项目: philum/cms
function bub_msql($cat, $a, $b, $c)
{
    $r = msq_choose($a, $b, $c);
    $j = 'msql___' . $a . '_' . $b . '_';
    if ($c) {
        sort($r);
    }
    if ($r) {
        foreach ($r as $k => $v) {
            if (is_array($v)) {
                sort($v);
                $kp = in_array_b('php', $v);
                if ($kp !== false) {
                    unset($v[$kp]);
                    $ret[] = array('This', 'ajax', 'popup', $j . $k, '', '', $cat . '/' . $k, 'msql');
                }
                if (count($v) < 1) {
                    $ret[] = array($k, 'ajax', 'popup', $j . $k, '', '', $cat, 'msql');
                } else {
                    foreach ($v as $ka => $va) {
                        if ($a != 'design') {
                            $k = $b . '/' . $k;
                        }
                        $ret[] = array($va, 'ajax', 'popup', $j . $k . '*' . $va, '', '', $cat . '/' . $k, 'msql');
                    }
                }
            } else {
                if ($v == 'php') {
                    $ret[] = array('This', 'ajax', 'popup', $j . $c, '', '', $cat, 'msql');
                } else {
                    $ret[] = array($v, 'ajax', 'popup', $j . $c . '*' . $v, '', '', $cat, 'msql');
                }
            }
        }
    }
    return $ret;
}
示例#3
0
文件: admin.php 项目: philum/cms
function inject_fonts()
{
    $dr = 'fonts/';
    $ra = msql_read('server', 'edition_typos', '');
    $vra = array_keys_r($ra, 0);
    $rb = msql_read('system', 'edition_typos', '');
    $vrb = array_keys_r($rb, 0);
    $rc = explore($dr, 'files', 1);
    $vrf[] = 1;
    if ($rc) {
        foreach ($rc as $k => $v) {
            list($nm, $xt) = split_right('.', $v, 1, 1);
            //add
            if ($xt == 'woff' or $xt == 'eot' or $xt == 'svg') {
                // or $xt=='ttf'
                if (!in_array($nm, $vra) && !in_array($nm, $vrb) && !in_array($nm, $vrf)) {
                    $rb[] = array($nm, 'user', '', '', '');
                    $vrf[] = $nm;
                    $add[] = $nm;
                } elseif (!in_array($nm, $vra) && in_array($nm, $vrb)) {
                    $kb = in_array_b($nm, $vrb);
                    $rb[] = $ra[$kb];
                    $vrf[] = $nm;
                    $add[] = $nm;
                }
            }
        }
    }
    foreach ($rb as $k => $v) {
        if ($k != '_menus_') {
            //del
            if (!is_file($dr . $v[0] . '.woff') && !is_file($dr . $v[0] . '.eot') && !is_file($dr . $v[0] . '.svg')) {
                unset($rb[$k]);
                $del[] = $v[0];
            }
        }
    }
    if (!is_dir('msql/server')) {
        mkdir('msql/server');
    }
    //sav
    save_vars('msql/server/', 'edition_typos', $rb);
    save_vars('msql/system/', 'edition_typos', $rb);
    $ret .= 'table server/edition_typos updated' . br() . br();
    $ret .= count($add) . ' elements added: ' . br() . ($add ? implode(br(), $add) . br() : '') . br();
    $ret .= count($del) . ' elements deleted:' . br() . ($del ? implode(br(), $del) . br() : '') . br();
    return $ret;
}