// Start ADD - Show usergroups MOD
include($phpbb_root_path . 'includes/functions_usergroup.'.$phpEx);
// End ADD - Show usergroups MOD
#
#-----[ TROUVER ]------------------------------------------------
#
# ATTENTION, BEAUCOUP D'UTILISATEURS ECHOUENT DANS CETTE ETAPE
# Je ne sais expliquer pourquoi, mais si vous rencontrez un problème,
# veuillez vous assurer, de controler une seconde fois cette partie,
# spécialement concernant le caractère suivant "}" (sans les guillemets).
Posté le: 16 Feb 2008, 13:47 Sujet du message: Re : Affichage groupe dans le profil
Re,
Tu ne dois pas parler du mod indiqué par le lien car, après l'avoir une nouvelle fois téléchargé, il n'y a point de modification à faire dans le fichier viewtopic.php :
Citation:
##############################################################
## MOD Titre: Show user groups
## MOD Auteur: Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## MOD Traducteur: Galixte pour phpBB-fr.com < Galixte@gmail.com > (N/A) http://www.phpbb-project.info
## MOD Description: Ce MOD ajoute des informations sur le membre, à savoir son
## appartenance à des groupes. La liste des groupes auxquels
## le membre appartient apparait lors des posts et dans le
## profil du membre.
## MOD Version: 1.3.6
##
## Niveau d'installation: Facile
## Temps d'installation: 20 Minutes
## Fichiers à éditer: 6
## viewtopic.php
## includes/template.php
## includes/usercp_viewprofile.php
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/subSilver.cfg
## templates/subSilver/viewtopic_body.tpl
## Fichiers à inclure: 7
## root/includes/functions_usergroup.php
## root/templates/subSilver/show_usergroup.tpl
## root/templates/subSilver/show_usergroup_image_only.tpl
## root/templates/subSilver/show_usergroup_as_dropdown.tpl
## root/templates/subSilver/images/groups_diamond3.gif
## root/templates/subSilver/images/groups_snow.gif
## root/templates/subSilver/images/groups_star2.gif
##############################################################
## 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/
##############################################################
## Author Notes:
##
## 1. Description complète du MOD
## -----------
## Ce MOD fera apparaître des informations du posteur
## concernant son appartenance à certains groupes.
## La liste est visible dans le profil de l'utilisateur.
## Les groupes cachés seront affichés en italique (uniquement
## si celui qui voit le groupe en fait également parti).
## Il est désormais possible d'afficher des images pour
## représenter chaque groupe.
##
## 2. EasyMOD
## -----------
##
## Une version de ce MOD peut être installé grâce à EasyMOD.
## Le fichier d'installation compatible EM se trouve dans le
## dossier /english.
##
## 3. Lien vers la dernière version officielle
## -----------
##
## Vous trouverez la dernière version de ce MOD sur le site de l'auteur:
## http://mods.db9.dk/viewtopic.php?t=11
##
##############################################################
## MOD History:
##
## 2004-05-24 - Version 1.3.6
## - included memberlist AJOUTER-on
## - included a tempalte for image only
##
## 2003-12-22 - Version 1.3.5
## - phpBB template & EasyMOD compliance enhancement
##
## 2003-10-13 - Version 1.3.4
## - fixed a problem with missing images
##
## 2003-10-10 - Version 1.3.3
## - fixed a problem with drop-down list in users profile
##
## 2003-09-04 - Version 1.3.2
## - fixed a problem with viewtopic.php (change the included file)
## - AJOUTERed new features to template.php
##
## 2003-08-29 - Version 1.3.1
## - updated the included file functions_usergroup.php
##
## 2003-08-27 - Version 1.3.0
## - Complete re-write, now uses own template file to
## define the show layout
## - Name changed from "member of" to "Show usergroup" as
## it is more correct
##
## 2003-08-27 - Version 1.2.7
## - fixing a bug, witch couse by version 1.2.4, made
## hidden group visible
##
## 2003-08-23 - Version 1.2.6
## - now rewritten how-to, to be EM ready
##
## ????-??-?? - Version 1.2.5
## - improved code, now uses 1 SQL, and improved the
## options in template code
##
## ????-??-?? - Version 1.2.4
## - code changed to allow more flex style control
##
## ????-??-?? - Version 1.2.3
## - confirmed for 2.0.5 by "kooky"
##
## ????-??-?? - Version 1.2.2
## - support images as well, code the group id into the
## template image file (e.g. subSilver.cfg)
##
## ????-??-?? - Version 1.2.1
## - AJOUTERed commas between usergroups
##
## ????-??-?? - Version 1.2.0
## - fixed a bug, causing user group to be none
## - also confirmed for phpBB2 version 2.0.2
##
## ????-??-?? - Version 0.9.2
## - History started, security update, now hidden groups
## are hidden if users are not allowed to view
##
## ????-??-?? - Version 0.9.1
## - updated by to version 2.0.1. by Jérôme Gamez
## < Jerome@campinvaders.net> http://www.campinvaders.net
##
## ????-??-?? - Version 0.9.0
## - Initial release phpBB2 RC-1
##
##############################################################
## Avant d'ajouter ce MOD à votre forum, il vous est fortement conseillé
## d'effectuer une sauvegarde des éléments que vous allez modifier.
##############################################################
#
#-----[ COPIER ]------------------------------------------------
#
copier root/includes/functions_usergroup.php to includes/functions_usergroup.php
copier root/templates/subSilver/show_usergroup.tpl vers templates/subSilver/show_usergroup.tpl
copier root/templates/subSilver/show_usergroup_image_only.tpl vers templates/subSilver/show_usergroup_image_only.tpl
copier root/templates/subSilver/show_usergroup_as_dropdown.tpl vers templates/subSilver/show_usergroup_as_dropdown.tpl
copier root/templates/subSilver/images/groups_diamond3.gif verstemplates/subSilver/images/groups_diamond3.gif
copier root/templates/subSilver/images/groups_snow.gif vers templates/subSilver/images/groups_snow.gif
copier root/templates/subSilver/images/groups_star2.gif vers templates/subSilver/images/groups_star2.gif
// Start ADD - Show usergroups MOD
include($phpbb_root_path . 'includes/functions_usergroup.'.$phpEx);
// End ADD - Show usergroups MOD
#
#-----[ TROUVER ]------------------------------------------------
#
# ATTENTION, BEAUCOUP D'UTILISATEURS ECHOUENT DANS CETTE ETAPE
# Je ne sais expliquer pourquoi, mais si vous rencontrez un problème,
# veuillez vous assurer, de controler une seconde fois cette partie,
# spécialement concernant le caractère suivant "}" (sans les guillemets).
// Start ADD - Show usergroups MOD
function append_var_from_handle_to_block($blockname,$varname, $handle)
{
if (!$this->loadfile($handle))
{
die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle");
}
// Compile it, with the "no echo statements" option on.
$_str = "";
$code = $this->compile($this->uncompiled_code[$handle], true, '_str');
// evaluate the variable assignment.
eval($code);
// assign the value of the generated variable to the given varname.
$this->append_block_vars($blockname, array($varname => $_str));
return true;
}
function append_block_vars($blockname, $vararray)
{
if (strstr($blockname, '.'))
{
// Nested block.
$blocks = explode('.', $blockname);
$blockcount = sizeof($blocks) - 1;
$str = '$this->_tpldata';
for ($i = 0; $i <= $blockcount; $i++)
{
$str .= '[\'' . $blocks[$i] . '.\']';
eval('$lastiteration = sizeof(' . $str . ') - 1;');
$str .= '[' . $lastiteration . ']';
}
// Now we AJOUTER the block that we're actually assigning to.
// We're AJOUTERing a new iteration to this block with the given
// variable assignments.
$str .= '= array_merge('.$str.',$vararray);';
// Now we evaluate this assignment we've built up.
eval($str);
}
else
{
// Top-level block.
// AJOUTER a to existing block with the variable assignments
// we were given.
$current_iteration = sizeof($this->_tpldata[$blockname . '.'])-1;
$this->_tpldata[$blockname . '.'][$current_iteration] = array_merge($this->_tpldata[$blockname . '.'][$current_iteration],$vararray);
}
return true;
}
/**
* Flush a root level block, so it becomes empty.
*/
function flush_block_vars($blockname)
{
// Top-level block.
// flush a existing block we were given.
$current_iteration = sizeof($this->_tpldata[$blockname . '.'])-1;
unset($this->_tpldata[$blockname . '.']);
return true;
}
// End ADD - Show usergroups MOD
// Start ADD - Show usergroups MOD
include($phpbb_root_path . 'includes/functions_usergroup.'.$phpEx);
if (display_usergroups($userdata['user_id'],$profiledata[user_id],'','show_usergroup_as_dropdown'))
{
$template->assign_vars(array(
'L_USER_GROUP' =>$lang['Usergroups']));
} else
{
$template->assign_vars(array(
'L_NO_USER_GROUP' =>$lang['Usergroups'],
'L_NO_USERGROUPS'=> $lang['None']));
}
// End ADD - Show usergroups MOD
#
#-----[ OUVRIR ]------------------------------------------------
#
# Assurez-vous d'éditer ce fichier pour chacun de vos templates (thèmes).
#
templates/subSilver/profile_view_body.tpl
<!-- Start ADD - Show usergroups MOD -->
<tr>
<td valign="middle" align="right"><span class="gen">{L_USER_GROUP}{L_NO_USER_GROUP}:</span></td>
<td class="row1" valign="middle" width="100%"><b><span class="gen">{SHOW_USERGROUPS}{L_NO_USERGROUPS}</span></b></td>
</tr>
<!-- End ADD - Show usergroups MOD -->
#
#-----[ OUVRIR ]------------------------------------------------
#
# Assurez-vous d'éditer ce fichier pour chacun de vos templates (thèmes).
#
templates/subSilver/subSilver.cfg
// Start ADD - Show usergroups MOD
//
// AJOUTER as many as these as you have usergroups, the ID is the same
// as the usergroup ID, these examples covers grop id 1->6
//
$images['groups']['1'] = "$current_template_images/groups_snow.gif";
$images['groups']['2'] = "$current_template_images/groups_star2.gif";
$images['groups']['3'] = "$current_template_images/groups_diamond3.gif";
$images['groups']['4'] = "$current_template_images/groups_snow.gif";
$images['groups']['5'] = "$current_template_images/groups_star2.gif";
$images['groups']['6'] = "$current_template_images/groups_diamond3.gif";
// End ADD - Show usergroups MOD
#
#-----[ OUVRIR ]------------------------------------------------
#
# Assurez-vous d'éditer ce fichier pour chacun de vos templates (thèmes).
#
templates/subSilver/viewtopic_body.tpl
Vous ne pouvez pas poster de nouveaux sujets dans ce forum Vous ne pouvez pas répondre aux sujets dans ce forum Vous ne pouvez pas éditer vos messages dans ce forum Vous ne pouvez pas supprimer vos messages dans ce forum Vous ne pouvez pas voter dans les sondages de ce forum