1
Ventrix
Hot to get the username from id
  • 2006/11/29 11:50

  • Ventrix

  • Just popping in

  • Posts: 58

  • Since: 2004/8/31


Which is the function which returns the username of an id?

And how can I get the username (or id) from a user looking a page? (want to make something like: hello "name")
Resized Image

http://ventrix.nsdc.gr

2
Quest
Re: Hot to get the username from id
  • 2006/11/29 12:27

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Here is an example of something I use. It should get you going in the direction you want.

Place the code in your theme.html file where you want it to appear.

<{if $xoops_isuser}> Hi again <a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a> | <{/if}> <{if $xoops_isuser}><a href="<{$xoops_url}>/user.php?op=logout">Logout</a> <{else}> Welcome to <{$xoops_sitename}>, Guest<{/if}>

Quest

3
Ventrix
Re: Hot to get the username from id
  • 2006/11/29 12:40

  • Ventrix

  • Just popping in

  • Posts: 58

  • Since: 2004/8/31


so the variable is $xoops_uname. your post was really usefull!

now I have to find a way to get the username from the id. It must be there a function!
Resized Image

http://ventrix.nsdc.gr

4
Quest
Re: Hot to get the username from id
  • 2006/11/29 13:01

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


I am no php wizard. It can probably be done with proper coding. The user id variable I think is:

<{$user_uid}>

sorry couldn't be of any more help.

Quest

5
Ventrix
Re: Hot to get the username from id
  • 2006/11/29 13:11

  • Ventrix

  • Just popping in

  • Posts: 58

  • Since: 2004/8/31


I suppose there is a return_uname_from_id(5) to get the users with id 5 username. It can be easily done with a MySQL query but I thought if I can find it ready.
Resized Image

http://ventrix.nsdc.gr

6
vaughan
Re: Hot to get the username from id
  • 2006/11/29 14:16

  • vaughan

  • Friend of XOOPS

  • Posts: 680

  • Since: 2005/11/26


try

xoops_getLinkedUnameFromId();

i'm not sure if something needs to be declared before hand tho.. ie.. global $xoopsUser or $myts etc..

7
Ventrix
Re: Hot to get the username from id
  • 2006/11/29 14:38

  • Ventrix

  • Just popping in

  • Posts: 58

  • Since: 2004/8/31


that was EXACTLY what I wanted! thank you guys, this is the greatest community :)
Resized Image

http://ventrix.nsdc.gr

Login

Who's Online

250 user(s) are online (156 user(s) are browsing Support Forums)


Members: 0


Guests: 250


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