Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Managing user profiles
Avatar
HoneyBee
Member
Free Members
sp_UserOfflineSmall Offline
May 27, 2012 - 4:16 am

I have just installed the custom profile fields plugin, and created 3 new fields displaying in Edit Profile but the fields do not show up in Profile

How do i do this please

Avatar
HoneyBee
Member
Free Members
sp_UserOfflineSmall Offline
May 27, 2012 - 6:20 am

Figured it out

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 27, 2012 - 9:01 am

okay, thanks for the update.

Avatar
HoneyBee
Member
Free Members
sp_UserOfflineSmall Offline
May 27, 2012 - 12:28 pm

sorry I thought I got it but it is not working.

 

i tried adding this sp_CustomProfileFieldsDisplay($name, $userid=0) to where I wanted the custom field to display but that just broke the Profile display page.

 

What am i supposed to do?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 27, 2012 - 12:44 pm

well you need to provide the $name value and the $userid for the user...

where are you trying to display this?  on the profile display page? the full page and not the popup?  so you are editing the spProfileShow.php template file?   please be sure to make your own sp theme so you dont lose changes on updates...  see:  http://codex.simple-press.com/.....g-a-theme/

Now, there are two ways you can do this...  you were on the right track for one of them...

sp_CustomProfileFieldsDisplay($name, $userid=0);

where you want it, but you need to replace $name with the name of your custom profile field...  you gave it this on the custom profile field form where you created it...  and rather than $userid=0, pass in $spProfileUser->ID...  so:

sp_CustomProfileFieldsDisplay('my_custom_name', $spProfileUser->ID);

you still need to replace my_custom_name with the name you actually gave it...  and note that this will only output the data itself.. you may still want to put some sort of description around it...  maybe this

echo 'My Field: ';
 sp_CustomProfileFieldsDisplay('my_custom_name', $spProfileUser->ID);

the second way is easier or trickier depending on what you called the custom profile field... but you can easily get at it from the current user object, in this case $spProfileUser...  so if you custom field was called 'address', you could also get at it on the profile as:

echo 'My Field: '.$spProfileUser->address;

but if the custom profile field name is complex, its hard to explain was to use in place of address... wink

Avatar
HoneyBee
Member
Free Members
sp_UserOfflineSmall Offline
May 29, 2012 - 1:44 am

HI, thanks for the help. I got it working but the style is off. Any suggestions as to what I can do please?

It's the "Business Name" that is not styling properlystyling_issue.gifImage Enlargerin the attachment

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 29, 2012 - 3:34 am

Will need Steve (Mr Papa) to confirm this but try giving the label a class of 'spProfileLeftCol' and see if that helps...

andy-signature.png
YELLOW
SWORDFISH
Avatar
HoneyBee
Member
Free Members
sp_UserOfflineSmall Offline
May 29, 2012 - 3:53 am

How would I add the class. code looks like this

 

 echo 'Business Name: '; sp_CustomProfileFieldsDisplay('Business Name' , $spProfileUser->ID);
echo 'Business Sector: '; sp_CustomProfileFieldsDisplay('Business Sector', $spProfileUser->ID);
echo 'Key Business Activities: '; sp_CustomProfileFieldsDisplay('Key Business Activities', $spProfileUser->ID);

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 29, 2012 - 8:49 am

if  you are putting it right after the location stuff in the popup profile, try this:

$out.= "<div class='spColumnSection spProfileLeftCol'>";
$out.= "<p class='spProfileShowDisplayName'>Business Name:</p>";
$out.= '</div>';
$out.= "<div class='spColumnSection spProfileSpacerCol'></div>";
$out.= "<div class='spColumnSection spProfileRightCol'>";
$out.= "<p class='spProfileShowDisplayName'>".sp_CustomProfileFieldsDisplay('Business Name' , $spProfileUser->ID)."</p>";
$out.= "</div>\n";
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: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625