Hi,
I am using component Community Builder, and I have a own-created php-file which is loaded only for the first time a user loggs in. There is a button, on which a php function updates a field in the jos_component table.
The problem is, I don't know how to get the user_id of the logged user. (I need it because I want to update his field in this table)
Can anyone explain to me, how i can get this? Perhaps include a certain php file?
How can I get the current user_id? Topic is solved
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
-
- Joomla! Apprentice
- Posts: 41
- Joined: Sat Dec 15, 2007 3:02 pm
- Location: Washington DC Metro
Re: How can I get the current user_id?
If you are running J! 1.5.x, you can get the user_id with
Code: Select all
$user = &JFactory::getUser();
$user_id = $user->get('id');
Denise
Re: How can I get the current user_id?
great!
this is the answer ive been looking for!
yet im getting this message when i load my php file
"Fatal error: Undefined class name 'jfactory' in /w/web_docs/Facultades/Artes/ingenieriasonido/sat/submit/turn_verify.php on line 420"
how do i fix it ?
if it helps i have Joomla 1.5 RC4 with Community Builder 1.1 installed.
this is the answer ive been looking for!
yet im getting this message when i load my php file
"Fatal error: Undefined class name 'jfactory' in /w/web_docs/Facultades/Artes/ingenieriasonido/sat/submit/turn_verify.php on line 420"
how do i fix it ?
if it helps i have Joomla 1.5 RC4 with Community Builder 1.1 installed.
Re: How can I get the current user_id?
i have found the supossed answer for me...here
http://forum.joomla.org/viewtopic.php?f ... la#p922767
it looks like a nono for me
http://forum.joomla.org/viewtopic.php?f ... la#p922767
it looks like a nono for me