1
shibby
Logged in notification
  • 2004/5/11 17:19

  • shibby

  • Just popping in

  • Posts: 25

  • Since: 2004/2/14


Is there a standard code I can place in the HTML template or possibly in a block that would notify the user that they are logged in?

For example:

Welcome, User_name [logout]

Or something to that nature?

Thanks

2
kahumbu
Re: Logged in notification
  • 2004/5/11 18:06

  • kahumbu

  • Documentation Writer

  • Posts: 277

  • Since: 2003/8/23


This is what I used within my theme.html when I implemented something similar before.

<{php}>
global 
$xoopsUser;
if (!
$xoopsUser
{
$username "Guest";
}
else
{
$username $xoopsUser->getVar('uname');
}
echo 
"<b>$username</b>";
<{/
php}>


Try experimenting with that. You can place the echo part inside the conditionals if you want.

3
Dave_L
Re: Logged in notification
  • 2004/5/11 18:57

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I think the name of the current user should be displayed somewhere, so that you can more easily tell whether you're logged in, and under what name.

Here's a simple modification to show that information next to the Logout link in the user menu, e.g. Logout (Dave_L):

modules/system/templates/blocks/system_block_user.html

<a href="<{$xoops_url}>/user.php?op=logout"><{$block.lang_logout}>[color=ff0000]&nbsp;(<{$xoops_uname|truncate:15:'...'}>)[/color]</a>

4
shibby
Re: Logged in notification
  • 2004/5/11 20:29

  • shibby

  • Just popping in

  • Posts: 25

  • Since: 2004/2/14


Ok, well I'm using the first one. One more request. I'm not particularly adept in PHP. Can I set it up so that it will simply saying something "You are not logged in." when on the guest and than change to user name and a link to logout? I realize that may be a lot of parameters for you to code - but if anyone is willing to take the time to do it I'd appreciate it.

Otherwise, thanks for what you gave me so far it'll work well in the meantime.

5
Mithrandir
Re: Logged in notification

in theme.html:
<{if $xoops_isuser}>
    
Hello <{$xoops_uname}>
<{else}>
    
You are not logged in
<{/if}>

6
shibby
Re: Logged in notification
  • 2004/5/11 23:09

  • shibby

  • Just popping in

  • Posts: 25

  • Since: 2004/2/14


Got it working perfectly, thanks.

Login

Who's Online

229 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

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

Latest GitHub Commits