Hi all,
Just a quick question -
Currently developing a (my first) mod for SMF. I retrieve the currently logged on user's name using $context['user']['name']
Does anyone know how I would retrieve the ID of which group this user is in?
Thanks very much,
Shockuk.
Primary group or secondary groups?
Primary :)
$context['user']['groups'] should be an array holding them all, $context['user']['groups'][0] should be their primary group.
Ah doesn't seem to work matey (there's nothing set in that array).
Maybe I should've mentioned that i'm calling SMF from another script using SSI.php
I thought it moved it into $context (which it does in other situations)
$user_info['groups'] instead then.
Works like a charm!
Thanks very much :)
Good to know that sorted it. I'll mark this one solved for now.