[SOLVED]Custom field "Problem"

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
Post Reply
Shad0w28
Registered User
Posts: 13
Joined: Fri Jan 26, 2018 7:24 pm

[SOLVED]Custom field "Problem"

Post by Shad0w28 »

Hello guys, I want to put some icons on the custom field.
My script it's: http://prntscr.com/i7eggd
But the problem is that it's double: http://prntscr.com/i7egpb
How to resolv this problem?
Last edited by Shad0w28 on Tue Jan 30, 2018 5:43 pm, edited 1 time in total.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Custom field "Problem"

Post by Mick »

Please post your code in code (BBCode) tags here, screen caps don’t work for this type of thing.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Custom field "Problem"

Post by mrgoldy »

And probably there is a loop statement just below it, looping through all the custom fields aswell and displaying them.

Code: Select all

<!-- EVENT viewtopic_body_postrow_custom_fields_before -->
<!-- BEGIN custom_fields -->
	<!-- IF not postrow.custom_fields.S_PROFILE_CONTACT -->
		<dd class="profile-custom-field profile-{postrow.custom_fields.PROFILE_FIELD_IDENT}"><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
	<!-- ENDIF -->
<!-- END custom_fields -->
<!-- EVENT viewtopic_body_postrow_custom_fields_after -->
So check within that loop statement what FIELD you are currently in and add the Font Awesome icon accordingly.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
Shad0w28
Registered User
Posts: 13
Joined: Fri Jan 26, 2018 7:24 pm

Re: Custom field "Problem"

Post by Shad0w28 »

Mick wrote: Tue Jan 30, 2018 10:42 am Please post your code in code (BBCode) tags here, screen caps don’t work for this type of thing.

Code: Select all

		<!-- IF postrow.S_PROFILE_PHPBB_LOCATION -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-location-arrow" aria-hidden="true"></i> {postrow.PROFILE_PHPBB_LOCATION_NAME}{L_COLON}</strong> {postrow.PROFILE_PHPBB_LOCATION_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_REPUTATIE  -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-shield" aria-hidden="true"></i> {postrow.PROFILE_REPUTATIE_NAME}{L_COLON}</strong> {postrow.PROFILE_REPUTATIE_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_STATUS -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-text-height fa-fw" aria-hidden="true"></i> {postrow.PROFILE_STATUS_NAME}{L_COLON}</strong> {postrow.PROFILE_STATUS_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_SERVERMETIN -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-server fa-fw" aria-hidden="true"></i> {postrow.PROFILE_SERVERMETIN_NAME}{L_COLON}</strong> {postrow.PROFILE_SERVERMETIN_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_REGAT -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-flag" aria-hidden="true"></i> {postrow.PROFILE_REGAT_NAME}{L_COLON}</strong> {postrow.PROFILE_REGAT_VALUE}</dd>
		<!-- ENDIF -->

		<!-- EVENT viewtopic_body_postrow_custom_fields_before -->
		<!-- BEGIN custom_fields -->
			<!-- IF not postrow.S_PROFILE_PHPBB_LOCATION or not postrow.S_PROFILE_REPUTATIE or not postrow.S_PROFILE_STATUS or not postrow.S_PROFILE_SERVERMETIN or not postrow.S_PROFILE_REGAT -->
				<dd class="profile-custom-field profile-{postrow.custom_fields.PROFILE_FIELD_IDENT}"><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
			<!-- ENDIF -->
		<!-- END custom_fields -->
		<!-- EVENT viewtopic_body_postrow_custom_fields_after -->
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Custom field "Problem"

Post by Brf »

You need to remove the custom_fields loop.
Shad0w28
Registered User
Posts: 13
Joined: Fri Jan 26, 2018 7:24 pm

Re: Custom field "Problem"

Post by Shad0w28 »

Brf wrote: Tue Jan 30, 2018 4:17 pm You need to remove the custom_fields loop.
And how can I do that?

My code it's:

Code: Select all

		<!-- IF postrow.S_PROFILE_PHPBB_LOCATION -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-location-arrow" aria-hidden="true"></i> {postrow.PROFILE_PHPBB_LOCATION_NAME}{L_COLON}</strong> {postrow.PROFILE_PHPBB_LOCATION_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_REPUTATIE  -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-shield" aria-hidden="true"></i> {postrow.PROFILE_REPUTATIE_NAME}{L_COLON}</strong> {postrow.PROFILE_REPUTATIE_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_STATUS -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-text-height fa-fw" aria-hidden="true"></i> {postrow.PROFILE_STATUS_NAME}{L_COLON}</strong> {postrow.PROFILE_STATUS_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_SERVERMETIN -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-server fa-fw" aria-hidden="true"></i> {postrow.PROFILE_SERVERMETIN_NAME}{L_COLON}</strong> {postrow.PROFILE_SERVERMETIN_VALUE}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.S_PROFILE_REGAT -->
			<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
			<dd><strong><i class="fa fa-flag" aria-hidden="true"></i> {postrow.PROFILE_REGAT_NAME}{L_COLON}</strong> {postrow.PROFILE_REGAT_VALUE}</dd>
		<!-- ENDIF -->


		<!-- EVENT viewtopic_body_postrow_custom_fields_before -->
		<!-- BEGIN custom_fields -->
			<!-- IF not postrow.custom_fields.S_PROFILE_PHPBB_LOCATION or not postrow.custom_fields.S_PROFILE_REPUTATIE or not postrow.custom_fields.S_PROFILE_STATUS or not postrow.custom_fields.S_PROFILE_SERVERMETIN or not postrow.custom_fields.S_PROFILE_REGAT -->
			<dd class="profile-custom-field profile-{postrow.custom_fields.PROFILE_FIELD_IDENT}"><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
			<!-- ENDIF -->
		<!-- END custom_fields -->
		<!-- EVENT viewtopic_body_postrow_custom_fields_after -->
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Custom field "Problem"

Post by Brf »

The custom_fields loop is there at the bottom of your code.
Delete it.
Shad0w28
Registered User
Posts: 13
Joined: Fri Jan 26, 2018 7:24 pm

Re: [SOLVED]Custom field "Problem"

Post by Shad0w28 »

I solved this problem.
T/C
Post Reply

Return to “phpBB Custom Coding”