Пример #1
0
 function cms_block_top_posters()
 {
     global $db, $cache, $config, $template, $lang, $block_id, $cms_config_vars;
     include_once IP_ROOT_PATH . 'includes/functions_users.' . PHP_EXT;
     $top_posters_n = intval($cms_config_vars['md_total_poster'][$block_id]) ? $cms_config_vars['md_total_poster'][$block_id] : 10;
     $show_admins = true;
     $show_mods = true;
     $top_posters_array = top_posters($top_posters_n, $show_admins, $show_mods, true);
     $show_avatars = $cms_config_vars['md_show_avatars'][$block_id] == true ? true : false;
     $template->assign_var('S_SHOW_AVATARS', $show_avatars);
     for ($i = 0; $i < sizeof($top_posters_array); $i++) {
         $username2 = $top_posters_array[$i]['username'];
         $username = colorize_username($top_posters_array[$i]['user_id'], $top_posters_array[$i]['username'], $top_posters_array[$i]['user_color'], $top_posters_array[$i]['user_active']);
         $user_id = $top_posters_array[$i]['user_id'];
         $posts = $top_posters_array[$i]['user_posts'] ? $top_posters_array[$i]['user_posts'] : 0;
         $poster_avatar = user_get_avatar($top_posters_array[$i]['user_id'], $top_posters_array[$i]['user_level'], $top_posters_array[$i]['user_avatar'], $top_posters_array[$i]['user_avatar_type'], $top_posters_array[$i]['user_allowavatar']);
         $template->assign_block_vars('topposter', array('USERNAME' => $username, 'POSTS' => $posts, 'AVATAR_IMG' => $poster_avatar, 'U_VIEWPOSTER' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&amp;' . POST_USERS_URL . '=' . $user_id), 'U_VIEWPOSTS' => append_sid(CMS_PAGE_SEARCH . '?search_author=' . urlencode(ip_utf8_decode($username2)) . '&amp;showresults=posts')));
     }
 }
Пример #2
0
        for ($i = 0; $i < $number_recent_topics; $i++) {
            $template->assign_block_vars('show_recent.recent_topic_row', array('U_TITLE' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#p' . $recent_topic_row[$i]['post_id'], 'L_TITLE' => $recent_topic_row[$i]['topic_title'], 'U_POSTER' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&amp;' . POST_USERS_URL . '=' . $recent_topic_row[$i]['user_id']), 'S_POSTER' => $recent_topic_row[$i]['username'], 'S_POSTTIME' => create_date($config['default_dateformat'], $recent_topic_row[$i]['post_time'], $config['board_timezone'])));
        }
        // Recent Topics - END
    }
    if ($config['show_random_quote'] == true) {
        $template->assign_block_vars('switch_show_random_quote', array());
    }
    if ($config['show_chat_online'] == true) {
        $template->assign_block_vars('switch_ac_online', array());
    }
    if ($config['index_top_posters'] == true) {
        if (!function_exists('top_posters')) {
            @(include_once IP_ROOT_PATH . 'includes/functions_users.' . PHP_EXT);
        }
        $template->assign_block_vars('top_posters', array('TOP_POSTERS' => top_posters(8, true, true, false)));
    }
}
// Display the index
$display = display_index($viewcatkey);
// check shoutbox permissions and display only to authorized users
$auth_level_req = isset($cms_config_layouts['shoutbox']['view']) && $cms_config_layouts['shoutbox']['view'] != AUTH_CMS_ALL_NO_BOTS ? $cms_config_layouts['shoutbox']['view'] : AUTH_ALL;
if (!empty($config['index_shoutbox']) && $user->data['user_level'] + 1 >= $auth_level_req && $user->data['session_logged_in'] && !$user->data['is_bot'] || !empty($config['index_shoutbox']) && $user->data['user_level'] == ADMIN) {
    $template->assign_vars(array('S_SHOUTBOX' => true));
}
if (!$display) {
    message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
// Should the news banner be shown?
if ($config['xs_show_news']) {
    include IP_ROOT_PATH . 'includes/xs_news.' . PHP_EXT;