phpBB

Development Wiki

Difference between revisions of "Talk:Tutorial.Custom profile fields"

From phpBB Development Wiki

(New page: I guess there is a little problem with "IF postrow.custom_fields.PROFILE_FIELD_NAME" because that field_name is language specific, so one possible solution could be to to define language v...)
 
Line 3: Line 3:
  
 
An other solution could be to read out the real (language independent) field_name from the database table phpbb_profile_fields... but I dont know how... I will see, whether I can find a way ...
 
An other solution could be to read out the real (language independent) field_name from the database table phpbb_profile_fields... but I dont know how... I will see, whether I can find a way ...
 
A third way could be to to make an if for every language, this way you dont need to change php files, but it makes your template much longer
 
 
--[[User:Blablubbb|Blablubbb]] 10:37, 29 May 2009 (UTC)
 
--[[User:Blablubbb|Blablubbb]] 10:37, 29 May 2009 (UTC)
 +
I got it now. You got the advice in your template:
 +
<nowiki>
 +
<!-- IF postrow.S_PROFILE_FIELD1 -->
 +
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
 +
<br /><b>{postrow.PROFILE_FIELD1_NAME}:</b> {postrow.PROFILE_FIELD1_VALUE}
 +
<!-- ENDIF --></nowiki>
 +
It is just, that you got the real (language independent) field_name from the database table in tiny letters and if you "Replace FIELD1 with the name of your field" you need to write that now in capital letters. So if it is "gender" you got  <nowiki><!-- IF postrow.S_PROFILE_GENDER --></nowiki> instead... Thats all.
 +
--[[User:Blablubbb|Blablubbb]] 00:39, 19 June 2009 (UTC)

Revision as of 00:39, 19 June 2009

I guess there is a little problem with "IF postrow.custom_fields.PROFILE_FIELD_NAME" because that field_name is language specific, so one possible solution could be to to define language variables and then you use something like: <!-- IF postrow.custom_fields.PROFILE_FIELD_NAME == '{L_FAVORITE_TEAM}' -->

An other solution could be to read out the real (language independent) field_name from the database table phpbb_profile_fields... but I dont know how... I will see, whether I can find a way ... --Blablubbb 10:37, 29 May 2009 (UTC) I got it now. You got the advice in your template: <!-- IF postrow.S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> <br /><b>{postrow.PROFILE_FIELD1_NAME}:</b> {postrow.PROFILE_FIELD1_VALUE} <!-- ENDIF --> It is just, that you got the real (language independent) field_name from the database table in tiny letters and if you "Replace FIELD1 with the name of your field" you need to write that now in capital letters. So if it is "gender" you got <!-- IF postrow.S_PROFILE_GENDER --> instead... Thats all. --Blablubbb 00:39, 19 June 2009 (UTC)