Customizing SMF > SMF Coding Discussion

Help getting Users Group

(1/3) > >>

NIAB:
What's a simple way to define the group of a user who has posted in a topic? Rather than getting my group, or the group of the person viewing a post.

There are certain Post related features I want to change per group.

Example: Was wanting to add a different glow to the avatar box for different user groups to display.

ѕησω:
You can use either of these to colour usernames in posts and through out the forum, based on what group they are in. The same as it's done in Users online.

http://custom.simplemachines.org/mods/index.php?mod=3067
http://custom.simplemachines.org/mods/index.php?mod=111

NIAB:
Thanks for the promt reply, but that isn't exactly what I am after.

I want to add a glow around the avatar itself for  specific groups (e.g: Admin Group has Red glow arround avatar, Noob group has white.), I wanna do this to make it easier to identify certain members, and of course, to make it look awesome.

I know I can get that from the Group color mod with a few tweaks, but there are other things i want with group ID in my forums overall theme.

NIAB:
Wondering if there is any form of array I can set up for it. Not entierly sure how to do it with 'member' over the normal 'user'.

Suki:
If you are talking about the info part in the display

<-----  this part.

then do a print_r()  on $message['member']   which holds all the user info:

echo '<pre>';print_r($message['member']);echo '</pre>';

then you will see all the available info for every user in an array format, including the usergroups, now all you have to do is a ternary on the avatar:


--- Code: ---if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<li class="avatar">
<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
', $message['member']['avatar']['image'], '
</a>
</li>';

--- End code ---

check for the users group and if it is equal to the ID you want then display the glow

Navigation

[0] Message Index

[#] Next page

Go to full version