https://www.icyphoenix.com/viewtopic.php?f=28&t=6383&p=45877#p45877 ----------------------------------- TuningBEB2008 Wed 11 Nov, 2009 07:43 Re: Ranks Improvement ----------------------------------- [quote user="Informpro" post="45866"]Yros ... This file is in french ...[/quote] Its simple... [spoiler] Title: Rank Gain Access (Rank Win Access) - 1.0.0 Author: Poupoune < kristff@hotmail.com > http://www.phpbb-fr.com Description: Permet de choisir dans le panneau d'administration le choix d'attribution des rangs, selon, soit la méthode classique selon le nombre de messages, soit selon le nombre de points obtenus par le membre grâce à un système de points. Le MOD est compatible avec le Cash MOD de Xore et le Point System d'eXplosive. Si aucun système de points n'est installé, la fonction du choix du rang selon le nombre de points sera désactivé. Installation: Medium - 10 minute Files to edit (8): :v: includes/constants.php :v: adm/admin_ranks.php :v: includes/usercp_register.php :cross: includes/usercp_viewprofile.php (see include/fuctions_mg_ranks.php) :cross: viewtopic.php (see include/fuctions_mg_ranks.php) :v: language/lang_english/lang_admin.php :v: templates/common/acp/ranks_list_body.tpl :v: templates/common/acp/ranks_edit_body.tpl Author notes: Si vous utilisez le Cash MOD de Xore, il faut que vous crééez une monnaie s'appelant 'points' afin de rajouter un champ user_points à la table des users, afin de permettre au MOD de fonctionner correctement. History: 05-07-2004 - Version 1.0.0 11-11-2009 - Update # #-----[ BEGIN MODIFICATION ]---------------------------------- # [b]SQL:[/b] ALTER TABLE ip_ranks ADD rank_choose_minimum tinyint(1) not null; [b]OPEN:[/b] [color=#26ff00]includes/constants.php (WORK)[/color] #-----[ FIND ]---------------------------------------------- define('USER_AVATAR_GALLERY', 3); #-----[ AFTER, ADD ]---------------------------------------------- // Rank gain access MOD define('USER_POINTS_MINIMUM', 1); [b]OPEN:[/b] [color=#26ff00]adm/admin_ranks.php (WORK)[/color] #-----[ FIND ]---------------------------------------------- $rank_is_not_special = ($rank_info['rank_special'] == '0') ? "checked=\"checked\"" : ""; $rank_is_special = ($rank_info['rank_special'] == '1') ? "checked=\"checked\"" : ""; #-----[ AFTER, ADD ]---------------------------------------------- $rank_minimum_points = ($rank_info['rank_choose_minimum']) ? "checked=\"checked\"" : ""; $sql = "SELECT * FROM " . USERS_TABLE ." WHERE user_points"; if( !$result = $db->sql_query($sql) ) { $lock_points = 'disabled'; $template->assign_block_vars('switch_no_point_explain', array() ); } else { $lock_points = ''; $template->assign_block_vars('switch_point_system_explain', array() ); } #-----[ FIND ]---------------------------------------------- "MINIMUM" => (($rank_info['rank_special'] == '0') || ($rank_info['rank_special'] == '-1')) ? $rank_info['rank_min'] : "", #-----[ AFTER, ADD ]---------------------------------------------- "RANK_MINIMUM_POINTS" => $rank_minimum_points, "LOCK_POINTS" => $lock_points, #-----[ FIND ]---------------------------------------------- "L_RANK_SPECIAL" => $lang['Rank_special'], #-----[ AFTER, ADD ]---------------------------------------------- "L_RANK_CHOOSE_MINIMUM" => $lang['Rank_choose_minimum'], "L_RANK_POINT_SYSTEM_EXPLAIN" => $lang['Rank_point_system_explain'], "L_RANK_NO_POINT_EXPLAIN" => $lang['Rank_no_point_explain'], "L_POINTS" => $lang['Points'], #-----[ FIND ]---------------------------------------------- $special_rank = $_POST['special_rank']; #-----[ AFTER, ADD ]---------------------------------------------- $rank_choose_minimum = ($_POST['rank_choose_minimum'] == 1) ? TRUE : 0; #-----[ FIND ]---------------------------------------------- $sql = "UPDATE " . RANKS_TABLE . " SET #-----[ IN-LINE FIND ]---------------------------------------------- rank_image = '" . str_replace("\'", "''", $rank_image) . "' #-----[ IN-LINE AFTER, ADD ]---------------------------------------------- , rank_choose_minimum = $rank_choose_minimum #-----[ FIND ]---------------------------------------------- $sql = "INSERT INTO " . RANKS_TABLE . " #-----[ IN-LINE FIND ]---------------------------------------------- , rank_image #-----[ IN-LINE AFTER, ADD ]---------------------------------------------- , rank_choose_minimum #-----[ FIND ]---------------------------------------------- )"; #-----[ BEFORE, ADD ]---------------------------------------------- , $rank_choose_minimum #-----[ FIND ]---------------------------------------------- "L_RANK_MINIMUM" => $lang['Rank_minimum'], #-----[ AFTER, ADD ]---------------------------------------------- "L_RANK_CHOOSE_MINIMUM" => $lang['Rank_choose_minimum'], #-----[ FIND ]---------------------------------------------- $special_rank = $rank_rows[$i]['rank_special']; #-----[ AFTER, ADD ]---------------------------------------------- $rank_choose_minimum = $rank_rows[$i]['rank_choose_minimum']; #-----[ FIND ]---------------------------------------------- "SPECIAL_RANK" => ( $special_rank == 1 ) ? $lang['Yes'] : $lang['No'], #-----[ AFTER, ADD ]---------------------------------------------- "RANK_CHOOSE_MINIMUM" => ( $rank_choose_minimum == 1 ) ? $lang['Points'] : $lang['Posts'], #-----[ FIND ]---------------------------------------------- "L_RANK_MINIMUM" => $lang['Rank_minimum'], #-----[ AFTER, ADD ]---------------------------------------------- "L_RANK_CHOOSE_MINIMUM" => $lang['Rank_choose_minimum'], #-----[ FIND ]---------------------------------------------- $special_rank = $rank_rows[$i]['rank_special']; #-----[ AFTER, ADD ]---------------------------------------------- $rank_choose_minimum = $rank_rows[$i]['rank_choose_minimum']; #-----[ FIND ]---------------------------------------------- $rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No']; #-----[ AFTER, ADD ]---------------------------------------------- $rank_selected_minimum = ( $rank_choose_minimum ) ? $lang['Points'] : $lang['Posts']; #-----[ FIND ]---------------------------------------------- "SPECIAL_RANK" => $rank_is_special, #-----[ AFTER, ADD ]---------------------------------------------- "RANK_CHOOSE_MINIMUM" => $rank_selected_minimum, [b]OPEN:[/b] [color=#ff0033]includes/usercp_viewprofile.php (not appears)[/color] see include/fuctions_mg_ranks.php #-----[ FIND ]---------------------------------------------- else { for($i = 0; $i < count($ranksrow); $i++) { if ( $profiledata['user_posts'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] ) { $poster_rank = $ranksrow[$i]['rank_title']; $rank_image = ( $ranksrow[$i]['rank_image'] ) ? '' . $poster_rank . '
' : ''; } } } #-----[ REPLACE WITH ]---------------------------------------------- else { for($i = 0; $i < count($ranksrow); $i++) { if ( $ranksrow[$i]['rank_choose_minimum'] == USER_POINTS_MINIMUM ) { if ( $profiledata['user_points'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] ) { $poster_rank = $ranksrow[$i]['rank_title']; $rank_image = ( $ranksrow[$i]['rank_image'] ) ? '' . $poster_rank . '
' : ''; } } } } [b]OPEN:[/b] [color=#ff0033]viewtopic.php (not appears)[/color] open include/fuctions_mg_ranks.php #-----[ FIND ]---------------------------------------------- else { for($j = 0; $j < count($ranksrow); $j++) { if ( $postrow[$i]['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] ) { $poster_rank = $ranksrow[$j]['rank_title']; $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '' . $poster_rank . '
' : ''; } } } #-----[ REPLACE WITH ]---------------------------------------------- else { for($j = 0; $j < count($ranksrow); $j++) { } if ( $ranksrow[$j]['rank_choose_minimum'] == USER_POINTS_MINIMUM ) { if ( $postrow[$i]['user_points'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] ) { $poster_rank = $ranksrow[$j]['rank_title']; $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '' . $poster_rank . '
' : ''; } } } } #-----[ OPEN ]---------------------------------------------- [color=#26ff00]language/lang_english/lang_admin.php (WORK)[/color] #-----[ FIND ]---------------------------------------------- 'Rank_minimum' => 'Minimum Posts', #-----[ REPLACE WITH ]---------------------------------------------- // Begin Rank gain access MOD 'Rank_minimum' => 'Minimum Posts / Points', 'Points' => 'Points', 'Posts' => 'Posts', 'Rank_choose_minimum' => 'Choix du système de répartition des rangs', 'Rank_point_system_explain' => 'Un système de points compatible a bien été detecté sur votre forum', 'Rank_no_point_explain' => 'Aucun système de points compatible n\'est installé sur ce forum', // End rank gain access MOD [b]OPEN:[/b] [color=#26ff00]templates/common/acp/ranks_list_body.tpl (WORK)[/color] #-----[ FIND ]---------------------------------------------- {L_RANK_MINIMUM} #-----[ AFTER, ADD ]---------------------------------------------- {L_RANK_CHOOSE_MINIMUM} #-----[ FIND ]---------------------------------------------- {ranks.RANK_MIN} #-----[ AFTER, ADD ]---------------------------------------------- {ranks.RANK_CHOOSE_MINIMUM} [b]OPEN:[/b] [color=#26ff00]templates/common/acp/ranks_edit_body.tpl (WORK)[/color] #-----[ FIND ]---------------------------------------------- {L_RANK_SPECIAL} {L_DAYS_RANK}
{L_POSTS_RANK}
{L_SPECIAL_RANK}
{L_GUEST}
{L_BANNED}
#-----[ AFTER, ADD ]---------------------------------------------- {L_RANK_CHOOSE_MINIMUM}
{L_RANK_POINT_SYSTEM_EXPLAIN}* {L_RANK_NO_POINT_EXPLAIN}* {L_POINTS} #-----[ SAVE / CLOSE ALL FILES ]------------------------------------------ EoM [/spoiler] Greetings..