General Community > Scripting Help
Get user name from SMF cookie on My Website build with SSI
ZoRk:
Hi, i have made my first website, around my 2.0.2 smf forum. 8)
I'm using PHP/SQL and some SSI's functions like the login one.
But now i got a problem:
I want to recuperate member name and a custom profile field on my website from the SMF cookie...
I need it for exemple to display an admin buton on navigation bar if the watcher is in admin group in the forum.
Don't worry, my site's admin space is protected by an .htacess
No problem for finding the fields with MySQL if i had member ID, or name, but how can i get it from the cookie?
Thanks.
Labradoodle-360:
Why not use the SSI function to pull the menu? Which should automatically add the admin button if they are allowed to view it.
ZoRk:
Thank Labradoodle, but
this is not what i want.
My menu bar is different, and the admin section i want to use isn't the one of the forum, but one for controling and monitoring my Game server and a daily rewards game on the website.
I know it was possible to get user id from the cookie with smf 1.x but how can i make that with smf 2.0.2 ?
Labradoodle-360:
You can globalize $context or $user_info and do something like: if ($user_info['is_admin'])
ZoRk:
Sorry, i'm just learning php by myself (and google), can you give a little more explanations?
Where does this variables come? And how my site could know they are linkto my forum?
Navigation
[0] Message Index
[#] Next page
Go to full version