Back to vBulletin 5.x Template Modifications

Add custom field to postbit
Mod Version: 1.00, by Replicant

vB Version: 5.1.9 Rating: (2 votes - 5.00 average) Installs: 9
Released: 28 Nov 2015 Last Update: Never Downloads: 0
Not Supported Template Edits  

There have been a few questions regarding adding location to the postbit on vb.com lately. Lynne had a write-up here in 2013 using the Product/Hook system which is the best way to do it as the mod will survive an upgrade and there is a hook exactly where it's needed. I'm not going to go into creating a product with this mod.This is an example of a template edit to add a field to the postbit that only takes a few minutes. Keep in mid, this will be overwritten during an upgrade and will need to be re-applied. Since this requires editing templates, it will not work on the cloud. I am currently working on a jquery/ajax version for the cloud, but it's a little ways down the road when I'm not so busy.

Here's how to do it.
Step 1)Go to AdminCP >> User Profile fields >> Add new user profile field
Select single line textbox > then click "continue"
Fill out the title, description and other relevant info on that page and click save. This will also create the necessary phrases for the field.
Go to AdminCP >> User Profile fields >> User Profile fields Manager. Here you will see the new field you created and the field number used in step 2. I used field8 (Location) for this example.

Step 2) Edit conversation_userinfo template. Add this code after {vb:hook 'conversation_userstats'} on or about line 53 and click save.

Step 3) Goto your user profile and click edit settings. Scroll down on the profile tab and fill the new field with the info.

Code:
{vb:data postInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}
<vb:if condition="$postInfo['field8']"><li><label>{vb:phrase field8_title}:</lable>
	<span>{vb:raw postInfo.customFields.default.field8_title.val}</span></li>
</vb:if>

You can add classes in the code for custom CSS if you prefer. The default list view kind of sucks IMO.

Download

No files for download.

Screenshots

Click image for larger version
Name:	postbit.png
Views:	435
Size:	16.6 KB
ID:	153763  

Similar Mods

Remove Location display if author has no location vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024