示例#1
0
文件: art.php 项目: philum/cms
function template($p, $tpl)
{
    if (!$tpl) {
        $tpl = @$_SESSION['opts']['template'];
    }
    //article
    if (!$tpl) {
        $tpl = $_SESSION['prma']['template'];
    }
    //module
    if (!$tpl) {
        $tmp = template_art();
    }
    if ($tpl == "pubart") {
        $tmp = rstr(55) ? template_u($tpl) : template_pubart();
    } elseif ($tpl == "pubart_j") {
        $tmp = rstr(55) ? template_u($tpl) : template_pubart_j();
    } elseif ($tpl == "pubart_b") {
        $tmp = rstr(55) ? template_u($tpl) : template_pubart_b();
    } elseif ($tpl == "titles") {
        $tmp = rstr(65) ? template_u($tpl) : template_titles();
    } elseif ($tpl == "tracks") {
        $tmp = rstr(66) ? template_u($tpl) : template_tracks();
    } elseif ($tpl == "book") {
        $tmp = rstr(67) ? template_u($tpl) : template_book();
    } elseif ($tpl == "products") {
        $tmp = template_product();
    } elseif ($tpl == "fastart") {
        $tmp = template_fastart();
    } elseif ($tpl == "weblink") {
        $tmp = template_weblink();
    } elseif ($tpl == "panart") {
        $tmp = template_panart();
    } elseif ($tpl == "read" && rstr(88)) {
        $tmp = template_u($tpl);
        if (!$tmp) {
            $tmp = template_read();
        }
    }
    if (!$tmp) {
        $tmp = template_art();
    }
    return template_build($tmp, $p);
}
示例#2
0
文件: art.php 项目: philum/cms
function template($p, $tpl)
{
    if (!$tpl) {
        $tpl = @$_SESSION['opts']['template'];
    }
    //article
    if (!$tpl) {
        $tpl = $_SESSION['prma']['template'];
    }
    //module
    if ($tpl) {
        $tmp = msql_read('users', $_SESSION['qb'] . '_template', $tpl);
        if (!$tmp) {
            $tmp = msql_read('', 'public_template', $tpl);
        }
    }
    if ($tpl == "pubart") {
        $tmp = rstr(55) && $tmp ? $tmp : template_pubart();
    } elseif ($tpl == "titles") {
        $tmp = rstr(65) && $tmp ? $tmp : template_titles();
    } elseif ($tpl == "tracks") {
        $tmp = rstr(66) && $tmp ? $tmp : template_tracks();
    } elseif ($tpl == "book") {
        $tmp = rstr(67) && $tmp ? $tmp : template_book();
    } elseif ($tpl == "products") {
        $tmp = $tmp ? $tmp : template_product();
    } elseif ($tpl == "fastart") {
        $tmp = $tmp ? $tmp : template_fastart();
    } elseif ($tpl == "weblink") {
        $tmp = $tmp ? $tmp : template_weblink();
    } elseif ($tpl == "read" && rstr(88)) {
        $tmp = $tmp ? $tmp : template_read();
    }
    //if($_SESSION['read'])$tmp=template_read();
    if (!$tmp) {
        $tmp = template_art();
    }
    return template_build($tmp, $p);
}
示例#3
0
文件: admin.php 项目: philum/cms
function data_brain($type)
{
    $slct = $_GET['slct'];
    if ($_POST['titl']) {
        $slct = $_POST['titl'];
    }
    $goto = '/?admin=' . ($type == 'template' ? 'templates' : $type);
    if ($type == 'template') {
        $lisb = array('articles', 'tracks', 'titles', 'pubart', 'book');
        $ret .= hlpbt('templates') . ' ';
    } else {
        $ret .= hlpbt('clbasic') . ' ';
    }
    $ret .= btn_switch('pubase', 1, $goto . '&slct=' . $slct, 'public') . ' ';
    $bs = $_SESSION['pubase'] ? 'public' : ses('qb');
    $nod = $bs . '_' . $type;
    $ret .= msqlink('', $bs . '_' . $type) . ' ';
    $ra = msql_read('', $nod, '', 1);
    if ($ra) {
        $list = array_keys($ra);
    }
    $csa = $_GET['local'] ? 'popdel' : 'popsav';
    if ($lisb) {
        $ret .= slct_menus($lisb, $goto . '&local=1&slct=', $slct, $csa, 'popbt', 'v') . ' ';
    }
    $ret .= lkc('txtx', $goto . '&slct=new', picto('add')) . br();
    $csa = !$_GET['local'] ? 'txtyl' : 'txtred';
    if ($ra) {
        $ret .= slct_menus($list, $goto . '&slct=', $slct, $csa, 'txtx', 'v') . ' ';
    }
    if ($type != 'template') {
        $forbid = data_forbidden_names($slct, $nod);
    }
    $ret .= $forbid . br();
    if ($_GET['erase'] && $slct) {
        modif_vars('users', $nod, $slct, 'del');
        relod($goto);
    }
    if ($_GET['erase'] && $type == 'template') {
        $_SESSION['template'][$slct] = '';
    }
    if ($slct) {
        //save
        $msg = $ra[$slct];
        $rmsg = array(addslashes($msg));
        if ($slct == 'pubart' && !rstr(55)) {
            $ret .= pictxt('alert', 'rstr(55)');
        }
        if ($slct == 'tracks' && !rstr(65)) {
            $ret .= pictxt('alert', 'rstr(65)');
        }
        if ($slct == 'titles' && !rstr(66)) {
            $ret .= pictxt('alert', 'rstr(66)');
        }
        if ($slct == 'book' && !rstr(67)) {
            $ret .= pictxt('alert', 'rstr(67)');
        }
        if ($_GET['mkpub']) {
            modif_vars('users', 'public_' . $type, $rmsg, $slct);
        }
        if ($_GET['mkpriv']) {
            modif_vars('users', ses('qb') . '_' . $type, $rmsg, $slct);
        }
        if ($type == 'template' && $_GET['local']) {
            if ($slct == 'articles') {
                $msg = template_art();
            } elseif ($slct == 'meta') {
                $msg = template_meta();
            } elseif ($slct == 'rssin') {
                $msg = template_rss();
            } elseif ($slct == 'pubart') {
                $msg = template_pubart();
            } elseif ($slct == 'tracks') {
                $msg = template_tracks();
            } elseif ($slct == 'titles') {
                $msg = template_titles();
            } elseif ($slct == 'book') {
                $msg = template_book();
            } elseif ($slct == 'products') {
                $msg = template_product();
            }
        }
        $ret .= codeline_editor($msg, $type, $slct);
        if (!$_SESSION['pubase'] && !$_GET['mkpub']) {
            $ret .= br() . lkc('txtx', $goto . '&slct=' . $slct . '&mkpub==', 'make public') . ' ';
        } elseif ($_SESSION['pubase'] && !$_GET['mkpriv']) {
            $ret .= br() . lkc('txtx', $goto . '&slct=' . $slct . '&mkpriv==', 'make private') . ' ';
        }
        $ret .= input(1, 'titl', $slct) . ' ';
        $ret .= lj('popsav', 'dtb_call__xd_admin_data*brain*sav_' . $bs . '_' . $type . '_titl|txarea', nms(57)) . ' ' . btd('dtb', '') . ' ';
        //sav
        if ($slct != 'default') {
            $ret .= lkc('txtyl', $goto . '&slct=' . $slct . '&erase==', 'x') . br();
        }
        $ret .= jmp_btn_cb() . br();
        $sj = sj('clva_call___admin,pop,tri,mod,spe,art_clview*basic*j_' . $type . '_' . $slct . '_clvb|txarea');
        $ret .= txarea($type . '" class="console" id="txarea" onkeyup="' . $sj . '" onclick="' . $sj, stripslashes($msg), 44, 14);
    }
    return divd('', $ret);
}