Beispiel #1
0
 echo '<option value="" class="description">--- ' . $lang['comm_all_dates'] . ' ---</option>';
 foreach ($comments_timestamps as $key => $value) {
     $sel = isset($_GET['d']) && $value == $_GET['d'] ? ' selected="selected" class="selected"' : '';
     echo '<option value="' . $value . '"' . $sel . '>' . $lang['month'][date('n', $key)] . ' ' . date('Y', $key) . '</option>';
 }
 echo '</select> ';
 echo '<select name="p">';
 echo '<option value="" class="description">--- ' . $lang['comm_all_posts'] . ' ---</option>';
 foreach ($posts as $key => $value) {
     $sel = isset($_GET['p']) && $key == $_GET['p'] ? ' selected="selected" class="selected"' : '';
     echo '<option value="' . $key . '"' . $sel . '>' . $value . '</option>';
 }
 echo '</select> ';
 echo '<select name="a">';
 echo '<option value="" class="description">--- ' . $lang['comm_all_authors'] . ' ---</option>';
 $mn_users = load_basic_data('users');
 foreach ($c_authors as $ca_id) {
     $sel = isset($_GET['a']) && $ca_id == $_GET['a'] ? ' selected="selected" class="selected"' : '';
     echo '<option value="' . $ca_id . '"' . $sel . '>' . $mn_users[$ca_id] . '</option>';
 }
 echo '</select> ';
 echo '<select name="i">';
 echo '<option value="" class="description">--- ' . $lang['comm_all_ip_addresses'] . ' ---</option>';
 foreach ($c_ips as $c_ip) {
     $sel = isset($_GET['i']) && $c_ip == $_GET['i'] ? ' selected="selected" class="selected"' : '';
     echo '<option value="' . $c_ip . '"' . $sel . '>' . $c_ip . '</option>';
 }
 echo '</select> ';
 echo '<select name="s">';
 echo '<option value="" class="description">--- ' . $lang['comm_all_statuses'] . ' ---</option>';
 $c_statuses = array(1, 2, 3, 5);
<?php

