Jump to content

SMF displaying custom profile field info


Jones
 Share

Recommended Posts

How do?

 

Yes. Me. Again. 😔 I am rewriting the poster section of the display.template to create nicer looking mini profiles. I want to display certain custom fields, not as a block the way the code currently does. I want some of them above the avatar, some below, etc. And I cannot, for the life of me, figure out the PHP bits to make this happen. I know the names for my custom fields, I know where I want to put them. I just cannot figure how to get the value of specific fields to display. Anyone feel like pointing me in the right direction?  

 

p.s. I appreciate you all so much smart people thanks so much

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

$message['member']['options']['cust_<key from the database here, most likely it will be the first 6 letters of the field name without spaces>']

Say we've got a custom field titled Full Name.

It is cust_fullna most likely.

 

This is how you pull custom fields manually globally. Just, it's $context in profiles and I believe $member in the member list.

If you have it set to parse BBC, you'll need to manually turn it on when you manual pull. It also won't have surrounding HTML or whatnot that's set in the field settings.

i.e. parse_bbc($message['member']['options']['cust_fullna'])

  • Thank you 1

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

you are my new bff

 

I was just missing the ['options'] bit. For some reason I was convinced ['custom_fleilds'] needed to be in there somewhere. Now I wish I had asked 3 hours ago. Thank you so, so, so much.

  • Love 1

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.