Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: nugga on April 19, 2014, 11:56:32 AM

Title: SSI 'is logged in'?
Post by: nugga on April 19, 2014, 11:56:32 AM
Is it possible to do a boolean check to see if the user is logged in or not, when writing a small php page using the extensability of SSI.php?

Thanks
Title: Re: SSI 'is logged in'?
Post by: margarett on April 19, 2014, 12:09:43 PM
But of course ;)

<?php
// Include the SSI file.
require(dirname(__FILE__) . '/SSI.php'); 
global 
$context;

if (
$context['user']['is_logged'])
echo 'User is logged';
else
echo 'User is guest';

?>
Title: Re: SSI 'is logged in'?
Post by: nugga on April 19, 2014, 12:22:28 PM
Thank you, works great  ;D