https://www.icyphoenix.com/viewtopic.php?f=28&t=6383&p=45861#p45861
-----------------------------------
Yros
Tue 10 Nov, 2009 00:41
Re: Ranks Improvement
-----------------------------------
Hellow,
I did not forget this topic and I'd like to know if someone could help me for adapt a mod from phpBB 2 to Icy Phoenix. It is a simple basic mode which allow to use cash as a rank special feature. With this mode you can use cash ( user_point ) function for define ranks ( starting at X points for sample ).
The mod himself only need some files editing ( under phpBB 2 ). The installation is the following one :
[code linenumbers=false]##############################################################
## MOD Titre : Rank Gain Access
## MOD Auteur : Poupoune < kristff@hotmail.com > (N/A) http://www.phpbb-fr.com
##
## MOD 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é.
##
## MOD Version : 1.0.0
##
## Niveau d'installation : moyen
## Temps d'installation : 10 minute(s)
## Fichier(s) à éditer : 8
## includes/constants.php
## admin/admin_ranks.php
## includes/usercp_register.php
## includes/usercp_viewprofile.php
## viewtopic.php
## language/lang_french/lang_admin.php
## templates/subSilver/admin/ranks_list_body.tpl
## templates/subSilver/admin/ranks_edit_body.tpl
##
## Fichier(s) inclu(s) : 0
##
##############################################################
## Pour des raisons de sécurité, vous êtes prier de consulter
## régulièrement http://forums.phpbb-fr.com afin d'obtenir la
## dernière version de ce MOD.
## Télécharger ce MOD à partir des sites autres que phpBB-fr.com
## peut être dangereux pour votre forum phpBB.
## Par conséquent, phpBB-fr.com n'assurera aucun support pour
## les MODs absents de leur base de données, consultable sur:
## http://forums.phpbb-fr.com/
##############################################################
## Notes de l'auteur :
##
## 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.
##
##############################################################
## Historique du MOD :
##
## 05-07-2004 - Version 1.0.0
##
##############################################################
## Avant d'ajouter ce MOD à votre forum, il vous est fortement conseillé
## d'effectuer une sauvegarde des éléments que vous allez modifier.
##############################################################
#
#-----[ SQL ]----------------------------------------------
#
ALTER TABLE phpbb_ranks ADD rank_choose_minimum tinyint(1) not null;
#
#-----[ OUVRIR ]----------------------------------------------
#
includes/constants.php
#
#-----[ CHERCHER ]----------------------------------------------
#
define('USER_AVATAR_GALLERY', 3);
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
// Rank gain access MOD
define('USER_POINTS_MINIMUM', 1);
#
#-----[ OUVRIR ]----------------------------------------------
#
admin/admin_ranks.php
#
#-----[ OUVRIR ]----------------------------------------------
#
$rank_is_special = ( $rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
$rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
$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() );
}
#
#-----[ CHERCHER ]----------------------------------------------
#
"MINIMUM" => ( $rank_is_special ) ? "" : $rank_info['rank_min'],
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
"RANK_MINIMUM_POINTS" => $rank_minimum_points,
"LOCK_POINTS" => $lock_points,
#
#-----[ CHERCHER ]----------------------------------------------
#
"L_RANK_SPECIAL" => $lang['Rank_special'],
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
"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'],
#
#-----[ CHERCHER ]----------------------------------------------
#
$special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? TRUE : 0;
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
$rank_choose_minimum = ( $HTTP_POST_VARS['rank_choose_minimum'] == 1 ) ? TRUE : 0;
#
#-----[ CHERCHER ]----------------------------------------------
#
$sql = "UPDATE " . RANKS_TABLE . "
SET
#
#-----[ DANS LA LIGNE CHERCHER ]----------------------------------------------
#
rank_image = '" . str_replace("\'", "''", $rank_image) . "'
#
#-----[ DANS LA LIGNE APRES, AJOUTER ]----------------------------------------------
#
, rank_choose_minimum = $rank_choose_minimum
#
#-----[ CHERCHER ]----------------------------------------------
#
$sql = "INSERT INTO " . RANKS_TABLE . "
#
#-----[ DANS LA LIGNE CHERCHER ]----------------------------------------------
#
, rank_image
#
#-----[ DANS LA LIGNE APRES, AJOUTER ]----------------------------------------------
#
, rank_choose_minimum
#
#-----[ CHERCHER ]----------------------------------------------
#
)";
#
#-----[ AVANT, AJOUTER ]----------------------------------------------
#
, $rank_choose_minimum
#
#-----[ CHERCHER ]----------------------------------------------
#
"L_RANK_MINIMUM" => $lang['Rank_minimum'],
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
"L_RANK_CHOOSE_MINIMUM" => $lang['Rank_choose_minimum'],
#
#-----[ CHERCHER ]----------------------------------------------
#
$special_rank = $rank_rows[$i]['rank_special'];
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
$rank_choose_minimum = $rank_rows[$i]['rank_choose_minimum'];
#
#-----[ CHERCHER ]----------------------------------------------
#
"SPECIAL_RANK" => ( $special_rank == 1 ) ? $lang['Yes'] : $lang['No'],
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
"RANK_CHOOSE_MINIMUM" => ( $rank_choose_minimum == 1 ) ? $lang['Points'] : $lang['Posts'],
#
#-----[ CHERCHER ]----------------------------------------------
#
"L_RANK_MINIMUM" => $lang['Rank_minimum'],
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
"L_RANK_CHOOSE_MINIMUM" => $lang['Rank_choose_minimum'],
#
#-----[ CHERCHER ]----------------------------------------------
#
$special_rank = $rank_rows[$i]['rank_special'];
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
$rank_choose_minimum = $rank_rows[$i]['rank_choose_minimum'];
#
#-----[ CHERCHER ]----------------------------------------------
#
$rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No'];
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
$rank_selected_minimum = ( $rank_choose_minimum ) ? $lang['Points'] : $lang['Posts'];
#
#-----[ CHERCHER ]----------------------------------------------
#
"SPECIAL_RANK" => $rank_is_special,
#
#-----[ APRES, AJOUTER ]----------------------------------------------
#
"RANK_CHOOSE_MINIMUM" => $rank_selected_minimum,
#
#-----[ OUVRIR ]----------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ CHERCHER ]----------------------------------------------
#
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'] ) ? '
' : '';
}
}
}
#
#-----[ REMPLACER PAR ]----------------------------------------------
#
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'] ) ? '
' : '';
}
}
}
}
#
#-----[ OUVRIR ]----------------------------------------------
#
viewtopic.php
#
#-----[ CHERCHER ]----------------------------------------------
#
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'] ) ? '
' : '';
}
}
}
#
#-----[ REMPLACER PAR ]----------------------------------------------
#
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'] ) ? '
' : '';
}
}
}
}
#
#-----[ OUVRIR ]----------------------------------------------
#
language/lang_french/lang_admin.php
#
#-----[ CHERCHER ]----------------------------------------------
#
$lang['Rank_minimum'] = '
#
#-----[ REMPLACER PAR ]----------------------------------------------
#
// Début Rank gain access MOD
$lang['Rank_minimum'] = 'Messages / Points Minimum';
$lang['Points'] = 'Points';
$lang['Posts'] = 'Messages';
$lang['Rank_choose_minimum'] = 'Choix du système de répartition des rangs';
$lang['Rank_point_system_explain'] = 'Un système de points compatible a bien été detecté sur votre forum';
$lang['Rank_no_point_explain'] = 'Aucun système de points compatible n\'est installé sur ce forum';
// Fin rank gain access MOD
#
#-----[ OUVRIR ]----------------------------------------------
#
templates/subSilver/admin/ranks_list_body.tpl
#
#-----[ CHERCHER ]----------------------------------------------
#