예제 #1
0
파일: spe.php 프로젝트: philum/cms
function dig_it_j($n, $go)
{
    $r = define_digr();
    //most_read
    if (!$r[$n]) {
        $r[$n] = $n > 365 ? round($n / 365, 2) : $n;
    }
    $nprev = time_prev($n);
    $r[$n] .= ' ' . ($n < 365 ? plurial($r[$n], 3) : plurial($r[$n], 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
    return divs('float:right;', slctmenus_sj($r, $go, $n));
}
예제 #2
0
파일: art.php 프로젝트: philum/cms
function play_req($wh)
{
    $qda = $_SESSION['qda'];
    $slct = $qda . '.id,' . $qda . '.ib,' . $qda . '.day,mail,frm,suj,img,nod,thm,name,lu,re,host';
    if ($_SESSION['lang'] != 'all') {
        $in = lang_req();
    }
    $wh = 'nod="' . $_SESSION['qb'] . '" ' . $wh;
    if ($dig = get('dig')) {
        $dayb = calc_date($dig);
        $daya = calc_date(time_prev($dig));
    } else {
        $dayb = ses('dayb');
        $daya = ses('daya');
    }
    $wh .= ' and ' . $qda . '.day<' . $daya;
    if ($dayb) {
        $wh .= ' and ' . $qda . '.day>' . $dayb;
    }
    return array($slct, $in, $wh, $qda . '.' . prmb(9), ' group by ' . $qda . '.id');
}
예제 #3
0
파일: search.php 프로젝트: philum/cms
function rech_catag($cat, $tag, $utg, $n)
{
    $wh = 'select ' . ses('qda') . '.id from ' . ses('qda') . '';
    if ($tag) {
        $idtag = sql('id', 'qdt', 'v', 'tag="' . $tag . '"');
        $wh .= ' inner join ' . ses('qdta') . ' on ' . ses('qdta') . '.idart=' . ses('qda') . '.id and ' . ses('qdta') . '.idtag="' . $idtag . '"';
    }
    $wh .= ' where nod="' . ses('qb') . '" and re>0 and day>"' . calc_date($n) . '"';
    if ($n > 7) {
        $wh .= ' and day<"' . calc_date(time_prev($n)) . '"';
    }
    if ($cat) {
        $wh .= ' and frm="' . $cat . '"';
    }
    if ($cat or $tag) {
        $rb = sql_b($wh . ' order by ' . ses('qda') . '.id desc', 'k');
    }
    return $rb;
}
예제 #4
0
파일: mod.php 프로젝트: philum/cms
function trkarts($p, $t = '')
{
    $p = $_GET['dig'] ? $_GET['dig'] : $p;
    $p = is_numeric($p) ? $p : $_SESSION['nbj'];
    if (!$p) {
        $p = 30;
    }
    $np = time_prev($p);
    $ret = dig_it_j($p, 'modtrk_ajxlnk___VAR' . $mx . '/' . ajx($t) . '/' . $d . '/' . $o . ':' . ajx('tracks'));
    $qda = ses('qda');
    $qdi = ses('qdi');
    $r = sql_inner($qdi . '.frm', 'qda', 'qdi', 'frm', 'k', 'where ' . $qda . '.nod="' . ses('qb') . '" AND ' . $qda . '.re>0 AND ' . $qdi . '.day>' . calc_date($p) . ' AND ' . $qdi . '.day<' . calc_date($np) . ' AND substring(' . $qda . '.frm,1,1)!="_" ORDER BY ' . $qdi . '.day DESC');
    if ($r) {
        $ret .= build_titl($r, $t ? $t : 'Tracks', 21);
        $ret .= output_pages_spe($r, 1, 'track');
    }
    return divd('modtrk', $ret);
}
예제 #5
0
파일: admin.php 프로젝트: philum/cms
function make_artlist($qr)
{
    $sqlm = $_SESSION['sqlimit'];
    $admin = $_GET['admin'];
    $dig = $_GET['dig'] ? $_GET['dig'] : $_SESSION['nbj'];
    $sqlm = 'AND day <' . $_SESSION['daya'] . '';
    if ($dig) {
        $sqlm .= ' AND day>"' . calc_date($dig) . '" AND day<"' . calc_date(time_prev($dig)) . '"';
    }
    if ($admin == 'all_arts') {
        $wh = '';
    } elseif ($admin == 'my_arts') {
        $wh .= 'AND name="' . $_SESSION['USE'] . '"';
    } elseif ($admin == 'users_arts') {
        $wh .= 'AND name!="' . $_SESSION['USE'] . '"';
    } elseif ($admin == 'sys_arts') {
        $wh .= 'AND frm="_system"';
        $sqlm = '';
    } elseif ($admin == 'trash') {
        $wh .= 'AND frm="_trash"';
        $sqlm = '';
    } elseif ($admin == 'not_published') {
        $wh .= 'AND re="0"';
    }
    if ($_GET['cat']) {
        $wh = ' AND frm="' . $_GET['cat'] . '" AND re>="1"';
    }
    if ($_GET['triart']) {
        $tri = $_GET['triart'];
    } else {
        $tri = 'id';
    }
    if ($_GET['triorder'] == 1) {
        $tri .= ' ASC';
    } elseif ($_GET['triorder'] == 2) {
        $tri .= ' DESC';
    } else {
        $tri .= ' DESC';
    }
    $ordr = $tri ? ' ORDER BY ' . $tri : '';
    if ($admin == 'categories') {
        $sqlm = '';
        $ordr = '';
    }
    $sql = 'nod="' . ses('qb') . '" ' . $wh . ' ' . $sqlm . $ordr;
    $req = sql(implode(',', $qr), 'qda', 'q', $sql);
    while ($data = mysql_fetch_array($req)) {
        foreach ($qr as $v) {
            $ret[$data['id']][$v] = $data[$v];
        }
    }
    return $ret;
}
예제 #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);
}
예제 #7
0
파일: spe.php 프로젝트: philum/cms
function define_load()
{
    $rech = good_rech();
    //active console
    $days = getorpost('dig', ses('nbj'));
    $dayb = calc_date($days);
    $pday = time_prev($days);
    if ($pday == 1) {
        $pday = 0;
    }
    $daya = calc_date($pday);
    if (get('tag')) {
        $load = tag_arts(get('tag', ses('nbj')), '', $days, $pday);
    } elseif ($rech) {
        $_SESSION['frm'] = '';
        if (!get('search')) {
            $load = $_SESSION["recache"][$vrf];
        }
        if (!$load) {
            require 'plug/search.php';
            $load = rech($rech, $days);
        }
        if (is_array($load)) {
            if (get('bydate')) {
                krsort($load);
            }
        }
        $_SESSION["recache"][$vrf] = $load;
    } elseif (get('source')) {
        $_SESSION['frm'] = '';
        if (get('dig')) {
            $load = tri_rqt_d(get('source'), 'mail', $daya, $dayb);
        } elseif ($_SESSION['rqt']) {
            foreach ($_SESSION['rqt'] as $k => $v) {
                if (strpos($v[9], get('source')) !== false) {
                    $load[$k] = 1;
                }
            }
        }
    } elseif (get('parent')) {
        $load = sql('id', 'qda', 'k', 'ib=' . get('parent'));
    } elseif (get('rub_tag')) {
        $rub_t = get('rub_tag');
        $rbtags = tri_rqt_rubtags(ses('frm'), 5, $daya, $dayb);
        $load = tri_rub_tags($rbtags, $rub_t);
    } elseif (get('author')) {
        $load = tri_rqt_d(get('author'), 'name', $daya, $dayb);
    } elseif ($gets = detect_uget()) {
        $load = tag_arts($gets[1], $gets[2], $days, $pday);
    }
    if ($load) {
        save_get();
    }
    return $load;
}
예제 #8
0
파일: api.php 프로젝트: philum/cms
function api_arts_rq($frm, $dig)
{
    $ra['hub'] = ses('qb');
    if ($frm == 'Home' or $frm == 'All') {
        $ra['cat'] = '';
    } elseif (substr($frm, 0, 1) != '_' or $_SESSION['auth'] > 3) {
        $ra['link'] = 'cat';
        $ra['cat'] = $frm;
    }
    $ra['nochilds'] = $_SESSION['rstr'][33];
    $ra['notpublished'] = 1;
    if ($dig) {
        $ra['minday'] = $dig;
        $ra['maxday'] = time_prev($dig);
    } else {
        $ra['mintime'] = ses('dayb');
        $ra['maxtime'] = ses('daya');
    }
    if ($_SESSION['lang'] != 'all') {
        $ra['lang'] = $_SESSION['lang'];
    }
    $ra['order'] = prmb(9);
    $ra['nbyp'] = prmb(6);
    $ra['page'] = ses('page');
    //$ra['group']='id';
    return $ra;
}