1
kaper
Show user info ("who am I")
  • 2003/12/13 21:49

  • kaper

  • Just popping in

  • Posts: 75

  • Since: 2003/4/26


Hi,

Is it possible to display user's identity? I'd like do have my site display as who I am logged in (and something like "Guest" if I am not logged in).

(I took a look at blocks, but the Site Info shows only webmasters and I didn't notice anything else useful).

Kaper

2
tom
Re: Show user info ("who am I")
  • 2003/12/13 22:05

  • tom

  • Friend of XOOPS

  • Posts: 1359

  • Since: 2002/9/21


Try putting the following in your theme.html where you want it:

<{if $xoops_isuser}> Welcome <{$xoops_uname}>
<{else}> Register Domain.com!
<{/if}>

For users not logged in it says: Register yourdomain.com!

And for logged in user it says: Welcome username

You can change it to your liking.

Hope this is of help.

3
DonXoop
Re: Show user info ("who am I")

Here is another one. I scooped most of the code from a similar thread yesterday. I turned on the smarty debug to catch variable names I needed. It will print a Logout link if logged in otherwise place a Register link.

It checks their Inbox and will show a new message count in red if any otherwise just a link to the Inbox.

I put this in my theme.html file, actually it is a text file and I do an <{include ... }> so I can use it in other themes.

<{if $xoops_isuser}>
Bye · User: <{$xoops_uname}> ·
<{php}>
/* ******* User Details if Logged In ******* */
GLOBAL $xoopsUser;
$pm_handler =& xoops_gethandler('privmessage');
$uid = $xoopsUser->getVar('uid');
$criteria = new CriteriaCompo(new Criteria('read_msg', 0));
$criteria->add(new Criteria('to_userid', $uid));
$msgcount = $pm_handler->getCount($criteria);
$GLOBALS['xoopsTpl']->assign('msgcount', $msgcount);
<{/php}>
<{if $msgcount > 0}>
Inbox (<{$msgcount}>)
<{else}>
Inbox
<{/if}>
<{else}>
Register
<{/if}>

Login

Who's Online

983 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 983


more...

Donat-O-Meter

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

Latest GitHub Commits