General Community > Scripting Help

Get user name from SMF cookie on My Website build with SSI

<< < (2/4) > >>

Labradoodle-360:

--- Code: ---global $user_info;
if ($user_info['is_admin'])
echo 'Hello Admin!';

--- End code ---

ZoRk:
Great, it seems to work... :) Your a boss!!!

But i also want my forum's super modos to see this ADMIN button...

And i'd like to recuperate member id to get the custom profil field and use it for things like display member avatar and personnal stats from our game.

Sorry if ask so much...

Where can i found all the array fields for $user_info ?

EDIT: i'm stupid, will do a print_r... But if there is a documentation, i take it, for curiosity...

Edit, fantastic, i've seen all i want printing the array... I have member name, id... Just wonder why the [is_modo] is empty for the forum's global modérators...

Labradoodle-360:
Try cross-checking the $user_info['groups'] array to see if the array contains the global moderators id.

Arantor:
Or allowedTo('moderate_forum') is probably a safer method.

Labradoodle-360:
Why is that a more safe method? Because more groups could have it...?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version