Customizing SMF > SMF Coding Discussion

if ($context['user']['is_some_group'])

(1/2) > >>

Owdy:

--- Code: ---if ($context['user']['is_admin'])
echo 'blaa blaa
--- End code ---

Is this possible do with certain groups? I want to show one link only to certain group members.

Tristan Perry:

--- Code: ---if ( in_array(X, $GLOBALS['user_info']['groups'])
--- End code ---

 :)

Owdy:
hmmm, i dont get it. What defines group? :)

Tristan Perry:

--- Quote from: Owdy on August 16, 2004, 02:22:52 PM ---hmmm, i dont get it. What defines group? :)

--- End quote ---
Replace X with the number of the user group. 1 is administrator, 4 is newbie etc

Owdy:
i replace
--- Code: ---if ($context['user']['is_logged'])
--- End code ---
by
--- Code: ---if ( in_array(1, $GLOBALS['user_info']['groups'])
--- End code ---
and get template parse error.

Navigation

[0] Message Index

[#] Next page

Go to full version