I've read a lot of topics on this at .com and in area51. I have not seen an answer to what I was looking for.
Here, I will show you how I was able to utilize and control the different custom profile fields we've added to our sites.
This is the section of the viewtopic_body.html which we are all having problems to get to work like we want it to.
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. -->
<br /><b>{postrow.PROFILE_FIELD1_NAME}:</b> {postrow.PROFILE_FIELD1_VALUE}
<!-- ENDIF -->
Highway of Life and Handyman have 3 custom profile fields they use on our STG site.
- Favorite Team
- Gender
- Real Name
OPEN styles/subsilver2/template/viewtopic_body.html
FIND
Code: Select all
<!-- BEGIN custom_fields -->
<br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
<!-- END custom_fields -->
Code: Select all
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Favorite Team" -->
<b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}<br />
<!-- ENDIF -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Gender" -->
<b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}<br />
<!-- ENDIF -->
<!-- END custom_fields -->
FIND
Code: Select all
<!-- BEGIN custom_fields -->
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- END custom_fields -->
Code: Select all
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Favorite Team" -->
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- ENDIF -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Gender" -->
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- ENDIF -->
<!-- END custom_fields -->
You can place each field you've added anywhere in your page that you want it.
Now for the 3rd custom profile field, "Real Name" I want this field further up the page under the username.
For subsilver2
FIND
Code: Select all
<!-- IF postrow.ONLINE_IMG -->
Code: Select all
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Real Name" -->
<tr>
<td align="center" nowrap="nowrap"><b class="postauthor"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->><i>{postrow.custom_fields.PROFILE_FIELD_VALUE}</i></b></td>
</tr>
<!-- ENDIF -->
<!-- END custom_fields -->
<!-- IF postrow.ONLINE_IMG -->
FIND
Code: Select all
<dt>
<!-- IF postrow.POSTER_AVATAR -->
<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br />
<!-- ENDIF -->
<!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
</dt>
Code: Select all
<dt>
<!-- IF postrow.POSTER_AVATAR -->
<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br />
<!-- ENDIF -->
<!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Real Name" -->
<b class="postauthor"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->><i>{postrow.custom_fields.PROFILE_FIELD_VALUE}</i></b>
<!-- ENDIF -->
<!-- END custom_fields -->
</dt>
I also worked with a couple of guys here who used a "Clan Site" custom profile field for their users.
But, they didn't want the url which a user entered in to show up in that profile field.
They wanted an image (a button) to be there that would link them to the url address.
Watch how this works with an image.... which we couldn't do before.
FIND
Code: Select all
<!-- BEGIN custom_fields -->
<br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
<!-- END custom_fields -->
Code: Select all
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Clan Site" -->
<b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> <a href="{postrow.custom_fields.PROFILE_FIELD_VALUE}"><img src="{T_IMAGESET_PATH}/en/icon_contact_www.gif" alt="{postrow.custom_fields.PROFILE_FIELD_VALUE}" title="{postrow.custom_fields.PROFILE_FIELD_VALUE}"></a>
<!-- ENDIF -->
<!-- END custom_fields -->