1
Hello to all.
I have added the groups of the user to the userinfo, so they are displayed in his/her profile.
It is nice for projects like mine, that all members (not only the admin) need to know when a member is part of a special group.
I developed this hack from a post of bluescreen, who did something similar to point 2, but for another purpose. Sorry I can't find that post.
The hack is this way:
1) in the file /language/english/user.php add this line:
Quote:
// hack jordi user groups displaying
define('_US_GRUPOS','Community Status');
// end of hack jordi
----------------------------------
2) In the file userinfo.php look where it says this:
Quote:
if ( is_object($xoopsUser) && $isAdmin ) {
$xoopsTpl->assign('lang_editprofile', _US_EDITPROFILE);
$xoopsTpl->assign('lang_deleteaccount', _US_DELACCOUNT);
$xoopsTpl->assign('user_uid', $thisUser->getVar('uid'));
}
and add this after it:
Quote:
// hack display user groups
$verGrupos = $thisUser->getGroups();
$susGrupos='';
//group number 1 is allways admin
if ( in_array("1", $verGrupos) ) { $susGrupos = 'Administrator'; }
//group 4 is a group you may have created
// remove this line if you didn't
// you can also add more lines, checking numbers from 4 to X
// for the groups you created
elseif ( in_array("4", $verGrupos) ) { $susGrupos .= 'A group you created'; }
//group 2 is the registered users. All people belong to this group if they are registered.
elseif ( in_array("2", $verGrupos) ) { $susGrupos .= 'Proud Member'; }
// this asigns values to variables in system_userinfo
$xoopsTpl->assign('lang_grupos', _US_GRUPOS);
$xoopsTpl->assign('user_grupos', $susGrupos);
// fin hack mostrar grupos
-------------------------------------------
3) Finally go to modules/system/templates/system_userinfo.html where it says:
Quote:
<{$lang_avatar}> |
![Avatar](<{$user_avatarurl}>) |
And add this after it:
Quote:
<{$lang_grupos}> |
<{$user_grupos}> |
Now you got it!
You don't need to create any database or nothing, just do these 3 steps.
Jordi.
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR