Displaying Single Field in profile

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
onei0120
Registered User
Posts: 4
Joined: Wed Aug 02, 2017 12:35 am

Displaying Single Field in profile

Post by onei0120 »

Hey Guys,

I understand how to display all the user profile fields with this code:

<!-- BEGIN custom_fields -->
<!-- IF custom_fields.S_PROFILE_CONTACT -->

<!-- IF custom_fields.PROFILE_FIELD_CONTACT -->
<span class="profile-link"><a href="{custom_fields.PROFILE_FIELD_CONTACT}">{custom_fields.PROFILE_FIELD_CONTACT}</a></span>
<div class="float-divider"></div>
<!-- ELSE -->
<span class="profile-link">{custom_fields.PROFILE_FIELD_VALUE}</span>
<div class="float-divider"></div>
<!-- ENDIF -->
<!-- ENDIF -->
<!-- END custom_fields -->


But what if I just want to display a single one like "Website" or "Facebook" URL? I cant figure out how to do this, can anyone provide some insight or point me in the right direction?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53639
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Displaying Single Field in profile

Post by Brf »

The example code is right there in viewtopic_body.html:

Code: Select all

		<!-- IF postrow.S_PROFILE_FIELD1 -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</strong> {postrow.PROFILE_FIELD1_VALUE}</dd>
		<!-- ENDIF -->
onei0120
Registered User
Posts: 4
Joined: Wed Aug 02, 2017 12:35 am

Re: Displaying Single Field in profile

Post by onei0120 »

I am trying to get the website value inside of memberlist_view.html with this code:

Code: Select all

<!-- IF postrow.S_PROFILE_WEBSITE -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong>{postrow.PROFILE_WEBSITE_NAME}{L_COLON}</strong> {postrow.PROFILE_WEBSITE_VALUE}</dd>
		<!-- ENDIF -->
But it doesnt seem to work, any ideas?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53639
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Displaying Single Field in profile

Post by Brf »

That field is named "PHPBB_WEBSITE"
onei0120
Registered User
Posts: 4
Joined: Wed Aug 02, 2017 12:35 am

Re: Displaying Single Field in profile

Post by onei0120 »

Tried this:

Code: Select all

 <!-- IF postrow.S_PROFILE_PHPBB_WEBSITE -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong>{postrow.PROFILE_PHPBB_WEBSITE_NAME}{L_COLON}</strong> {postrow.PROFILE_PHPBB_WEBSITE_VALUE}</dd>
		<!-- ENDIF -->
Doesnt seem to work either
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53639
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Displaying Single Field in profile

Post by Brf »

You cleared your board's cache after editing?
onei0120
Registered User
Posts: 4
Joined: Wed Aug 02, 2017 12:35 am

Re: Displaying Single Field in profile

Post by onei0120 »

Yes, I have taken other bits of code out and in to make sure. I have cleared both in the ACP and manually
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53639
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Displaying Single Field in profile

Post by Brf »

In the ACP Custom Profile fields you have it displayed publicly, and displayed on viewprofile, as well as allowing custom profile fields on topic pages on the Load Settings page?

Return to “phpBB Custom Coding”