Esempio n. 1
0
		ON (s.user_id=u.user_id) 
		GROUP BY s.user_id 
		ORDER BY TopTemps DESC';
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, "Impossible d'acceder aux tables users/scores/games", '', __LINE__, __FILE__, $sql);
}
$maxPartie = $i = 0;
while ($row = $db->sql_fetchrow($result)) {
    // Nombre de parties max
    if ($maxPartie < $row['topPartie']) {
        $maxPartie = $row['topPartie'];
        $nom_topPartie = areabb_profile($row['user_id'], $row['username']);
    }
    // Nombres d'heures max
    if ($i == 0) {
        $nom_topTemps = areabb_profile($row['user_id'], $row['username']);
        $maxTemps = $row['topTemps'];
        $heur = intval($maxTemps / 3600);
        $min = intval($maxTemps / 60 - $heur * 60);
        $sec = $maxTemps - ($min * 60 + $heur * 3600);
    }
    // Infos du user qui joue
    if ($userdata['user_id'] == $row['user_id']) {
        $topTempsPerso = $row['topTemps'];
        $topPartiePerso = $row['topPartie'] == NULL ? 0 : $row['topPartie'];
    }
    $i++;
}
$heur3 = intval($topTempsPerso / 3600);
$min3 = intval($topTempsPerso / 60 - $heur3 * 60);
$sec3 = $topTempsPerso - ($min3 * 60 + $heur3 * 3600);
Esempio n. 2
0
                    break;
            }
        }
        // Hop on mets le rang au dessus de l'avatar
        $poster_rank = '';
        $rank_image = '';
        if ($row['user_id'] == ANONYMOUS) {
        } else {
            if ($row['user_rank']) {
                for ($j = 0; $j < count($ranksrow); $j++) {
                    if ($row['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special']) {
                        $poster_rank = $ranksrow[$j]['rank_title'];
                        $rank_image = $ranksrow[$j]['rank_image'] ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
                    }
                }
            } else {
                for ($j = 0; $j < count($ranksrow); $j++) {
                    if ($row['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special']) {
                        $poster_rank = $ranksrow[$j]['rank_title'];
                        $rank_image = $ranksrow[$j]['rank_image'] ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
                    }
                }
            }
        }
        $template->assign_block_vars('commentaires.lignes', array('AUTEUR' => areabb_profile($row['poster_id'], $row['username']), 'RANK' => $poster_rank, 'IMG_RANK' => $rank_image, 'AVATAR' => $poster_avatar, 'DATE' => MySQLDateToExplicitDate(date("Y-m-d-H-i-s", $row['post_time']), 1, 1, 1), 'NEWS' => $message));
    }
}
// On permet de saisir un commentaire ?
if ($areabb['news_aff_coms'] == '1') {
    $template->assign_block_vars('saisir_commentaire', array());
}
Esempio n. 3
0
            // Formatage de l'HTML
            if (!$board_config['allow_html'] || !$userdata['user_allowhtml']) {
                if ($row['enable_html']) {
                    $message = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $message);
                }
            }
            if ($bbcode_uid != '') {
                $message = $board_config['allow_bbcode'] ? bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\\:{$bbcode_uid}/si", '', $message);
            }
            // Il y a des liens ?
            $message = make_clickable($message);
            // Des petits smileys ?
            if ($board_config['allow_smilies']) {
                if ($row['enable_smilies']) {
                    $message = smilies_pass($message);
                }
            }
            // On censure les gros mots ..
            $message = str_replace('\\"', '"', substr(@preg_replace('#(\\>(((?>([^><]+|(?R)))*)\\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
            $message = str_replace("\n", '<br />', $message);
            $message = strip_tags($message);
            // on affiche l'icone de la catégorie ?
            $icone = $areabb['news_aff_icone'] == 1 ? '<img src="images/forum_icons/' . $row['forum_icon'] . '" alt="' . $row['forum_desc'] . '" border="0" align="right">' : '';
            $template->assign_block_vars('news.lignes', array('ICONE' => $icone, 'TITRE' => preg_replace($orig_word, $replacement_word, $row['topic_title']), 'AUTEUR' => areabb_profile($row['topic_poster'], $row['username']), 'SUITE' => append_sid('news.' . $phpEx . '?action=detail&article=' . $row['topic_id']), 'COMS' => $row['topic_replies'], 'VIEWS' => $row['topic_views'], 'DATE' => MySQLDateToExplicitDate(date("Y-m-d", $row['topic_time'])), 'NEWS' => couper_texte($message, $areabb['news_nbre_mots'])));
        }
    }
}
if ($areabb['news_forums'] != '') {
    $template->assign_block_vars('news_icone', array());
}
$template->assign_vars(array('L_PAGINATION' => $lang['L_PAGE_NEWS'], 'L_NO_NEWS' => $lang['L_NO_NEWS'], 'L_NO_NEWS_TITRE' => $page_title, 'L_SUITE' => $lang['Read_Full'], 'LE' => $lang['topic_on'], 'SID' => $userdata['session_id'], 'L_PAR' => $lang['topic_by'], 'I_VIEWS' => $phpbb_root_path . $images['icon_areabb_views'], 'I_COMS' => $phpbb_root_path . $images['icon_areabb_coms'], 'PAGINATION' => pagination_news('action=normal', $max_news, $start)));
Esempio n. 4
0
//--------------------------------------------------------------------------------------------------------------------------------------
//                             mod_classement_jeu.php
//
//   Commencé le   :  samedi 24 juin 2006
//   Par  Liz@rd
//
//--------------------------------------------------------------------------------------------------------------------------------------
if (!defined('IN_PHPBB')) {
    die("Hacking attempt");
}
global $partie, $lang;
$top = 15;
load_lang('arcade');
//chargement du template
$template->set_filenames(array('classement_jeu' => 'areabb/mods/classement_jeu/tpl/mod_classement_jeu.tpl'));
load_function('class_jeux');
$partie->recup_liste_scores($top);
for ($i = 0; $i < $top; $i++) {
    if ($partie->liste_score[$i]['username'] != '') {
        if ($partie->liste_score[$i]['username'] == $userdata['username']) {
            $row = 'row2';
        } else {
            $row = 'row1';
        }
        $template->assign_block_vars('classement', array('ROW' => $row, 'USERNAME' => areabb_profile($partie->liste_score[$i]['user_id'], $partie->liste_score[$i]['username']), 'SCORE' => $partie->liste_score[$i]['score'], 'POSITION' => $partie->liste_score[$i]['position']));
    }
}
//template
$template->assign_vars(array('L_BEST_SCORE' => $lang['best_scores']));
$template->assign_var_from_handle('classement_jeu', 'classement_jeu');
Esempio n. 5
0
		ON (g.game_highuser = u.user_id) 
		LEFT JOIN ' . AREABB_CATEGORIES_TABLE . ' as c
		ON (g.arcade_catid=c.arcade_catid)
		LEFT JOIN ' . AREABB_SQUELETTE . ' as q
		ON (c.salle=q.id_squelette)
		WHERE game_highscore > 0	
		ORDER BY game_highdate DESC
		LIMIT ' . $limite_champions;
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
    }
    $i = 0;
    while ($row = $db->sql_fetchrow($result)) {
        if ($squelette->salle_autorisee($row['groupes'])) {
            $class = $class == 'row2' ? 'row1' : 'row2';
            $template->assign_block_vars('champions', array('USER' => areabb_profile($row['game_highuser'], $row['username']), 'JEU' => $row['game_libelle'], 'ICONE' => CHEMIN_JEU . $row['game_name'] . '/' . $row['game_pic'], 'LIEN' => $record_battu->definir_lancement_jeu($row['game_id'], $row['game_width'], $row['game_height']), 'DATE' => date('d/m/Y à H:i', $row['game_highdate']), 'CLASS' => $class));
        }
    }
    ob_get_status();
    //
    // Génération du fichier de cache
    $template->pparse('record_battu');
    $template->destroy();
    $recuperation_sortie = ob_get_clean();
    $recuperation_sortie = str_replace('[', '{', $recuperation_sortie);
    $recuperation_sortie = str_replace(']', '}', $recuperation_sortie);
    ob_end_clean();
    // ecriture du fichier de cache
    $rFile = @fopen('areabb/cache/mod_record_battu.tpl', "w+");
    if (!$rFile) {
        return "ERREUR: Impossible d'ecrire dans le dossier 1 " . dirname(realpath('areabb/cache/mod_record_battu.tpl')) . " (avez vous fait un CHMOD 777 ? )";
Esempio n. 6
0
//--------------------------------------------------------------------------------------------------------------------------------------
//                             mod_podium_jeu.php
//
//   Commencé le : vendredi 23 juin 2006
//   Par  Saint-Pere
//
//--------------------------------------------------------------------------------------------------------------------------------------
if (!defined('IN_PHPBB')) {
    die("Hacking attempt");
}
global $lang, $partie;
$nbre_podium = 5;
load_lang('arcade');
//chargement du template
$template->set_filenames(array('podium_jeu' => 'areabb/mods/podium_jeu/tpl/mod_podium_jeu.tpl'));
$partie->recup_liste_scores($nbre_podium);
if (sizeof($partie->liste_score) > 0) {
    $template->assign_block_vars('score', array());
    for ($i = 0; $i <= $nbre_podium; $i++) {
        if ($partie->liste_score[$i]['username'] != '') {
            if ($partie->liste_score[$i]['username'] == $userdata['username']) {
                $row = 'row2';
            } else {
                $row = 'row1';
            }
            $template->assign_block_vars('score.podium', array('ROW' => $row, 'POS' => $partie->liste_score[$i]['position'], 'PSEUDO' => areabb_profile($partie->liste_score[$i]['user_id'], $partie->liste_score[$i]['username']), 'AVATAR' => $partie->liste_score[$i]['avatar'], 'SCORE' => $partie->liste_score[$i]['score']));
        }
    }
    $template->assign_vars(array('L_PODIUM' => $lang['L_PODIUM'], 'L_SCORE' => $lang['L_SCORE']));
}
$template->assign_var_from_handle('podium_jeu', 'podium_jeu');
Esempio n. 7
0
        $temp_url = append_sid("profile.{$phpEx}?mode=viewprofile&amp;" . POST_USERS_URL . "={$poster_id}");
        $msn_img = $row['user_msnm'] ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : '';
        $msn = $row['user_msnm'] ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : '';
        $yim_img = $row['user_yim'] ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
        $yim = $row['user_yim'] ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : '';
    } else {
        $profile_img = '';
        $profile = '';
        $pm_img = '';
        $pm = '';
        $email_img = '';
        $email = '';
        $www_img = '';
        $www = '';
        $icq_status_img = '';
        $icq_img = '';
        $icq = '';
        $aim_img = '';
        $aim = '';
        $msn_img = '';
        $msn = '';
        $yim_img = '';
        $yim = '';
    }
    //  on alterne les class
    $class = $class == 'row1' ? 'row2' : 'row1';
    $template->assign_block_vars('bloc_top_posteurs', array('USER' => areabb_profile($row['poster_id'], $row['username']), 'AVATAR' => $avatar_img, 'POSTS' => $row['Nb'], 'class' => $class, 'MINI_POST_IMG' => $mini_post_img, 'PROFILE_IMG' => $profile_img, 'PROFILE' => $profile, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'EMAIL_IMG' => $email_img, 'EMAIL' => $email, 'WWW_IMG' => $www_img, 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'YIM_IMG' => $yim_img, 'YIM' => $yim));
}
//template
$template->assign_vars(array('L_TOP_POSTEURS' => $lang['L_TOP_POSTEURS'], 'Posts' => $lang['Posts']));
$template->assign_var_from_handle('top_posteurs', 'top_posteurs');
Esempio n. 8
0
    $liste_jeux = array();
    $joueurs = array();
    $i = 0;
    while ($row = $db->sql_fetchrow($result)) {
        if ($squelette->salle_autorisee($row['groupes'])) {
            if (!in_array($row['areabb_gid'], $liste_jeux)) {
                $liste_jeux[] = $row['areabb_gid'];
            }
            if (!in_array($row['user_id'], $joueurs)) {
                $liste_joueurs[$row['areabb_gid']][$i] = array('user_id' => $row['user_id'], 'username' => $row['username'], 'game_id' => $row['areabb_gid'], 'game_name' => $row['game_name'], 'game_pic' => $row['game_pic'], 'game_height' => $row['game_height'], 'game_width' => $row['game_width'], 'game_libelle' => $row['game_libelle']);
                $joueurs[] = $row['user_id'];
                $i++;
            }
        }
    }
    $max_jeux = count($liste_jeux);
    for ($a = 0; $a < $max_jeux; $a++) {
        unset($joueurs, $info_jeu);
        $max_joueurs = count($liste_joueurs[$a]);
        while (is_array($liste_joueurs[$liste_jeux[$a]]) && (list($key, $joueur) = each($liste_joueurs[$liste_jeux[$a]]))) {
            $virgule = $joueurs != '' ? ',' : '';
            $joueurs .= $virgule . areabb_profile($joueur['user_id'], $joueur['username']);
            $info_jeu = $joueur;
        }
        if ($joueurs != '') {
            $template->assign_block_vars('liste_qui_joue', array('ICONE' => 'areabb/games/' . $info_jeu['game_name'] . '/' . $info_jeu['game_pic'], 'JEU' => $quijoue->definir_lancement_jeu($info_jeu['game_id'], $info_jeu['game_width'], $info_jeu['game_height']) . $info_jeu['game_libelle'] . '</a>', 'JOUEURS' => $joueurs));
        }
    }
}
$template->assign_vars(array('L_QUI_JOUE_TITRE' => $lang['L_QUI_JOUE_TITRE'], 'L_NO_JOUEUR' => $lang['L_NO_JOUEUR']));
$template->assign_var_from_handle('qui_joue', 'qui_joue');
Esempio n. 9
0
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
$except_forum_id = "";
for ($i = 0; $i < count($forum_data); $i++) {
    if (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read'] or !$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']) {
        $except_forum_id .= $except_forum_id == '' ? $forum_data[$i]['forum_id'] : ',' . $forum_data[$i]['forum_id'];
    }
}
$sql_except = $except_forum_id != '' ? ' AND t.forum_id NOT IN ( ' . $except_forum_id . ' ) ' : '';
$sql = 'SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
		FROM ' . TOPICS_TABLE . ' AS t, ' . POSTS_TABLE . ' AS p, ' . USERS_TABLE . ' AS u
		WHERE t.topic_status <> 2 
		' . $sql_except . ' 
		AND p.post_id = t.topic_last_post_id
		AND p.poster_id = u.user_id
		ORDER BY p.post_id DESC
		LIMIT 0,' . $areabb['nbre_topics_recents'];
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
if ($db->sql_numrows($result) > 0) {
    while ($row = $db->sql_fetchrow($result)) {
        $template->assign_block_vars('recent_topic_row', array('U_TITLE' => append_sid('viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $row['post_id']) . '#' . $row['post_id'], 'L_TITLE' => $row['topic_title'], 'U_POSTER' => areabb_profile($row['user_id'], $row['username']), 'S_POSTTIME' => create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone'])));
    }
    // Activer le Scrolling
    if ($areabb['defiler_topics_recents'] == 1) {
        $template->assign_block_vars('scrolling_row', array());
    }
    $template->assign_vars(array('BY' => $lang['topic_by'], 'ON' => $lang['topic_on'], 'L_RECENT_TOPICS' => $lang['Recent_topics']));
}
$template->assign_var_from_handle('recent_topics', 'recent_topics');
Esempio n. 10
0
         $gamepic .= "<img src='areabb/games/" . $liste_jeux[$i]['game_name'] . "/" . $liste_jeux[$i]['game_pic'];
         $gamepic .= "' align='absmiddle' border='0' width='30' height='30' vspace='2' hspace='2' alt='";
         $gamepic .= $liste_jeux[$i]['game_libelle'] . "' ></a>";
     }
     if ($liste_jeux[$i]['game_set'] != 0) {
         $gameset = $liste_jeux[$i]['game_set'];
     }
     $highscore = $liste_jeux[$i]['game_highscore'];
     $yourhighscore = $liste_jeux[$i]['score_game'];
     if ($liste_jeux[$i]['game_highscore'] == 0) {
         $norecord = $lang['no_record'];
         $highscore = '';
         $datehigh = '';
     }
     if ($liste_jeux[$i]['game_highuser'] != 0) {
         $highuser = '******' . areabb_profile($liste_jeux[$i]['user_id'], $liste_jeux[$i]['username']) . ')';
     }
     $gameid = $liste_jeux[$i]['game_id'];
     if ($liste_jeux[$i]['game_highdate'] != 0) {
         $datehigh = create_date($board_config['default_dateformat'], $liste_jeux[$i]['game_highdate'], $userdata['user_timezone']);
     }
     if ($liste_jeux[$row['arcade_catid']][$i]['score_date'] != 0) {
         $yourdatehigh = create_date($board_config['default_dateformat'], $liste_jeux[$row['arcade_catid']][$i]['score_date'], $userdata['user_timezone']);
     }
     if ($liste_jeux[$i]['game_highuser'] == $userdata['user_id']) {
         $imgfirst = '&nbsp;&nbsp;<img src="areabb/images/couronne.gif" align="absmiddle">';
     }
     $gamedesc = stripslashes($liste_jeux[$i]['game_desc']);
     $note = $liste_jeux[$i]['note'] . '/5';
     $template->assign_block_vars('game.gamerow', array('NOTE' => $note, 'GAMENAME' => $gamename, 'GAMELINK' => $gamelink, 'GAMEPIC' => $gamepic, 'GAMESET' => $gameset, 'HIGHSCORE' => $highscore, 'YOURHIGHSCORE' => $yourhighscore, 'NORECORD' => $norecord, 'HIGHUSER' => $highuser, 'GAMEID' => $gameid, 'DATEHIGH' => $datehigh, 'YOURDATEHIGH' => $yourdatehigh, 'IMGFIRST' => $imgfirst, 'GAMEDESC' => $gamedesc));
 }
Esempio n. 11
0
    die("Hacking attempt");
}
global $lang;
//chargement du template
$template->set_filenames(array('statistiques' => 'areabb/mods/statistiques/tpl/mod_statistiques.tpl'));
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if ($total_posts == 0) {
    $l_total_post_s = $lang['Posted_articles_zero_total'];
} else {
    if ($total_posts == 1) {
        $l_total_post_s = $lang['Posted_article_total'];
    } else {
        $l_total_post_s = $lang['Posted_articles_total'];
    }
}
if ($total_users == 0) {
    $l_total_user_s = $lang['Registered_users_zero_total'];
} else {
    if ($total_users == 1) {
        $l_total_user_s = $lang['Registered_user_total'];
    } else {
        $l_total_user_s = $lang['Registered_users_total'];
    }
}
$template->assign_vars(array('TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics), 'NEWEST_USER' => $lang['dernier_user'] . areabb_profile($newest_uid, $newest_user), 'L_STATISTICS' => $lang['Statistics']));
$template->assign_var_from_handle('statistiques', 'statistiques');
Esempio n. 12
0
    if ($userdata['user_avatar_type'] && $userdata['user_allowavatar']) {
        switch ($userdata['user_avatar_type']) {
            case USER_AVATAR_UPLOAD:
                $avatar_img = $board_config['allow_avatar_upload'] ? '<img src="' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
                break;
            case USER_AVATAR_REMOTE:
                $avatar_img = $board_config['allow_avatar_remote'] ? '<img src="' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
                break;
            case USER_AVATAR_GALLERY:
                $avatar_img = $board_config['allow_avatar_local'] ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
                break;
        }
    }
    // Check For Anonymous User
    if ($userdata['user_id'] != '-1') {
        $name_link = areabb_profile($userdata['user_id'], $userdata['username']);
        if ($userdata['user_avatar'] == '') {
            $avatar_img = '<img src="areabb/images/guest_avatar.gif" alt="" border="0" />';
        }
    }
    // END: Avatar
    $redirect = eregi_replace($board_config['script_path'], '', $_SERVER['REQUEST_URI']);
    $redirect = str_replace('sid=' . $userdata['session_id'], '', $redirect);
    $redirect = str_replace('?', '', $redirect);
    $template->assign_vars(array('L_LOGOUT' => $lang['Logout'], 'U_LOGOUT' => append_sid('login.' . $phpEx . '?logout=true&amp;redirect=' . $redirect . '&amp;sid=' . $userdata['session_id']), 'L_REGISTER_NEW_ACCOUNT' => sprintf($user->lang['Register_new_account'], '<a href="' . append_sid('profile.' . $phpEx . '?mode=register') . '">', '</a>'), 'U_NAME_LINK' => $name_link, 'L_NAME_WELCOME' => $lang['Welcome'], 'AVATAR_IMG' => $avatar_img));
    $template->assign_block_vars('user_logged_in', array());
} else {
    $name_link = $user->lang['Guest'];
    $avatar_img = '<img src="areabb/images/guest_avatar.gif" alt="" border="0" />';
    $template->assign_vars(array('L_REGISTER_NEW_ACCOUNT' => sprintf($user->lang['Register_new_account'], '<a href="' . append_sid('profile.' . $phpEx . '?mode=register') . '">', '</a>'), 'U_NAME_LINK' => $name_link, 'L_NAME_WELCOME' => $lang['Welcome'], 'AVATAR_IMG' => $avatar_img));
    $template->assign_block_vars('user_logged_out', array());
Esempio n. 13
0
if (!defined('IN_PHPBB')) {
    die("Hacking attempt");
}
global $lang;
load_lang('arcade');
$limite_victoires = 20;
//chargement du template
$template->set_filenames(array('classvictoire' => 'areabb/mods/classvictoire/tpl/mod_classvictoire.tpl'));
$sql = 'SELECT game_highuser , COUNT(game_highscore) as victoires , username 
	FROM ' . AREABB_GAMES_TABLE . ' as g LEFT JOIN ' . USERS_TABLE . ' as u 
	ON g.game_highuser = u.user_id 
	WHERE game_highscore != 0
	GROUP BY game_highuser 
	ORDER BY victoires DESC
	LIMIT ' . $limite_victoires;
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$i = 0;
$victoire = -9999;
while ($row = $db->sql_fetchrow($result)) {
    if ($row['victoires'] != $victoire) {
        // Les égalités sont sur la même place
        $i++;
    }
    $class = $userdata['user_id'] == $row['game_highuser'] ? 'row1' : 'row2';
    $template->assign_block_vars('victoires', array('USER' => areabb_profile($row['game_highuser'], $row['username']), 'VICTOIRES' => $row['victoires'], 'PLACE' => $i, 'CLASS' => $class));
    $victoire = $row['victoires'];
}
$template->assign_vars(array('L_TOP_VICTOIRES' => $lang['L_TOP_VICTOIRES'], 'L_PLACE' => $lang['L_PLACE'], 'L_JOUEUR' => $lang['L_JOUEUR'], 'L_VICTOIRES' => $lang['L_VICTOIRES']));
$template->assign_var_from_handle('classvictoire', 'classvictoire');