Ejemplo n.º 1
0
            }
            generate_ranks_cache();
            ($hook = get_hook('ark_remove_pre_redirect')) ? eval($hook) : null;
            redirect(forum_link($forum_url['admin_ranks']), $lang_admin_ranks['Rank removed'] . ' ' . $lang_admin_common['Redirect']);
        }
    }
}
// Load the cached ranks
if (file_exists(FORUM_CACHE_DIR . 'cache_ranks.php')) {
    include FORUM_CACHE_DIR . 'cache_ranks.php';
}
if (!defined('FORUM_RANKS_LOADED')) {
    if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
        require FORUM_ROOT . 'include/cache.php';
    }
    generate_ranks_cache();
    require FORUM_CACHE_DIR . 'cache_ranks.php';
}
// Setup the form
$forum_page['fld_count'] = $forum_page['item_count'] = $forum_page['group_count'] = 0;
// Setup breadcrumbs
$forum_page['crumbs'] = array(array($forum_config['o_board_title'], forum_link($forum_url['index'])), array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), array($lang_admin_common['Users'], forum_link($forum_url['admin_users'])), array($lang_admin_common['Ranks'], forum_link($forum_url['admin_ranks'])));
($hook = get_hook('ark_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE_SECTION', 'users');
define('FORUM_PAGE', 'admin-ranks');
require FORUM_ROOT . 'header.php';
// START SUBST - <!-- forum_main -->
ob_start();
($hook = get_hook('ark_main_output_start')) ? eval($hook) : null;
?>
	<div class="main-subhead">
function get_title($user)
{
    global $forum_db, $forum_config, $forum_bans, $lang_common;
    static $ban_list, $forum_ranks;
    $return = ($hook = get_hook('fn_get_title_start')) ? eval($hook) : null;
    if ($return != null) {
        return $return;
    }
    // If not already built in a previous call, build an array of lowercase banned usernames
    if (empty($ban_list)) {
        $ban_list = array();
        foreach ($forum_bans as $cur_ban) {
            $ban_list[] = utf8_strtolower($cur_ban['username']);
        }
    }
    // If not already loaded in a previous call, load the cached ranks
    if ($forum_config['o_ranks'] == '1' && !defined('FORUM_RANKS_LOADED')) {
        if (file_exists(FORUM_CACHE_DIR . 'cache_ranks.php')) {
            include FORUM_CACHE_DIR . 'cache_ranks.php';
        }
        if (!defined('FORUM_RANKS_LOADED')) {
            if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
                require FORUM_ROOT . 'include/cache.php';
            }
            generate_ranks_cache();
            require FORUM_CACHE_DIR . 'cache_ranks.php';
        }
    }
    // If the user has a custom title
    if ($user['title'] != '') {
        $user_title = forum_htmlencode($forum_config['o_censoring'] == '1' ? censor_words($user['title']) : $user['title']);
    } else {
        if (in_array(utf8_strtolower($user['username']), $ban_list)) {
            $user_title = $lang_common['Banned'];
        } else {
            if ($user['g_user_title'] != '') {
                $user_title = forum_htmlencode($user['g_user_title']);
            } else {
                if ($user['g_id'] == FORUM_GUEST) {
                    $user_title = $lang_common['Guest'];
                } else {
                    // Are there any ranks?
                    if ($forum_config['o_ranks'] == '1' && !empty($forum_ranks)) {
                        foreach ($forum_ranks as $cur_rank) {
                            if (intval($user['num_posts']) >= $cur_rank['min_posts']) {
                                $user_title = forum_htmlencode($cur_rank['rank']);
                            }
                        }
                    }
                    // If the user didn't "reach" any rank (or if ranks are disabled), we assign the default
                    if (!isset($user_title)) {
                        $user_title = $lang_common['Member'];
                    }
                }
            }
        }
    }
    ($hook = get_hook('fn_get_title_end')) ? eval($hook) : null;
    return $user_title;
}
Ejemplo n.º 3
0
function get_title($user)
{
    global $db, $pun_config, $pun_bans, $lang_common;
    static $ban_list, $pun_ranks;
    // If not already built in a previous call, build an array of lowercase banned usernames
    if (!$ban_list) {
        $ban_list = array();
        foreach ($pun_bans as $cur_ban) {
            $ban_list[] = mb_strtolower($cur_ban['username']);
        }
    }
    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == 1 && !$pun_ranks) {
        @(include PUN_ROOT . 'cache/cache_ranks.php');
        if (!defined('PUN_RANKS_LOADED')) {
            include_once PUN_ROOT . 'include/cache.php';
            generate_ranks_cache();
            include PUN_ROOT . 'cache/cache_ranks.php';
        }
    }
    $user_title = '';
    if ($user['title']) {
        // If the user has a custom title
        $user_title = pun_htmlspecialchars($user['title']);
    } else {
        if (in_array(mb_strtolower(@$user['username']), $ban_list)) {
            // If the user is banned
            $user_title = $lang_common['Banned'];
        } else {
            if ($user['g_user_title']) {
                // If the user group has a default user title
                $user_title = pun_htmlspecialchars($user['g_user_title']);
            } else {
                if ($user['g_id'] == PUN_GUEST) {
                    // If the user is a guest
                    $user_title = $lang_common['Guest'];
                } else {
                    // Are there any ranks?
                    if ($pun_config['o_ranks'] == 1 && $pun_ranks) {
                        @reset($pun_ranks);
                        while (list(, $cur_rank) = @each($pun_ranks)) {
                            if (intval($user['num_posts']) >= $cur_rank['min_posts']) {
                                $user_title = pun_htmlspecialchars($cur_rank['rank']);
                            }
                        }
                    }
                    // If the user didn't "reach" any rank (or if ranks are disabled), we assign the default
                    if (!$user_title) {
                        $user_title = $lang_common['Member'];
                    }
                }
            }
        }
    }
    return $user_title;
}
Ejemplo n.º 4
0
function get_title($user)
{
    global $db, $luna_config, $luna_bans;
    static $ban_list, $luna_ranks;
    // If not already built in a previous call, build an array of lowercase banned usernames
    if (empty($ban_list)) {
        $ban_list = array();
        foreach ($luna_bans as $cur_ban) {
            $ban_list[] = utf8_strtolower($cur_ban['username']);
        }
    }
    // If not already loaded in a previous call, load the cached ranks
    if ($luna_config['o_ranks'] == '1' && !defined('FORUM_RANKS_LOADED')) {
        if (file_exists(FORUM_CACHE_DIR . 'cache_ranks.php')) {
            include FORUM_CACHE_DIR . 'cache_ranks.php';
        }
        if (!defined('FORUM_RANKS_LOADED')) {
            if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
                require FORUM_ROOT . 'include/cache.php';
            }
            generate_ranks_cache();
            require FORUM_CACHE_DIR . 'cache_ranks.php';
        }
    }
    // If the user has a custom title
    if ($user['title'] != '') {
        $user_title = luna_htmlspecialchars($user['title']);
    } elseif (in_array(utf8_strtolower($user['username']), $ban_list)) {
        $user_title = __('Banned', 'luna');
    } elseif ($user['g_user_title'] != '') {
        $user_title = luna_htmlspecialchars($user['g_user_title']);
    } elseif ($user['g_id'] == FORUM_GUEST) {
        $user_title = __('Guest', 'luna');
    } else {
        // Are there any ranks?
        if ($luna_config['o_ranks'] == '1' && !empty($luna_ranks)) {
            foreach ($luna_ranks as $cur_rank) {
                if ($user['num_posts'] >= $cur_rank['min_posts']) {
                    $user_title = luna_htmlspecialchars($cur_rank['rank']);
                }
            }
        }
        // If the user didn't "reach" any rank (or if ranks are disabled), we assign the default
        if (!isset($user_title)) {
            $user_title = __('Member', 'luna');
        }
    }
    return $user_title;
}
Ejemplo n.º 5
0
function get_title($user)
{
    global $db, $pun_config, $pun_bans, $lang_common;
    static $ban_list, $pun_ranks;
    // If not already built in a previous call, build an array of lowercase banned usernames
    if (empty($ban_list)) {
        $ban_list = array();
        foreach ($pun_bans as $cur_ban) {
            $ban_list[] = strtolower($cur_ban['username']);
        }
    }
    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == '1' && empty($pun_ranks)) {
        @(include PUN_ROOT . 'cache/cache_ranks.php');
        if (!defined('PUN_RANKS_LOADED')) {
            require_once PUN_ROOT . 'include/cache.php';
            generate_ranks_cache();
            require PUN_ROOT . 'cache/cache_ranks.php';
        }
    }
    // If the user is a moderator or an administrator
    if ($user['g_id'] == PUN_MOD || $user['g_id'] == PUN_ADMIN) {
        $user_title = $lang_common['Member'];
    } else {
        if (in_array(strtolower($user['username']), $ban_list)) {
            //	$user_title = $lang_common['Banned'];
            $user_title = ' ';
        } else {
            if ($user['g_id'] == PUN_GUEST) {
                $user_title = $lang_common['Guest'];
            } else {
                if ($user['title'] != '') {
                    $user_title = pun_htmlspecialchars($user['title']);
                } else {
                    if ($user['g_user_title'] != '') {
                        $user_title = pun_htmlspecialchars($user['g_user_title']);
                    } else {
                        // Are there any ranks?
                        if ($pun_config['o_ranks'] == '1' && !empty($pun_ranks)) {
                            @reset($pun_ranks);
                            while (list(, $cur_rank) = @each($pun_ranks)) {
                                if (intval($user['num_posts']) >= $cur_rank['min_posts']) {
                                    $user_title = pun_htmlspecialchars($cur_rank['rank']);
                                }
                            }
                        }
                        // If the user didn't "reach" any rank (or if ranks are disabled), we assign the default
                        if (!isset($user_title)) {
                            $user_title = $lang_common['Member'];
                        }
                    }
                }
            }
        }
    }
    return $user_title;
}