Log in

View Full Version : How do I detect if user is logged in?


kwame
03-24-2006, 04:43 PM
Hi, I have changed the header & navbar altogether and I wanted to display Login/Logout based on the current status of the user. Can someone please tell me how I can do this? I just can't figure out how to test for current status. Thanks.
Kwame

GTAce
03-24-2006, 06:23 PM
<if condition="$show['guest']">

Login

</if>

<if condition="$show['member']">

Logout

</if>

Replace "Login" and "Logout" with their respective code of course

kwame
03-24-2006, 07:04 PM
Thanks for the help but I guess I should have been more specific. The code is going to be placed in the header template and once I put the code
<if condition="$show['guest']">Login</if> into the template, I immediately get errors. Any thoughts?
Kwame

The error that I get is "Parse error: parse error in E:\jamproinvest\caribbeanbusinessclub\forums\globa l.php(512) : eval()'d code on line 368" and line 368 is the line that says "<if condition="$show['guest']">"
Kwame

GTAce
03-24-2006, 07:31 PM
No, I'm not sure...that should work just fine....post the block of code around this code you're working on.

kwame
03-24-2006, 07:40 PM
Here is my code which is taken from the header template:
<tr>
<td colspan=\"3\" class=\"top_menu\" height=\"35\"> &nbsp;<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/forums/sendmessage.php\" STYLE=\"text-decoration:none\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">Contact Us</span></a> |&nbsp;
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/aboutUs.php\" class=\"style2\" STYLE=\"text-decoration:none\" onMouseOver=\"MM_showHideLayers('matching','','hide','about','', 'show','hideAbou t','','show')\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">About Us</span></a> |
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/forums/matching.php\" class=\"style2\" STYLE=\"text-decoration:none\" onMouseOver=\"MM_swapImage('Image40','','http://www.investjamaica.com/caribbeanbusinessclub/forums/moon/images/matchingOver.gif',1);MM_showHideLayers('matching', '','show','hideMatching','','s how','events','','hide','about','','hide')\" onMouseOut=\"MM_swapImgRestore()\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">Business Matching</span></a> |
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/forums/forumdisplay.php?f=1\" STYLE=\"text-decoration:none\" onMouseOver=\"MM_showHideLayers('matching','','hide','events','' ,'show','news',' ','hide','hideEvents','','show')\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">Events</span></a> |
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/forums/forumdisplay.php?f=14\" class=\"style2\" STYLE=\"text-decoration:none\" onMouseOver=\"MM_showHideLayers('events','','hide','news','','sh ow','hideNews',' ','show','info','','hide')\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">News</span></a> |
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/forums/index.php\" class=\"style2\" STYLE=\"text-decoration:none\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">Forums</span></a> |
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/businessInfo.php\" class=\"style2\" STYLE=\"text-decoration:none\" onMouseOver=\"MM_showHideLayers('news','','hide','hideInfo','',' show','info','', 'show')\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">Business Info</span></a> |
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/forums/forumdisplay.php?f=3\" class=\"style2\" STYLE=\"text-decoration:none\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">Presidents Club</span></a> |

<if condition="$show['guest']">
<a href=\"http://www.investjamaica.com/caribbeanbusinessclub/forums/login.php\" class=\"style2\" STYLE=\"text-decoration:none\"><span onmouseout=\"this.style.color = '#999999';\" onmouseover=\"this.style.color
= '#ffcc33', this.text-decoration=none;\" align=\"justify\">Login</span></a>
</if>

</td>
</tr>

GTAce
03-24-2006, 07:49 PM
I don't know...I see nothing wrong, maybe somebody else can see something in it :(