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
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 11, 2015 - 5:30 pm

What do you use for displaying the profile?

andy-signature.png
YELLOW
SWORDFISH
Avatar
JINCUI HAO
Member
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2015 - 1:12 am

simple press 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2015 - 1:20 am

??????  Andy was asking if you use the profile page display or the popup display.... it makes a difference in which template file to adjust...

Avatar
JINCUI HAO
Member
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2015 - 9:35 am

profile page, not popup.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 12, 2015 - 4:10 pm

OK this looks worse than it is but actually it is pretty straightforward.

I am assuming you want to display this data in the top section under the last item which, by default, is 'Bio'. 

For this you will need to edit the template file named 'spProfileShow.php'.  Scroll down until you find the function sp_ProfileShowBio() and we are going to add code blocks underneath that line.

For EACH custom profile field you want to display use the following code. Use the ' Raw Code' button and then select and copy it from the popup window: paste it into the template.

echo '<div class="spColumnSection spProfileLeftCol">';
echo '<p class="spProfileLabel">Gender:</p>';
echo '</div>';
echo '<div class="spColumnSection spProfileSpacerCol"></div><p>';
echo '<div class="spColumnSection spProfileRightCol">';
echo '<p class="spProfileLabel">';
sp_CustomProfileFieldsDisplay('Gender', $spProfileUser->ID);
echo '</p></div>';

You will want to change the label in line 2 currently showing Gender.  And you will want to change the name of the custom field in line 7 to the name you used when you set the field up.

repeat for each custom field.

andy-signature.png
YELLOW
SWORDFISH
Avatar
JINCUI HAO
Member
Free Members
sp_UserOfflineSmall Offline
Jan 25, 2015 - 1:31 am

001-2.jpgImage Enlarger

As you can see from the image, country ,gender are being displayed as a single row and not as separate rows lined up underneath bio, how can I fix that ?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 25, 2015 - 4:46 am

Actually I can't see anything useful from that image.

They should be below each other as they are block elements. try putting a br tag in between them but if that doesn't work you better paste here the code you used. Use the syntax highlghter button in the toolbar for that.

andy-signature.png
YELLOW
SWORDFISH
Avatar
JINCUI HAO
Member
Free Members
sp_UserOfflineSmall Offline
Jan 25, 2015 - 8:11 am

# show profile info
sp_ColumnStart('tagClass=spProfileShowInfoSection spRight&width=65%', 'profileInfo');
sp_ProfileShowDisplayName('', __sp('Username'));
sp_ProfileShowFirstName('', __sp('First Name'));
sp_ProfileShowLastName('', __sp('Last Name'));
sp_ProfileShowLocation('', __sp('Location'));
sp_ProfileShowWebsite('', __sp('Website'));
sp_ProfileShowBio('', __sp('Bio'));
sp_CustomProfileFieldsDisplay('Country', $spProfileUser->ID);
sp_CustomProfileFieldsDisplay('Gender', $spProfileUser->ID);
sp_CustomProfileFieldsDisplay('Orientation', $spProfileUser->ID);
sp_CustomProfileFieldsDisplay(‘Lookingfor’, $spProfileUser->ID);
sp_CustomProfileFieldsDisplay(‘Preference’, $spProfileUser->ID);

sp_ColumnEnd('', 'profileInfo');

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 25, 2015 - 9:06 am

I don't see any of the code I gave you in there. This is either because you missed it out or because it has been stripped for the post. You do need to use the Syntax Highlighter button as suggested.

Paste in the code. Select VERY carefully JUST the code. Click the syntax button on the toolbar above (far right) and select php.

andy-signature.png
YELLOW
SWORDFISH
Avatar
JINCUI HAO
Member
Free Members
sp_UserOfflineSmall Offline
Jan 25, 2015 - 10:57 am

I know this is going to sound stupid, but although i have Tincy mce enabled it does not appear on the theme editor.

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