Uutiset:

Join the Facebook Fan Page.

Main Menu
Advertisement:

Custom Profile Fields

Aloittaja NIAB, lokakuu 11, 2013, 02:49:44 AP

« edellinen - seuraava »

NIAB

Hey Guys,

How would I go about using the custom profile fields in a script? Not too sure if they're numbered, or what.

Im trying to use them in another way for the profiles page, but all I can find in Profile.Template.php is


if (!empty($context['custom_fields']))
{
foreach ($context['custom_fields'] as $field)
if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
echo '
<li class="custom_field">', $field['output_html'], '</li>';
}


Any pointers?

Arantor

How about explaining the details of what you're trying to do and maybe we can help better, eh?
Holder of controversial views, all of which my own.


NIAB

lol, yeah.

Trying to use certain parts of the custom fields in selected areas.

I currently have Add & Create soicial mediua icons to profiles mod on the forum. It gives users the option of adding Social networks to their profiles. The thing is, I am trying to setup a feed from the selected profile, but with most of them requiring Authentication to get the feed I am in need of a few more fields.. that's where the custom fields come in.

Here's an example.
For twitter, you just need $context['member']['twitter']['name/link/href'] to use it. With custom fields I have setup 4 fields for the twitter authentication which requires Access Token, Access Token Secret, Consumer Key and Consumer Secret.

I am not sure on how to call these as I can't really find a solid reference to using custom fields.

Arantor

I can't comment on how a mod does things, only on how SMF itself does them. And SMF wouldn't load them to $context['member'] like that for custom profile fields...
Holder of controversial views, all of which my own.


NIAB


Advertisement: