Example #1
0
File: spe.php Project: philum/cms
function output_pages_spe($otp, $media, $spe)
{
    $npg = $_SESSION['prmb'][6];
    $page = $_SESSION['page'];
    $min = ($page - 1) * $npg;
    $max = $page * $npg;
    if (is_array($otp)) {
        foreach ($otp as $id => $nb) {
            if (is_numeric($id)) {
                $i++;
                //if($i>=$min && $i<$max){}
                if ($spe == 'track') {
                    $ret .= art_read_b($id, '', 1, '') . output_trk(read_idy($id, 'ASC'));
                } else {
                    $ret .= art_read_b($id, $nb, $media, '');
                }
            }
        }
    }
    //$n_pages=nb_page($i,$npg,$page);
    return $n_pages . $ret . $n_pages;
}
Example #2
0
File: ajax.php Project: philum/cms
     //ajx()
     reqp('tracks');
     $ret = save_track($id, $va, $opt, $optb);
     break;
 case "trkpreview":
     req('pop,spe,art,tri');
     $t = nms(65);
     $s = 550;
     $msg = miniconn(del_n($id), 2, 'test');
     $ret = divc('track', correct_txt($msg, '', 'sconn'));
     break;
 case "trckpop":
     req('pop,spe,art,tri');
     $_SESSION['read'] = $id;
     $t = 'Tracks';
     $ret = divs('width:550px;', output_trk(read_idy($id, "DESC")));
     break;
 case "trkedit":
     req('pop,spe,art,tri');
     if ($va) {
         $ret = plugin_func('tracks', 'trk_redit_sav', $id, $va);
     } else {
         $ret = plugin_func('tracks', 'trk_redit', $id, $va);
         $t = 'reedit';
     }
     break;
     //conn
 //conn
 case "conn":
     req('pop,spe,art,tri,mod');
     $ret = format_txt_r($id, $va, $opt);
Example #3
0
File: art.php Project: philum/cms
function prepare_tracks($id, $otp)
{
    if ($id == $_SESSION['read'] && !$_GET['page']) {
        if (rstr(1)) {
            $opt = "true";
        }
        $optb = @$_SESSION['opts']['tracks'];
        $opt = $optb ? $optb : $opt;
        if ($opt == "true" or $_GET['track'] && $_SESSION['auth'] > 5) {
            $ret = '<a name="trackback"></a>';
            $ret .= lj('txtcadr', 'popup_track___' . $id, pictxt('forum', nms(21))) . br();
        }
        if (count($otp) > 0) {
            $trk = output_trk($otp);
        }
        $_SESSION['cur_div'] = 'content';
        return $ret . divd('track' . $id, $trk);
    }
}
Example #4
0
File: mod.php Project: philum/cms
function wall_arts($t, $p)
{
    $id = 'wall' . $p;
    if ($t) {
        $ret = btn('txtcadr', $t) . br() . br();
    }
    $ret .= lj('', 'popup_track___' . $id, picto('chat§32') . picto('add')) . br() . br();
    $ret .= divd('track' . $id, output_trk(read_idy($id, 'DESC')));
    return $ret;
}
Example #5
0
File: ajax.php Project: philum/cms
     reqp('tracks');
     $ret = save_track($id, $va, $opt, $optb);
     break;
 case "trkpreview":
     req('pop,spe,art,tri');
     $t = nms(65);
     $s = 550;
     $msg = miniconn(del_n($id), 2, 'test');
     $ret = divc('track', correct_txt($msg, '', 'sconn'));
     break;
 case "trckpop":
     req('pop,spe,art,tri');
     $_SESSION['read'] = $id;
     $t = 'Tracks';
     $s = 550;
     $ret = output_trk(read_idy($id, 'ASC'));
     break;
 case "trkedit":
     req('pop,spe,art,tri');
     if ($va) {
         $ret = plugin_func('tracks', 'trk_redit_sav', $id, $va);
     } else {
         $ret = plugin_func('tracks', 'trk_redit', $id, $va);
         $t = 'reedit';
     }
     break;
     //conn
 //conn
 case "conn":
     req('pop,spe,art,tri,mod');
     $ret = format_txt_r($id, $va, $opt);
