The first way is to add a menu item to the login screen. In the Menu Manager select "New" and type "External Link". The url to use is http://www.yoursite.com/index.php?option=com_user&view=login You can also add it directly in your template at a suitable position and style it appropriately - <!--login link--> <div id="loginlink"> <a href="http://www.yoursite.com/index.php?option=com_user&view=login">Login</a> </div> <!--end login link--> If we want to add a bit of user interactivity then we first need to get the users name with a JFactory call and store it in a variable which we place in the php section of the template - $username =& JFactory::getUser(); Then we can use this to greet the user if they are logged in and also provide a logout link. <!--login link--> <div id="loginlink"> <?php if ($username->guest) { echo '<a href="http://www.yoursite.com/index.php?option=com_user&view=login">Login</a>'; } else { $name = $username->get('username'); echo 'Hi ' . $name . ' - <a href="http://www.yoursite.com/index.php?option=com_user&view=logout">Logout</a>'; } ?> </div> <!--end login link--> |
|
| Zuletzt aktualisiert am Freitag, 04. September 2009 um 19:29 Uhr Read : 12360 times |
























please help.
Thanks!
artxComponentWrapper($document);
$username =& JFactory::getUser();
?>) .
Is that right?
thank you all so much!
Its working fine work nice
Thanks,
Helped me fix a problem! Thank you!
Line fixed....