1
newtzoops
Retrieving the logged-in user's UID via PHP
  • 2007/1/20 4:00

  • newtzoops

  • Just popping in

  • Posts: 3

  • Since: 2007/1/20


Hello, all. As a PHP developer, I've been asked to do some modifications to my guild's web site. I've been able to start on my module and it installs correctly and does a few things that we want, so I have some positive progress.

On another part of the site, I have a custom block where I need to get the UID. Through searching, I've found code to pull back the whole member list, but I can't seem to find anything to get me the UID I need.

A gentle push in the right direction is appreciated. I'm looking for the code that lets you update your user preferences because that has to interact with your UID for the update, but haven't found it, yet.

-Newt

2
iHackCode
Re: Retrieving the logged-in user's UID via PHP

this will display the uid of the current user you are logged in as. when used in a custom block.
global $xoopsUser;
echo 
$xoopsUser->getvar('uid');


but im unsure what will happen if there is no $xoopsUser object. probably an error. white page or something.

.Well that should help anyways.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

3
newtzoops
Re: Retrieving the logged-in user's UID via PHP
  • 2007/1/20 5:42

  • newtzoops

  • Just popping in

  • Posts: 3

  • Since: 2007/1/20


Worked Perfectly - big time thanks.

Followup: Is there a list of the various objects available to me? The documentation section looked like it was more for the administration of XOOPS -vs- actually developing in xoops.

Thanks again,
-Newt

4
iHackCode
Re: Retrieving the logged-in user's UID via PHP

XooPS Dev Wiki
http://dev.xoops.org/modules/phpwiki/

Another link.
http://dev.xoops.org/modules/phpwiki/index.php/GlobalVariables

Hope that helps. (& Smarty only works on the theme, and things that have a template like those module templates or block templates from modules,, But not in a custom block..)
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

5
newtzoops
Re: Retrieving the logged-in user's UID via PHP
  • 2007/1/20 23:37

  • newtzoops

  • Just popping in

  • Posts: 3

  • Since: 2007/1/20


I'll give that a look. Thanks for the shove in the right direction.

-Newt

Login

Who's Online

365 user(s) are online (293 user(s) are browsing Support Forums)


Members: 0


Guests: 365


more...

Donat-O-Meter

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

Latest GitHub Commits