Example #1
0
         echo encoding(mn_gallery($mn_gallery));
     } else {
         echo encoding($lang['web_msg_no_gals_files_file']);
     }
 } elseif (isset($mn_mode) && $mn_mode == 'archive') {
     $timestamps = get_unique_timestamps();
     echo '<ul class="mn-archive">';
     foreach ($timestamps as $key => $value) {
         echo '<li><a href="' . $mn_url . 'mn_archive=' . $value . '">' . encoding($lang['month'][date('n', $key)]) . ' ' . date('Y', $key) . '</a></li>';
     }
     echo '</ul>';
 } elseif (isset($mn_mode) && ($mn_mode == 'tagcloud' || $mn_mode == 'tags')) {
     if (is_array($mn_tags) && !empty($mn_tags)) {
         $tag_divider = isset($mn_tag_divider) ? $mn_tag_divider : ', ';
         $tag_cloud = '';
         $posts_count = file_exists(MN_ROOT . $file['tags']) ? get_posts_count('tags') : array();
         $tag_max_count = max($posts_count);
         foreach ($mn_tags as $tag_id => $t) {
             $percent = floor($posts_count[$tag_id] / $tag_max_count * 100);
             // decide which class should be assign, according to tag popularity
             if ($percent < 20) {
                 $tag_class = 'smallest';
             } elseif ($percent >= 20 && $percent < 40) {
                 $tag_class = 'small';
             } elseif ($percent >= 40 && $percent < 60) {
                 $tag_class = 'medium';
             } elseif ($percent >= 60 && $percent < 80) {
                 $tag_class = 'large';
             } else {
                 $tag_class = 'largest';
             }
Example #2
0
            $u_content .= $u_line;
        }
    }
    if (mn_put_contents($file['users'], $u_content)) {
        header('location: ./mn-users.php?back=deleted');
        exit;
    } else {
        overal_header($lang['cats_categories'], $lang['users_msg_put_contents_error'], 'error');
    }
} else {
    $u_file = file($file['users']);
    array_shift($u_file);
    $users_result = '';
    $users = array();
    $groups = load_basic_data('groups');
    $posts_count = get_posts_count('users');
    foreach ($u_file as $single_line) {
        $temp_data = explode(DELIMITER, $single_line);
        $users[$temp_data[0]] = $temp_data[1] . DELIMITER . $temp_data[3] . DELIMITER . $temp_data[4];
    }
    $users = mn_natcasesort($users);
    foreach ($users as $user_id => $temp_data) {
        $u_data = explode(DELIMITER, $temp_data);
        if (user_auth('1', true)) {
            $user_posts_count = !isset($posts_count[$user_id]) || empty($posts_count[$user_id]) ? '<span class="trivial">0</span>' : '<a href="./mn-posts.php?a=' . $user_id . '">' . $posts_count[$user_id] . '</a>';
        } else {
            $user_posts_count = !isset($posts_count[$user_id]) || empty($posts_count[$user_id]) ? '0' : '' . $posts_count[$user_id] . '';
        }
        $delete_link = $user_id == 1 || $user_id == $_SESSION['mn_user_id'] ? '' : ' &middot; <a href="./mn-users.php?action=delete&amp;id=' . $user_id . '" class="fancy">' . $lang['uni_delete'] . '</a>';
        if (count($users) > 2) {
            $star = $user_id == $_SESSION['mn_user_id'] ? ' <img src="./stuff/img/icons/star.png" alt="" />' : '';
Example #3
0
include './stuff/inc/mn-start.php';
$auth = user_auth('2');
$admin_tmpl['cats_main'] = true;
$categories = load_basic_data('categories');
if (file_exists($file['categories_order'])) {
    $categories_order = unserialize(file_get_contents($file['categories_order']));
} else {
    $categories_order = array();
    $i = 1;
    foreach ($categories as $id => $cname) {
        $categories_order[$i] = $id;
        $i++;
    }
    mn_put_contents($file['categories_order'], serialize($categories_order));
}
$posts_count = get_posts_count();
if (isset($_REQUEST['action']) && isset($_REQUEST['id'])) {
    $var = get_values('categories', $_REQUEST['id']);
}
if (isset($_GET['action']) && $_GET['action'] == 'ajaxcall') {
    if (isset($_GET['cat_name']) && !empty($_GET['cat_name']) && !in_array($_GET['cat_name'], $categories)) {
        if (file_exists($file['categories'])) {
            $cats_file = file($file['categories']);
            $cats_file_lines = '';
            foreach ($cats_file as $single_line) {
                $cat_data = explode(DELIMITER, $single_line);
                if (substr($cat_data[0], 0, 2) == '<?') {
                    $auto_increment_id = trim($cat_data[1]);
                } else {
                    $cats_file_lines .= $single_line;
                }
		
			<!-- Label -->
			<label><?php 
_e('Posts Number', 'haku');
?>
</label>
			
		</div>
		<!-- end: Option info -->
		
		<!-- Option -->
		<div>
			
			<!-- Slider -->
			<div class="haku_slider" data-min="0" data-max="<?php 
echo get_posts_count('post');
?>
" data-step="1"></div>
			<span class="haku_slider_tip" data-label="<?php 
echo esc_attr(strtolower(__('posts', 'haku')));
?>
"><?php 
echo get_theme_option('blog_posts');
?>
 <?php 
echo strtolower(__('posts', 'haku'));
?>
</span>
			
			<!-- Real input -->
			<input type="text" class="hidden" name="blog_posts" value="<?php 
Example #5
0
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;
}