Support Forum
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...
Visit Cruise Talk Central and Mr Papa's World
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);
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";
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)