MyBB Community Forums
[How To?] Pull user's location using php - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] Pull user's location using php (/thread-171307.html)



Pull user's location using php - Testmena - 2015-06-01

$mybb->user['username'] gives you the username. How do I get the location? Already tried $mybb->user['location'], didn't work.


RE: Pull user's location using php - .m. - 2015-06-01

which location ? is it place of the user, eg. London, NewYork, Tokyo .. entered in the profile fields ?


RE: Pull user's location using php - Testmena - 2015-06-01

(2015-06-01, 03:02 AM).m. Wrote: which location ? is it place of the user, eg. London, NewYork, Tokyo .. entered in the profile fields ?

Yes, that is what I was referring to.


RE: Pull user's location using php - .m. - 2015-06-01

where you want to put the location ?
if you want to use it on posts then {$post['fid1']} gives location of the user.
on member profile, you can use {$userfields['fid1']}

see also adding profile fields to postbit & this reply


RE: Pull user's location using php - Testmena - 2015-06-01

(2015-06-01, 04:35 AM).m. Wrote: where you want to put the location ?
if you want to use it on posts then {$post['fid1']} gives location of the user.
on member profile, you can use {$userfields['fid1']}

see also adding profile fields to postbit & this reply

I was trying to modify a plugin to pull the user's location when [location] is put in a post. 

$mybb->user['fid1'] seems to have done the trick. thanks!