Example #6
0
File: admin.php Project: philum/cms
function admin()
{
    $qb = ses('qb');
    $qda = ses('qda');
    $qdu = ses('qdu');
    $USE = ses('USE');
    $auth = ses('auth');
    $admin = $_GET['admin'] ? $_SESSION['admin'] = $_GET['admin'] : $_SESSION['admin'];
    if ($_GET['set']) {
        $_SESSION['set'] = $_GET['set'];
    }
    if ($USE != "") {
        $hubname = rse("hub", $qdu . ' WHERE name="' . $qb . '"');
        if (!$hubname) {
            $hubname = $qb;
        }
        list($autologok, $userhub) = sql('name,hub', 'qdu', 'r', 'ip="' . hostname() . '"');
    }
    $rep = "params";
    //verif_user
    if ($USE != $qb && $USE != "" && $userhub) {
        $hub = lka('/' . $USE, $USE);
    } elseif ($USE != $qb && $USE != "" && $autologok != $USE && $autologok) {
        $alert .= lkc('txtx', '/?log=on', 'autolog') . ' ';
    } elseif ($USE == $qb && !$userhub && prmb(11) >= 4) {
        $alert .= lkc("txtred", "/?log=create_hub", "create_hub!");
    } elseif ($USE == "") {
        $reta = lkc('txtx', htac('module') . 'Home', $qb) . br() . br() . loged($USE, $_SESSION['iq'], "", 7) . br();
    }
    //admin_menu
    $aff = adminauthes();
    if ($admin == "=") {
        $_SESSION['set'] = $_GET['set'] = $USE ? "Global" : "User";
    }
    //defaults
    if ($aff[$_GET['set']]) {
        $admin = key($aff[$_GET['set']]);
    }
    $_SESSION['admin'] = $admin;
    $goto = '/?admin=' . $admin;
    //if(!$userhub){unset($aff['User']['mail']); unset($aff['User']['password']);}
    //auto_select_category
    foreach ($aff as $k => $v) {
        if ($v[$admin]) {
            $_SESSION['set'] = $k;
            $curauth = $v[$admin];
        }
        $raf = array_merge_b($raf, array_keys($v));
    }
    if ($curauth === false) {
        $curauth = 7;
    }
    //login
    if ($USE) {
        $w .= lkc('popw', htac('module') . 'Home', pictxt('home', $hubname)) . ' ';
        $w .= btn("popbt", pictxt('user', $USE . ' ' . asciinb($auth)) . ' (' . nameofauthes($auth) . ')');
    }
    //fastmenu
    $fmn = array('console', 'params', 'restrictions', 'apps', 'css', 'finder', 'templates', 'connectors', 'plugin', 'msql', 'tools', 'pictos', 'stats', 'update');
    foreach ($raf as $v) {
        if (in_array($v, $fmn)) {
            $tit .= lkc(active($admin, $v), htac('admin') . $v, pictit(mimes_types($v), $v)) . ' ';
        }
    }
    $reta .= divc('right', $w . $alert);
    $tit .= lkc('txtit', htac('admin') . $admin, $admin) . ' ';
    if ($admin != "=") {
        $reta .= div('', $tit);
    }
    if ($auth >= 7 && $admin == 'update') {
        $ret = adm_update();
    }
    if ($auth >= $curauth && $curauth) {
        switch ($admin) {
            //global
            case 'console':
                $ret = adm_console($auth);
                break;
            case 'apps':
                require_once 'adminx.php';
                $ret = adm_apps($_GET['set'], '', $_GET['dig']);
                break;
            case 'messages':
                if ($qb == $USE or $auth >= $curauth) {
                    $ret = adm_messages();
                } else {
                    $ret = contact(nms(84), 'txtcadr');
                }
                break;
            case 'hubs':
                $ret = adm_hubs($auth);
                break;
            case 'nodes':
                $ret = adm_nodes($auth, $goto);
                break;
            case 'stats':
                list($p, $o) = explode('/', $_GET['set']);
                $ret = plugin('stats', $p, $o);
                break;
            case 'newsletter':
                $ret = adm_newsletter($_GET['send']);
                break;
            case 'disk':
                $ret = plugin('disk', '', '');
                break;
            case 'share':
                $ret = plugin('share', '', '');
                break;
            case 'tickets':
                $ret = plugin('tickets', '', '');
                break;
            case 'faq':
                $r = msql_read('system', 'program_faq', '');
                $ret = nl2br(stripslashes(make_divtable($r, 1)));
                break;
        }
        //articles
        if ($_SESSION['set'] == 'Articles') {
            switch ($admin) {
                case 'create':
                    $ret = f_inp('', '');
                    break;
                case 'categories':
                    $ret = catarts();
                    break;
                case 'trackbacks':
                    req('mod,art');
                    $ret = trkarts('');
                    break;
                default:
                    $ret = adminarts();
                    break;
            }
        }
        switch ($admin) {
            case 'chat':
                require_once 'art.php';
                $ret = output_trk(read_idy('microchat', 'DESC'));
                break;
            case 'shop':
                $ret = helps('shop_class');
                break;
            case 'book':
                $ret = lkc('txtblc', '/plug/book.php', 'book');
                break;
        }
        //configs
        switch ($admin) {
            case 'restrictions':
                $ret = adm_restrictions();
                break;
            case 'params':
                $ret = adm_params($curauth, rep);
                break;
            case 'avatar':
                if ($USE) {
                    $ret = adm_avatar(0);
                }
                break;
            case 'mail':
                if ($_POST['amail']) {
                    if ($USE == $qb) {
                        $_SESSION['qbin']['adminmail'] = $_POST['amail'];
                    }
                    update('qdu', 'mail', $_POST['amail'], 'name', $USE);
                }
                $ml = rse('mail', $qdu . ' WHERE name = "' . $USE . '"');
                if ($ml) {
                    $valu = input2('text', 'amail', $ml . '" size="35" maxlength="50') . ' ' . input2('submit', 'Submit', 'modif_mail', '');
                }
                $ret = form($goto, $valu);
                break;
            case 'password':
                $ret = set_password($USE);
                break;
            case 'banner':
                $ret = set_ban();
                break;
            case 'descript':
                $ret = editbrain($admin);
                break;
            case 'google':
                $ret = editbrain($admin);
                break;
            case 'members':
                $ret = adm_members_a($auth, $goto);
                break;
            case 'authes':
                $titles = array('fonction', 'auth');
                if (auth(6)) {
                    $ret = msqlink('system', 'admin_authes') . br();
                }
                foreach ($aff as $k => $v) {
                    $datas = '';
                    arsort($v);
                    foreach ($v as $ka => $va) {
                        $datas[$ka] = array($va);
                    }
                    $outre[$k] = make_tables($titles, $datas, 'txtblc', '');
                }
                $ret .= make_tabs($outre, 'at');
                break;
        }
        //constructors
        switch ($admin) {
            case 'css':
                $ret = adm_editcss();
                break;
            case 'fonts':
                $ret = edit_fonts();
                break;
            case 'connectors':
                $ret = data_brain('connectors') . br() . br();
                $ret .= lkc('txtblc', $goto . '&help==', 'connectors_infos') . br();
                if ($_GET['help']) {
                    $ret .= conn_help() . br();
                }
                break;
            case 'modules':
                $ret = data_brain('modules') . br() . br() . adm_mod_hlp($goto);
                break;
            case 'templates':
                $ret = data_brain('template');
                break;
            case 'plugin':
                $ret = adm_plugin();
                break;
            case 'msql':
                $ret = adm_msql();
                break;
            case 'dev':
                $ret = plugin('dev', '', '');
                break;
            case 'editags':
                req('meta');
                $ret = admin_tags(get('set'));
                break;
            case 'finder':
                $ret = call_finder($qb, 'disk');
                break;
            case 'backup':
                $ret = adm_backup($qb, $auth, $goto, $rep);
                break;
            case 'update_notes':
                $ret .= adm_update_notes('', 1);
                break;
            case 'plug':
                $ret .= adm_edit_plug();
                break;
        }
        if ($admin && !$ret && $auth >= $curauth) {
            //editbrain
            $ret = plugin($admin, $_GET['p'], $_GET['o']);
        }
    } else {
        switch ($admin) {
            case 'members':
                $ret = adm_members_b();
                break;
        }
    }
    #render
    if ($_SESSION['admin'] && !$_GET['callj']) {
        $head = $reta . br();
    } else {
        $head = bal('h2', lka('/admin/' . $_SESSION['admin'], $_SESSION['admin'])) . br();
    }
    return $head . $ret;
}
Example #7
0
File: api.php Project: philum/cms
function api_build($r, $ra)
{
    $n = count($r);
    $pr = $ra['preview'];
    $tp = $ra['template'];
    $cmd = $ra['cmd'];
    if ($rch = $ra['search']) {
        $pr = 'rch';
        $_GET['search'] = $rch;
        $_GET['look'] = $rch;
    }
    if ($cmd == 'panel') {
        foreach ($r as $k => $v) {
            $re[] = pane_art($k, $o);
        }
    } elseif ($cmd == 'track') {
        foreach ($r as $k => $v) {
            //cmd tracks
            $re[] = art_read_b($k, '', 1, '') . output_trk(read_idy($k, 'asc'));
        }
    } else {
        foreach ($r as $k => $v) {
            $prw = $pr == 'auto' ? $v['re'] > 2 ? 2 : 1 : $pr;
            $re[] = api_build_arts($v, $prw, $tp);
        }
    }
    if ($ra['cols']) {
        return columns($re, $ra['cols']);
    }
    return implode('', $re);
}