MyBB Community Forums
Calling custom profile fields outside of postbit - 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: Calling custom profile fields outside of postbit (/thread-210223.html)



Calling custom profile fields outside of postbit - fishu - 2017-05-04

i'm looking to display specific custom profile fields on a custom php page, i think that {$post['fid1']} gets me the field but how do i send in the userid i need it to look up? It seems to be that it only works in postbit, is there another hook i can use? or toss me the table names and i'll write out the sql query myself Smile

<div> First Name's Favorite color: {$post['fid1']}</div>
<div> Second Name's Favorite color: {$post['fid1']}</div>
is basically what i'd be going for i'd have the userID's able to be hard coded. 

Thanks!



RE: Calling custom profile fields outside of postbit - Eldenroot - 2017-05-05

try this:
{$userfields['fidX']}

where X is the number of your desired profile field


RE: Calling custom profile fields outside of postbit - fishu - 2017-05-05

Good starting point for me, but I'd need a way to input the userid since each Div would be referencing a different Iser's 'Favorite color' (ie profile field)



<div>{getuserprofilefield[userid,fieldid]}div>
(Clearly not the correct function name, that's what I'm looking for Smile )
Is sort of what I'm looking for thanks!

There has to be a quick hook for when you view someone else's profile, would be the same code...

Right, so maybe my question should be: how to show profile fields in the memberlist?