include './stuff/inc/mn-start.php';
$auth = user_auth('9');
$t_groups = array();
$t_groups = load_basic_data('templates_groups');
// compatibility issue for MNews version 2.2.0 and lower
if (!file_exists(MN_ROOT . $dir['templates'] . 'mn_default_19.html')) {
    mn_put_contents(MN_ROOT . $dir['templates'] . 'mn_default_19.html', $default_template[19]);
}
if (isset($_GET['action']) && $_GET['action'] == 'add') {
    $admin_tmpl['tmpl_add_step_1'] = true;
    $main_types = array();
    foreach ($templates as $i) {
        if (file_exists($dir['templates'] . 'mn_default_' . $i . '.html')) {
            continue;
        } else {
            $main_types[$i] = $lang['tmpl_tmpl_type_' . $i];
        }
    }
    if (isset($_GET['back']) && $_GET['back'] == 'exists') {
        overall_header($lang['tmpl_add_template'], $lang['tmpl_msg_tmpl_group_exists'], 'error');
    } elseif (isset($_GET['back']) && $_GET['back'] == 'empty') {
        overall_header($lang['tmpl_add_template'], $lang['tmpl_msg_tmpl_group_empty'], 'error');
    } else {
        overall_header($lang['tmpl_add_template'], $lang['tmpl_add_template'] . ' &raquo; ' . $lang['tmpl_step'] . ' 1/3', 'main');
    }
} elseif (isset($_POST['action']) && $_POST['action'] == 'add' && $_POST['step'] == '1') {
    if ($_POST['group_mode'] == '1' && $_POST['tmpl_group'] == '0') {
        $tg_name = 'mn_default';
    } elseif ($_POST['group_mode'] == '1' && $_POST['tmpl_group'] != '0') {
Beispiel #3
0
" /></td>
      </tr>
      <tr>
        <td class="labels vatt"><label for="description"><?php 
    echo $lang['files_description'];
    ?>
:</label></td>
        <td class="inputs"><textarea name="description" id="description" cols="40" rows="5"><?php 
    echo $var['description'];
    ?>
</textarea></td>
      </tr>
    </table>
    <?php 
    if ($var['dir'] == 'images' && file_exists(MN_ROOT . $file['galleries'])) {
        $galleries = load_basic_data('galleries');
        $var['galleries_array'] = explode(',', $var['galleries']);
        if (!empty($galleries)) {
            echo '<div id="galleries" class="round">';
            echo '<strong>' . $lang['galleries_galleries'] . '</strong>';
            echo '<ul class="galleries">';
            foreach ($galleries as $gal_id => $gal_name) {
                $checked = !empty($var['galleries']) && in_array($gal_id, $var['galleries_array']) ? ' checked="checked"' : '';
                echo '<li><input type="checkbox" name="galleries[]" id="gal_' . $gal_id . '" value="' . $gal_id . '"' . $checked . ' /> <label for="gal_' . $gal_id . '">' . $gal_name . '</label></li>';
            }
            echo '</ul></div>';
        }
    }
    ?>
    </p>
      <input type="hidden" name="file_id" value="<?php 
Beispiel #4
0
 if (isset($mn_mode) && $mn_mode == 'news') {
     $mn_lock = 'news';
 } elseif (isset($_GET['mode']) && $_GET['mode'] == 'rss') {
     $mn_mode = 'rss';
 } elseif (isset($_GET['mn_gallery']) && is_numeric($_GET['mn_gallery']) && !isset($mn_mode) && empty($mn_cat) && empty($mn_page_int)) {
     $mn_mode = 'gallery';
     $mn_gallery = (int) $_GET['mn_gallery'];
 }
 # check page number
 if (!isset($_GET['mn_p']) || !is_numeric($_GET['mn_p']) || $_GET['mn_p'] <= 0) {
     $_GET['mn_p'] = 1;
 }
 # --- Categories menu
 if (isset($mn_mode) && $mn_mode == 'menu') {
     if (file_exists(MN_ROOT . $file['categories'])) {
         $cats = load_basic_data('categories');
         if (isset($mn_menu_tmpl)) {
             $menu_tmpl = $mn_menu_tmpl;
             $mn_menu = '';
             $posts_count = get_posts_count();
         } else {
             $menu_tmpl = "\t\t\t<li>{ITEM}</li>\n";
             $mn_menu = "\n\n\t\t<ul class=\"mn-menu\" id=\"mn-cat-menu\">\n";
             $posts_count = array();
         }
         // unshift item at the beginning
         if (isset($mn_menu_unshift)) {
             if (is_array($mn_menu_unshift)) {
                 foreach ($mn_menu_unshift as $n => $unshift_item) {
                     $mn_menu .= str_ireplace('{ITEM}', $unshift_item, $menu_tmpl);
                 }
Beispiel #5
0
    ?>
 <span class="required">*</span></label></td>
        <td class="inputs"><input type="text" name="email" id="email" class="text" value="<?php 
    echo isset($var['email']) ? $var['email'] : '';
    ?>
" /></td>
      </tr>

      <tr>
        <td class="labels"><label for="group"><img src="./stuff/img/icons/group.png" alt="" width="16" height="16" /> <?php 
    echo $lang['users_group'];
    ?>
 <span class="required">*</span></label></td>
        <td class="inputs"><select name="group" id="group" class="custom long">
          <?php 
    $groups = load_basic_data('groups');
    foreach ($groups as $group_id => $group_name) {
        $sel = isset($var['group']) && $group_id == $var['group'] ? ' selected="selected"' : '';
        echo '<option value="' . $group_id . '"' . $sel . '>' . $group_name . '</option>';
    }
    ?>
        </td>
      </tr>

      <tr>
        <td class="labels"><label for="pass1"><img src="./stuff/img/icons/key.png" alt="" width="16" height="16" /> <?php 
    echo $lang['users_password'];
    if ($var['action'] == 'add') {
        echo ' <span class="required">*</span>';
    }
    ?>
<?php

include './stuff/inc/mn-start.php';
$admin_tmpl['galleries_main'] = true;
$admin_tmpl['code'] = false;
$galleries = file_exists($file['galleries']) ? load_basic_data('galleries') : array();
$files_count = get_files_count();
if (isset($_GET['action']) && $_GET['action'] == 'ajaxcall') {
    if (isset($_GET['gallery_name']) && !empty($_GET['gallery_name']) && !in_array($_GET['gallery_name'], $galleries)) {
        if (file_exists($file['galleries'])) {
            $galleries_file = file($file['galleries']);
            $galleries_file_lines = '';
            foreach ($galleries_file as $single_line) {
                $gallery_data = explode(DELIMITER, $single_line);
                if (substr($gallery_data[0], 0, 2) == '<?') {
                    $auto_increment_id = trim($gallery_data[1]);
                } else {
                    $galleries_file_lines .= $single_line;
                }
            }
        } else {
            $auto_increment_id = 1;
            $galleries_file_lines = '';
        }
        $galleries_file_content = SAFETY_LINE . DELIMITER . ($auto_increment_id + 1) . "\n" . $galleries_file_lines;
        $galleries_file_content .= $auto_increment_id . DELIMITER . $_GET['gallery_name'] . DELIMITER . friendly_url($_GET['gallery_name']) . "\n";
        if (mn_put_contents($file['galleries'], $galleries_file_content)) {
            echo '<li><input type="checkbox" name="galleries[]" id="gallery-' . $auto_increment_id . '" class="input-gallery" value="' . $auto_increment_id . '" checked="checked" /> <label for="gallery-' . $auto_increment_id . '">' . substr($_GET['gallery_name'], 0, 20) . '</label></li>';
            die;
        } else {
            echo 'Error MN#44: cannot write to mn-galleries.php file!';
function user_tmpl($id, $template, $url)
{
    global $dir, $file, $conf, $lang;
    $tmpl_file = file_exists(MN_ROOT . $dir['templates'] . $template . '.html') ? file_get_contents(MN_ROOT . $dir['templates'] . $template . '.html') : file_get_contents(MN_ROOT . $dir['templates'] . DEFAULT_TMPL . '_13.html');
    $u = get_values('users', $id);
    $g = load_basic_data('groups', $u['group']);
    if (!empty($u['birthdate'])) {
        $b_items = explode('-', $u['birthdate']);
        $bday = $b_items[2] . '.' . $b_items[1] . '.' . $b_items[0];
    } else {
        $bday = '';
    }
    $gender = !empty($u['gender']) ? $lang['users_gender_' . $u['gender']] : '';
    $posts_count = get_posts_count('users');
    $user_posts_count = empty($posts_count[$u['user_id']]) ? '0' : $posts_count[$u['user_id']];
    if (isset($u['avatar']) && !empty($u['avatar'])) {
        list($avatar_file, $avatar_ext, $avatar_width, $avatar_height) = explode(';', $u['avatar']);
        $avatar = '<img src="' . $conf['admin_url'] . '/' . $dir['avatars'] . $avatar_file . '.' . $avatar_ext . '" class="mn-avatar" alt="' . $u['username'] . ' ' . $lang['users_avatar'] . '" width="' . @$conf['users_avatar_standard'] . '" height="' . @$conf['users_avatar_standard'] . '" />';
        $avatar_small = '<img src="' . $conf['admin_url'] . '/' . $dir['avatars'] . $avatar_file . '-small.' . $avatar_ext . '" class="mn-avatar-small"  alt="' . $u['username'] . ' ' . $lang['users_avatar'] . '" width="' . @$conf['users_avatar_small'] . '" height="' . @$conf['users_avatar_small'] . '" />';
        $avatar_mini = '<img src="' . $conf['admin_url'] . '/' . $dir['avatars'] . $avatar_file . '-mini.' . $avatar_ext . '" class="mn-avatar-mini"  alt="' . $u['username'] . ' ' . $lang['users_avatar'] . '" width="' . @$conf['users_avatar_mini'] . '" height="' . @$conf['users_avatar_mini'] . '" />';
    } else {
        $avatar = '<img src="' . $conf['admin_url'] . '/stuff/img/default-avatar.jpg" class="mn-avatar mn-avatar-anonymous" alt="' . $u['username'] . ' ' . $lang['users_avatar'] . '" width="' . @$conf['users_avatar_standard'] . '" height="' . @$conf['users_avatar_standard'] . '" />';
        $avatar_small = '<img src="' . $conf['admin_url'] . '/stuff/img/default-avatar-small.jpg" class="mn-avatar-small mn-avatar-anonymous" alt="' . $u['username'] . ' ' . $lang['users_avatar'] . '" width="' . @$conf['users_avatar_small'] . '" height="' . @$conf['users_avatar_small'] . '" />';
        $avatar_mini = '<img src="' . $conf['admin_url'] . '/stuff/img/default-avatar-mini.jpg" class="mn-avatar-mini mn-avatar-anonymous" alt="' . $u['username'] . ' ' . $lang['users_avatar'] . '" width="' . @$conf['users_avatar_mini'] . '" height="' . @$conf['users_avatar_mini'] . '" />';
    }
    $tmpl_search = array('{BIRTHDAY}', '{ABOUT}', '{AVATAR}', '{AVATAR_SMALL}', '{AVATAR_MINI}', '{EMAIL}', '{GENDER}', '{GROUP}', '{ICQ}', '{JABBER}', '{LOCATION}', '{MSN}', '{NICKNAME}', '{OTHER1}', '{OTHER2}', '{POSTS_COUNT}', '{SKYPE}', '{USER_ID}', '{USERNAME}', '{WWW}');
    $tmpl_replace = array($bday, $u['about'], $avatar, $avatar_small, $avatar_mini, $u['email'], $gender, $g[$u['group']], $u['icq'], $u['jabber'], $u['location'], $u['msn'], $u['nickname'], $u['other1'], $u['other2'], $user_posts_count, $u['skype'], $u['user_id'], $u['username'], $u['www']);
    $result = str_ireplace($tmpl_search, $tmpl_replace, $tmpl_file);
    $result = common_tmpl('0', $result);
    $result = xfields_tmpl('users', $u['xfields'], $result);
    return $result;
}