Skip to forum content
FluxBB.org Forums
Unfortunately no one can be told what FluxBB is - you have to see it for yourself.
You are not logged in. Please login or register.
Active topics Unanswered topics
FluxBB.org Forums » General support (1.4) » Adding an icon beside the usernames of certain usergroups
Pages: 1
You must login or register to post a reply
Posts [ 6 ]
- Registered: 2008-05-22
- Posts: 22
Topic: Adding an icon beside the usernames of certain usergroups
First off, 1.4 is rockin'. Thanks for all the hard work. 
I'd like to do what the title says. I found a couple mods on punres along the same lines (http://www.punres.org/files.php?pid=56 and http://www.punres.org/files.php?pid=445) and managed to sort of get something working.
Basically just editing viewtopic.php, replacing:
<dt><strong><?php echo $username ?></strong></dt>
with
<?php
if ($user_title == $lang_common['Administrator']) {
?><dt><strong class="admicon"><?php echo $username ?></strong></dt><?php
}
elseif ($user_title == $lang_common['Moderator']) {
?><dt><strong class="modicon"><?php echo $username ?></strong></dt><?php
}
else { ?><dt><strong><?php echo $username ?></strong></dt><?php }
?>
This of course only works when the the users title is either 'Administrator' or 'Moderator'.
I tried to figure it out from examples in existing files but my php is super weak.
Something with these?
($pun_user['g_id'] == PUN_ADMIN
($pun_user['g_moderator'] == '1'
Thanks for any ideas. 
- Registered: 2008-04-27
- Posts: 2,663
Re: Adding an icon beside the usernames of certain usergroups
- Registered: 2008-05-22
- Posts: 22
Re: Adding an icon beside the usernames of certain usergroups
Good to hear it's in the right direction. 
What would be the correct way to make it take effect depending the usergroup rather than the user's title?
Something like
I'm php illiterate. :\
Last edited by trichome (2009-06-06 07:10:44)
- Registered: 2008-04-27
- Posts: 2,663
Re: Adding an icon beside the usernames of certain usergroups
- From: Wales, UK
- Registered: 2008-04-27
- Posts: 1,344
Re: Adding an icon beside the usernames of certain usergroups
Why not just class="group-<?php echo $cur_post['g_id'] ?>"
Or $group_class = 'group-'.$cur_post['g_id']; then you can echo group_class in the post wrapper div and set all aspects of the posts style according to group.
The only thing worse than finding a bug is knowing I created it in the first place.
- Registered: 2008-05-22
- Posts: 22
Re: Adding an icon beside the usernames of certain usergroups
Thanks a million, guys.
I'm using class="group-<?php echo $cur_post['g_id'] ?>"
What an elegant solution. 
Topic options
RSS topic feed
Pages: 1
You must login or register to post a reply
FluxBB.org Forums » General support (1.4) » Adding an icon beside the usernames of certain usergroups