if (user is not logged in)
Hi everyone!
If i want to show some data only to logged in users, this is the script i must use:
<?php if ($_SESSION['MM_Username']) { ?>
<div>some content for logged in users</div>
<?php } ?>
Well, i'm creating a basic cms, with a top bar for the admin user, and this works great.
Now i want to add to the cms the activate or deactivate frontend option. This option will affect all the non logged in users, and it will show only this:
<div>The site is offline, please check back later</div>
But, if the user is the admin, the frontend must keep visible
I thought in something like this:
<?php if ($_SESSION['MM_Username']) { ?>
<div>some content for logged in users</div>
<?php } ?>
<?php if (($recordset with the activate or deactivate frontend option) == 'deactivate') { // the option selected in the form is "the site is offline"
if (user is not logged in) { ?> // What's the correct syntax to write this?
<div>Site offline, please check back later</div>
<?php
}
} else { ?>
<div>whole site</div>
<?php } ?>
Thanks in advance to all!
Cheers