Checking if user is logged in on Non-SM page

Started by DDRtists, March 12, 2006, 11:37:38 PM

Previous topic - Next topic

DDRtists

Is it possible to check if user is logged in without it being on a Simple machines page? Ive read the SSI, and dident see anything there. I also searched and found nothing.

I just want to be able for only users that are logged in to be able to see a page that i have made. Thanks. :) And if possible, i would also like to get there name, and there status ( like admin, mod, user.. that stuff ).

-DDRtists

Elmacik

Surely possible. I think you havent deeply looked into SSI.php :)
Just include the SSI.php to your non-SMF page and ask the user :)
For example:


<?php
include("/full/server/path/to_your/forum/SSI.php");
if (
$context['user']['is_guest'])
{
echo
' HELLO GUEST! ';
}
if (
$context['user']['is_logged'])
{
echo
' HELLO USER! ';
}
if (
$context['user']['is_admin'])
{
echo
' HELLO ADMIN! ';
}
if (
$user_settings['ID_GROUP'] == 'SOME_GROUP_ID')
{
echo
' HELLO *SOME GROUP MEMBER!* ';
}
?>


There the some_group_id is to check other groups.
Home of Elmacik

DDRtists

lol, thanks. It doent say that in the examples, i dident look on the page :P

thanks for the help, now wanna tell me how to get there names before your done with me? Thanks :)

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

DDRtists


Advertisement: