1
sighedwaise
Login/Logout links in the page header
  • 2005/1/5 1:47

  • sighedwaise

  • Just popping in

  • Posts: 8

  • Since: 2004/6/8 2


I want a "Login" link in the header of every page, I know to put this in the theme.html, but I want it to automatically switch to say "Logout" if someone is logged in. I'm not sure how to even begin to do this. If anyone could offer any help it would be greatly appreciated!

2
tom
Re: Login/Logout links in the page header
  • 2005/1/5 3:21

  • tom

  • Friend of XOOPS

  • Posts: 1359

  • Since: 2002/9/21


Heres the html code you require, for your theme:

<{if $xoops_isuser}> Welcome <a href="<{$xoops_url}>/user.php"><{$xoops_uname}>a
    <{else}> <
a href="<{$xoops_url}>/register.php">Registeraat your website
    <{/if}> <{if 
$xoops_isuser}> <a href="<{$xoops_url}>/user.php?op=logout">Log 
    Out
a> <{else}> <a href="<{$xoops_url}>/user.php">Log Ina> <{/if}>


Hope this is of help.

3
sighedwaise
Re: Login/Logout links in the page header
  • 2005/1/5 4:22

  • sighedwaise

  • Just popping in

  • Posts: 8

  • Since: 2004/6/8 2


Yes! Thank you very much, that really helped me out. I took it a bit further and integrated that code in with some
tags and images of Account Info, Notices, etc so I could eliminate the user menu. Thanks again!!!

4
cosoc
Re: Login/Logout links in the page header
  • 2005/1/5 17:18

  • cosoc

  • Just popping in

  • Posts: 1

  • Since: 2005/1/5 1


here is the code i am using? I want to make "Message" bold when the user has a message. any ideas?












<{if $xoops_isuser}>

Welcome <{$xoops_uname}>  

<{/if}>

<{if !$xoops_isuser}>







username:

password:  

  



forget password 



register



<{else}>  



Account  



Edit  



Notification 



Message 

<{if $xoops_isadmin}>



Administration 

<{/if}>



Logout 

<{/if}>




Login

Who's Online

335 user(s) are online (51 user(s) are browsing Support Forums)


Members: 0


Guests: 335


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits