This post is written with the assumption that you have already created your own User Profile Fields in the User Profile Field Manager. If you need help with this, you may read about it in the manual here - http://www.vbulletin.com/docs/html/profile
For the purposes of this article, I will be referring to "fieldx" as the name of your profile field. Your real name will be found in the User Profile Manager in the "Name" column - field1, field2, etc. and will be using the Hook system rather than Template Edits to achieve this
Adding the Profile Field to your postbit (or postbit_legacy) template
For Single-Line Text Box, Multiple-Line Text Box, Single-Selection Radio Buttons, and Single-Selection Menu ONLY
Firstly, go to:
AdminCP > Styles & Themes > Style Manager
...and using the dropdown next to your chosen Style, select 'Add New Template'. Name this template 'conversation_profilefields' and add the following to the template code:
Change the three instances of "fieldx" to your actual field name then save this template. For multiple fields, repeat the <vb:if> </vb:if> line changing the "fieldx" to the appropriate field ID.
Next, go to:
AdminCP > Products & Hooks > Manage Hooks
...and click on the 'Add New Hook' link. Create a new hook with these specifications:
Save this Hook. Now, provided you have text in the relevant Profile Field, these will show up underneath the number of posts a user has when the relevant profile field is completed by the user.
Instructions for Multiple-Selection Menu and Multiple-Selection Checkbox fields will follow later...
For the purposes of this article, I will be referring to "fieldx" as the name of your profile field. Your real name will be found in the User Profile Manager in the "Name" column - field1, field2, etc. and will be using the Hook system rather than Template Edits to achieve this
Adding the Profile Field to your postbit (or postbit_legacy) template
For Single-Line Text Box, Multiple-Line Text Box, Single-Selection Radio Buttons, and Single-Selection Menu ONLY
Firstly, go to:
AdminCP > Styles & Themes > Style Manager
...and using the dropdown next to your chosen Style, select 'Add New Template'. Name this template 'conversation_profilefields' and add the following to the template code:
PHP Code:
{vb:data userInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}
<vb:if condition="$userInfo['fieldx']"><li class="b-userinfo__additional-info"><label>{vb:phrase fieldx_title}:</label> <span>{vb:raw userInfo.customFields.default.fieldx_title.val}</span></li></vb:if>
Next, go to:
AdminCP > Products & Hooks > Manage Hooks
...and click on the 'Add New Hook' link. Create a new hook with these specifications:
- Product: vBulletin
- Hook is Active: Yes
- Hook Location: conversation_userstats
- Title: Add User Profile Fields to Conversation Userinfo Template
- Template Name: conversation_profilefields
Save this Hook. Now, provided you have text in the relevant Profile Field, these will show up underneath the number of posts a user has when the relevant profile field is completed by the user.
Instructions for Multiple-Selection Menu and Multiple-Selection Checkbox fields will follow later...
Comment