Customizing SMF > SMF Coding Discussion
Custom Profile Fields value SSI call
larry1123:
I need to be able to call the value the user set in a Custom Profile Field so that I can use it out of the forum. I will need the call to be able to pull only one Field because said field will not be viewed on the forums by other users, so permissions will have to be passed and I only want this one Field to be read from out side the forum.
I would hope that it would be able to be used something like this.
--- Code: ---string ssi_custom_profile_field($memberID, $field_name)
--- End code ---
The string it returns would be the set value of the field.
The two prams are in case I need to and more fields that need to be called form SSI. Use of these are not needed but would be nice to start with)
If some one does not fell like writing code for me I would be vary happy just to know where this data is stored in the DB. I Have looked and can not find the data for each user I can find the DB with Custom Profile Fields settings 'smf_custom_fields' but not the stored data.
Arantor:
Take a look in the smf_themes table, for id_member = the member whose fields you want, and where variable items begin with 'cust_', e.g. a field called 'My Custom Field' will be in the database in cust_mycustom (IIRC it takes the first 8 non-space characters) and that's where you'll find the data.
larry1123:
Ok so I found it but the field I am looking for was not the one made by the Facebook mod was there but not the one I made. Would there be anywhere else or does it only save it to the DB if the value is different than the default value?
Arantor:
If it's a custom field set up by the custom fields in the admin panel, it will be in smf_themes, you just might have to search for it (but it'll definitely have cust_ as the prefix in the variable column)
I can't remember if it saves it regardless or whether it only saves it if it's non-default though.
larry1123:
Yea I just changed it from default and now it is there.
Ok so this should be fun to make the code lol goes off to find out how to call the DB.
Navigation
[0] Message Index
[#] Next page
Go to full version