custom profile field in profile

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
Locked
pca_paul
Registered User
Posts: 18
Joined: Mon Feb 28, 2011 12:24 pm

custom profile field in profile

Post by pca_paul » Tue Mar 01, 2011 9:19 am

i would like to pull custom fields one by one so i can fully customize my profiles, ive tried a million different codes knocking about the forum but just cant seem to get any custom field to show, Any help?

User avatar
AmigoJack
Registered User
Posts: 5657
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: custom profile field in profile

Post by AmigoJack » Tue Mar 01, 2011 9:36 am

The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: custom profile field in profile

Post by Oyabun1 » Tue Mar 01, 2011 10:44 am

Or maybe this, Tutorial.Custom profile fields, will help.

If it's just that you can't get them to show, make sure in:
ACP > GENERAL > BOARD CONFIGURATION > Board features > Load Setings
you have the switches for "Display custom profile fields in user profiles:" and "Display custom profile fields on topic pages:", set to Yes, as appropriate.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

pca_paul
Registered User
Posts: 18
Joined: Mon Feb 28, 2011 12:24 pm

Re: custom profile field in profile

Post by pca_paul » Tue Mar 01, 2011 11:15 am

have already tried both of those and just tried again but with no luck the first one actually breaks the whole forum lol spose thats me doing something wrong in functions though

pca_paul
Registered User
Posts: 18
Joined: Mon Feb 28, 2011 12:24 pm

Re: custom profile field in profile

Post by pca_paul » Tue Mar 01, 2011 11:19 am

<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "advert" -->
<b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}<br />
<!-- ENDIF -->

<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "advert" -->
<b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}<br />
<!-- ENDIF -->
<!-- END custom_fields -->

<!-- BEGIN custom_fields2 -->
<!-- IF custom_fields2.PROFILE_FIELD_NAME eq "advert" -->
<dt>{custom_fields2.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields2.PROFILE_FIELD_VALUE}</dd>
<!-- ENDIF -->
<!-- END custom_fields2 -->

<!-- BEGIN custom_fields -->
<!-- IF custom_fields.PROFILE_FIELD_NAME eq "advert" -->
<dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- ENDIF -->
<!-- END custom_fields -->

<!-- IF postrow.S_PROFILE_advert -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
<br /><b>{postrow.PROFILE_ADVERT_NAME}:</b> {postrow.PROFILE_ADVERT_VALUE}
<!-- ENDIF -->

pca_paul
Registered User
Posts: 18
Joined: Mon Feb 28, 2011 12:24 pm

Re: custom profile field in profile

Post by pca_paul » Tue Mar 01, 2011 11:33 am

ok the first one doesnt break it now but when i add
<!-- BEGIN profile_fields -->
<!-- IF profile_fields.IDENT eq 'advert' -->
<b>{profile_fields.LANG_NAME} = {profile_fields.FIELD}</b>
<!-- ELSEIF profile_fields.IDENT eq 'basis' -->
<i>{profile_fields.LANG_NAME} = {profile_fields.FIELD}</i>
<!-- ELSEIF profile_fields.IDENT eq ...
...
<!-- ENDIF -->
<!-- END profile_fields -->
to the profile code in memberslist_view.php

nothing happens

User avatar
AmigoJack
Registered User
Posts: 5657
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: custom profile field in profile

Post by AmigoJack » Tue Mar 01, 2011 12:06 pm

That's because no profile_fields array exists. Look more closer! By now in /styles/?/template/memberlist_view.html custom profile fields are listed with this loop:

Code: Select all

		<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
See it? It's custom_fields.

My instructions on the other topic refered to /styles/subsilver2/template/ucp_profile_profile_info.html - that's a difference.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

pca_paul
Registered User
Posts: 18
Joined: Mon Feb 28, 2011 12:24 pm

Re: custom profile field in profile

Post by pca_paul » Tue Mar 01, 2011 12:12 pm

ok thanks , so what do i do?
<!-- BEGIN custom_fields -->
<!-- IF custom_fields.IDENT eq 'advert' -->
<b>{custom_fields.LANG_NAME} = {custom_fields.FIELD}</b>
<!-- ELSEIF profile_fields.IDENT eq 'basis' -->
<i>{custom_fields.LANG_NAME} = {custom_fields.FIELD}</i>
<!-- ELSEIF custom_fields.IDENT eq ...
...
<!-- ENDIF -->
<!-- END custom_fields -->
tried this

User avatar
AmigoJack
Registered User
Posts: 5657
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: custom profile field in profile

Post by AmigoJack » Tue Mar 01, 2011 1:22 pm

Please use proper BBCode, like [ code] instead of [quote].

Open /includes/functions_profile_fields.php and find:

Code: Select all

                $tpl_fields['blockrow'][] = array( 
After, add:

Code: Select all

                    'IDENT'    => $ident, 
Open /styles/?/template/memberlist_view.html and at your place of choice add:

Code: Select all

<!-- BEGIN custom_fields -->
	<!-- IF custom_fields.IDENT eq 'BOW' -->
		<b>{custom_fields.PROFILE_FIELD_NAME} = {custom_fields.PROFILE_FIELD_VALUE}</b>
	<!-- ELSEIF custom_fields.IDENT eq 'ARROW' -->
		<i>{custom_fields.PROFILE_FIELD_NAME} = {custom_fields.PROFILE_FIELD_VALUE}</i>
	<!-- ELSE -->
		<br/>My field ident is "{custom_fields.IDENT}",
		my name is "{custom_fields.PROFILE_FIELD_NAME}",
		my content is "{custom_fields.PROFILE_FIELD_VALUE}" and
		you need to give me another IF/ELSEIF branch in your code.
	<!-- ENDIF -->
<!-- END custom_fields -->
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

The.MacGuffin
Registered User
Posts: 109
Joined: Thu Apr 07, 2011 10:42 am

Re: custom profile field in profile

Post by The.MacGuffin » Sun Apr 10, 2011 12:30 pm

I have the same problem and am trying to do exactly the same thing. I have a tabbed profile page and want to place custom fields on specific tab pages rather than all being in one block on one page.

Is there a solution found that works for this situation?

The.MacGuffin
Registered User
Posts: 109
Joined: Thu Apr 07, 2011 10:42 am

Re: custom profile field in profile

Post by The.MacGuffin » Sun Apr 10, 2011 2:23 pm

EDIT: Yay it works for me now. Many thanks for helping me solve that. It was driving me nuts.

Locked

Return to “[3.0.x] MOD Requests”