This is a little snippet I use to check if a user is logged in with J1.5 and then output code based on if logged in or not, meaning it will show one thing if logged in and another if not,
Here is the snippet for you to play with and see if you can do something.
| Code: |
<?php
$user =& JFactory::getUser();
$user_id = $user->get('id');
if ($user_id)
{
//add item if logged in
//INCLUDE - this is where you will add the code
else {
?>
//add item if not logged in
//INCLUDE - this is where you will add the code
<?php
}
?>
|
Cheers,
Andrew