Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Custom Profile Fields
Avatar
Jeremy
Guest
Guests
Jan 11, 2012 - 10:27 pm

I've upgraded to the Beta 5.0 release, and I'm having just a little trouble with custom fields in Profiles.  On one of my sites, I use wp-members to add custom fields into the user registration (which are then stored in the primary WP databases).  In the prior version of SP, I found it fairly easy to get any information inputted by registering members to show up on their \\\"public\\\" profile ('public' in the sense that other members can view it).  I could simply call the information from the WP-database through the SP admin interface.

 

In version 5, though, I can't seem to do that.  I installed the custom field plugin, but the only thing that it seems to allow me to do is to add a field that can be edited by users in their SP profile page (and I'd definitely prefer they not have to enter the information twice).

 

I'm probably missing something, and if there is a forum post about this already, then I apologize, but I wasn't able to find it.  Thanks in advance for any assistance.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 11, 2012 - 10:45 pm

in 5.0, its all about themes...  previously it was fixed display... it could only show in one spot - no way to change...

Now, you have complete control on where to display it... could be in forum or could be in post... or other...

first step is decide where you want it... then you need to add the template tag to display the custom profile field in that location...  doing this my editing the appropriate template file in the sp theme... just a reminder, you really should create your own them rather than editing one of ours to prevent loss of changes on upgrade...  just start by copying one of ours...

where you want the custom profile field to display, just add:

sp_CustomProfileFieldsDisplay($name, $userid);

where $name is the name of the custom profile field you created...  and $userid tells whose info to display... just leave it off for the current user... or add the user id of the user you want...

Avatar
Jeremy
Guest
Guests
Jan 12, 2012 - 10:22 am

Thanks so much for the quick and helpful reply.  Makes sense, and I'll try it today.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 12, 2012 - 11:17 am

You're welcome.

andy-signature.png
YELLOW
SWORDFISH
Avatar
sptab
Member
sp_UserOfflineSmall Offline
Apr 2, 2012 - 4:53 am

I am using some custom profile information in my forum scripts and would need just to access the data rather than displaying it. I have modified SP plugin code (sp-custom-profile-fields-display-tag.php) to allow that, but I was thinking it could also be useful to add a such a function to get the data (and not display it) in a later custom profile plugin update.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 2, 2012 - 10:06 am

The important thing here might be where are you wanting to use this data and who for. If you can tell me that I can advise on what would be best.

andy-signature.png
YELLOW
SWORDFISH
Avatar
sptab
Member
sp_UserOfflineSmall Offline
Apr 2, 2012 - 12:26 pm

Well, I actually made the necessary changes for my use, I was mainly asking in case it helps others.

I'm using a profile custom field (list of items with a radiobox) to register the tablet model each forum user has. Based on this information, I'm doing some operations and displaying it next to each user post in the left area (profile). To achieve this, I made a custom version of sp_do_CustomProfileFieldsDisplay function that just returns the custom profile data and put it in spFunctions.php of my theme.

Works perfect wink

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 2, 2012 - 5:27 pm

Yes it would but there is a better way that requires no new functions.
For each post in topic view there is a global data object available called $spThisPostUser. That will have a property defined for each custom field. So - if the slug of your custom field is 'tablet' then the data will be available as $spThisPostUser->tablet

If you go to the forum admin > Toolbox > Data Inspector - then you can turn on the inspector for $spThisPostUser and see the data that is available for each user...

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626