Esempio n. 1
0
" /></td>
        </tr>
        <tr>
          <td><label for="author_www"><img src="./stuff/img/icons/www.png" alt="www" /> <?php 
    echo $lang['comm_www'];
    ?>
</label></td>
          <td><input type="text" name="author_www" class="text" id="author_www" value="<?php 
    echo check_text($var['author_www']);
    ?>
" /></td>
        </tr>
        
        <?php 
    if (file_exists(MN_ROOT . $file['xfields'])) {
        $xfields = get_unserialized_array('xfields');
        foreach ($xfields as $xVar => $x) {
            if ($x['section'] != 'comments') {
                continue;
            } else {
                $thisVar = isset($_POST['x' . $xVar]) ? check_text($_POST['x' . $xVar], true) : @$var['xfields_array'][$xVar];
                if (isset($x['type']) && $x['type'] == 'select') {
                    $xField = '<select name="x' . $xVar . '" id="x' . $xVar . '" class="mn-xfield-select">';
                    foreach ($x['options'] as $oKey => $oValue) {
                        $sel = $thisVar == $oKey ? ' selected="selected"' : '';
                        $xField .= '<option value="' . $oKey . '"' . $sel . '>' . $oValue . '</option>';
                    }
                    $xField .= '</select>';
                } else {
                    $xField = '<input type="text" name="x' . $xVar . '" id="mn-x' . $xVar . '" value="' . $thisVar . '" class="mn-xfield-input" />';
                }
Esempio n. 2
0
 if (file_exists($file['categories'])) {
     $c_file = file($file['categories']);
     array_shift($c_file);
     foreach ($c_file as $c_line) {
         $categories_count++;
     }
 }
 $tags_count = 0;
 if (file_exists($file['tags'])) {
     $t_file = file($file['tags']);
     array_shift($t_file);
     foreach ($t_file as $t_line) {
         $tags_count++;
     }
 }
 $pages = get_unserialized_array('pages');
 $pages_count = count($pages);
 $files_count = 0;
 if (file_exists($file['files'])) {
     $f_file = file($file['files']);
     array_shift($f_file);
     foreach ($f_file as $f_line) {
         $files_count++;
     }
 }
 $users_count = 0;
 $u_file = file($file['users']);
 array_shift($u_file);
 foreach ($u_file as $u_line) {
     $users_count++;
 }
Esempio n. 3
0
<?php

include './stuff/inc/mn-start.php';
$auth = user_auth('5');
$admin_tmpl['folders_main'] = true;
$folders = get_unserialized_array('folders');
$files_count = get_files_count('folders');
if (isset($_POST['action']) && $_POST['action'] == 'add') {
    if (isset($_POST['folder_name']) && !empty($_POST['folder_name'])) {
        $auto_id = file_exists($file['id_folders']) ? trim(file_get_contents($file['id_folders'])) : 1;
        $folder_parent = isset($_POST['folder_parent']) ? (int) $_POST['folder_parent'] : 0;
        $folders[$auto_id] = array('name' => check_text($_POST['folder_name'], true), 'parent_id' => $folder_parent);
        if (mn_put_contents($file['folders'], DIE_LINE . serialize($folders))) {
            mn_put_contents($file['id_folders'], $auto_id + 1);
            header('location: ./mn-folders.php?back=added&f=' . $auto_id);
            exit;
        } else {
            overal_header($lang['folders_folders'], $lang['folders_msg_put_contents_error'], 'error');
        }
    } else {
        overall_header($lang['folders_folders'], $lang['folders_msg_empty_folder_name'], 'error');
    }
} elseif (isset($_POST['action']) && $_POST['action'] == 'edit' && isset($_POST['id']) && array_key_exists($_POST['id'], $folders)) {
    if (!empty($_POST['folder_name'])) {
        $folders[$_POST['id']] = array('name' => check_text($_POST['folder_name'], true), 'parent_id' => (int) $_POST['folder_parent']);
        if (mn_put_contents($file['folders'], DIE_LINE . serialize($folders))) {
            header('location: ./mn-folders.php?back=edited&f=' . $_POST['id']);
            exit;
        } else {
            overal_header($lang['folders_folders'], $lang['folders_msg_put_contents_error'], 'error');
        }
Esempio n. 4
0
function xfields_tmpl($section, $section_xfields, $result)
{
    global $file;
    if (file_exists(MN_ROOT . $file['xfields'])) {
        $xfields = get_unserialized_array('xfields');
        $xfields_search = array();
        $xfields_replace = array();
        $item_xfields = unserialize($section_xfields);
        foreach ($xfields as $xVar => $x) {
            if ($x['section'] != $section) {
                continue;
            } else {
                $xfields_search[] = '{x' . strtoupper($xVar) . '}';
                $xfields_replace[] = isset($item_xfields[$xVar]) && !empty($item_xfields[$xVar]) ? $item_xfields[$xVar] : '';
                $xfields_search[] = '{xx' . strtoupper($xVar) . '}';
                if ($xfields[$xVar]['type'] == 'select' && is_array($xfields[$xVar]['options']) && array_key_exists($item_xfields[$xVar], $xfields[$xVar]['options'])) {
                    $xfields_replace[] = $xfields[$xVar]['options'][$item_xfields[$xVar]];
                } else {
                    $xfields_replace[] = '';
                }
            }
        }
        $result = str_ireplace($xfields_search, $xfields_replace, $result);
    }
    return $result;
}