Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Dean Williams - joulukuu 12, 2005, 06:27:14 IP

Otsikko: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Dean Williams - joulukuu 12, 2005, 06:27:14 IP
hello, I'm making a very cool image gallery for use with SMF, theres one thing im missing...

I would like to know how to get the current logged in users ID number so i can link to his profile, I cannot find any function to do this in the SSI.php file.

thanks

Oh and the first version of the gallery will be out as soon as this is done, it will work with all version of SMF and wont be a MOD it will install seperately to SMF but will work with it (if you understand me :p)
Otsikko: Re: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Dean Williams - joulukuu 14, 2005, 02:53:50 IP
could someone help me please pronto? All i need to do is link to the users profile, does anyone know how to do it? can i pass the username through a link to get there or how can i get the users ID and pass it through a link?

:p please guys, the gallery will pawn all once finished!! And i know alot of people are after a gallery thing!
Otsikko: Re: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Aaron - joulukuu 14, 2005, 03:10:38 IP
$context['user']['id'] will do, I think? :)

Aaron.
Otsikko: Re: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Dean Williams - joulukuu 14, 2005, 03:25:23 IP
wow thanks, now my gallery will be completed... where will i post it when im ready? in here?
Otsikko: Re: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Dean Williams - joulukuu 14, 2005, 03:26:36 IP
no its ok, sorted :)
Otsikko: Re: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Dean Williams - joulukuu 14, 2005, 05:34:36 IP
HOLD ON!

The other thing did not work, that returned the ID of the user logged in, I need to get the user ID by passing the User name. So i can link the user names to their profiles.

Is this possible? HOW? PLEASE HELP HOW?

THANKS! :p
Otsikko: Re: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Thantos - joulukuu 14, 2005, 05:42:35 IP
Ok so you want to get user id of any user if you are given their name?

If you only need it to create a link to their profile then you might just want to use their name and let SMF do the work:
http://www.simplemachines.org/community/index.php?action=profile;user=tpvgames
Otsikko: Re: Making an SMF IMAGE GALLERY... Need to know how to get the users ID
Kirjoitti: Dean Williams - joulukuu 14, 2005, 06:54:33 IP
your a lifesaver thanks !!! OH THANKS!! :p