Ejemplo n.º 1
0
} elseif ($job == 'doc_edit2') {
    echo head();
    $id = $gpc->get('id', int);
    $icomment = $gpc->get('icomment', str);
    $title = $gpc->get('title', arr_str);
    $active = $gpc->get('active', arr_int);
    $author = $gpc->get('author', int);
    $use = $gpc->get('use', arr_int);
    $groups = $gpc->get('groups', arr_int);
    $content = $gpc->get('template', arr_none);
    $result = $db->query("SELECT type FROM {$db->pre}documents WHERE id = '{$id}' LIMIT 1");
    if ($db->num_rows($result) == 0) {
        error('admin.php?action=cms&job=doc', $lang->phrase('admin_cms_document_doesnt_exist'));
    }
    $doc = $db->fetch_assoc($result);
    $types = doctypes();
    $format = $types[$doc['type']];
    $i = 0;
    foreach ($use as $lid => $usage) {
        if ($usage == 1) {
            $i++;
        }
    }
    if ($i == 0) {
        error('javascript:history.back(-1);', $lang->phrase('admin_cms_havent_checked_box'));
    }
    $result = $db->query('SELECT COUNT(*) FROM ' . $db->pre . 'groups');
    $count = $db->fetch_num($result);
    if (count($groups) == $count[0]) {
        $groups = 0;
    } else {
Ejemplo n.º 2
0
 0 = Keiner, 1 = HTML, 2 = PHP(+HTML), 3 = BB-Code
Template:
 Leer = Ausgabe, Vorhanden = Einfügen
Inline:
 0 = Template hinzufügen, 1 = Template in der Datei
*/
if ($my->p['docs'] == 1 && GroupCheck($info['groups'])) {
    $memberdata = cache_memberdata();
    if (is_id($info['author']) && isset($memberdata[$info['author']])) {
        $info['name'] = $memberdata[$info['author']];
    } else {
        $info['name'] = $lang->phrase('fallback_no_username');
    }
    $info['date'] = str_date($lang->phrase('dformat1'), times($info['date']));
    $info['update'] = str_date($lang->phrase('dformat1'), times($info['update']));
    $type = doctypes();
    if (isset($type[$info['type']])) {
        $typedata = $type[$info['type']];
    } else {
        $typedata = array('title' => 'Fallback', 'template' => '', 'parser' => 1, 'inline' => 1, 'remote' => 0);
    }
    if ($typedata['inline'] == 0) {
        if ((empty($info['content']) || $typedata['remote'] == 1) && $typedata['template'] != 'frame') {
            $info['content'] = @file_get_contents($info['file']);
        }
        $info['content'] = DocCodeParser($info['content'], $typedata['parser']);
        $breadcrumb->Add($info['title']);
        echo $tpl->parse("header");
        if (empty($typedata['template'])) {
            echo $info['content'];
        } else {