I'm an absolute beginner with elgg & php...so apologies for the lame question!
1'm trying to integrate cometchat with elgg and I need to get the user id of the current logged in user. I tried these without success:
$userid = $_SESSION['userid']->userid;
and
$userid = getuserid();
Any pointers greatfully received.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- Brett@brett.profitt
Brett - 0 likes
- Jason Rudland@JasonRudland
Jason Rudland - 0 likes
You must log in to post replies.Would it not be better to read the source or the docs than guessing function names?
:)
See:
http://docs.elgg.org/wiki/Helpers
for your answer.
get_loggedin_userid() is the correct function. Check out http://reference.elgg.org/ for a complete list of functions.
Thanks for your help, I think I'm starting to understand it all a little more now.