View Full Version : Showing user number in profile and postbit
mattltm
04-23-2015, 03:20 PM
I need a simple way to give members of my forum a membership number. The best, easiest way I can think of is to use the number the Vbulletin assigns the user.
Is there a simple way to display the users number in the postbit (under the join date maybe?) and in their profile page?
MarkFL
04-23-2015, 04:16 PM
Using the default style on my dev site, I added the following (in red) to the postbit_legacy template:
<dl class="userinfo_extra">
<vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}</dt> <dd>{vb:raw post.joindate}</dd></vb:if>
<dt>User ID Number</dt> <dd>{vb:raw post.userid}</dd>
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd>{vb:raw post.field2}</dd></vb:if>
<vb:if condition="$post['age']"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></vb:if>
<dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd>
{vb:raw template_hook.postbit_userinfo_right_after_posts}
</dl>
Because that block of code is already within a vb conditional depending on the existence of the userid, there was no need to wrap the additional code with the same conditional.
mattltm
04-24-2015, 06:47 AM
That is perfect! Thank you.
Is there an easy way to add the same to the users profile page? Maybe under their username?
MarkFL
04-24-2015, 07:00 AM
That is perfect! Thank you.
Is there an easy way to add the same to the users profile page? Maybe under their username?
Go to the "MEMBERINFO" template, and add the code in red:
<span id="userinfo">
<span class="member_username">{vb:raw prepared.musername}</span>
<span class="member_status">{vb:raw prepared.onlinestatus}</span>
<vb:if condition="$prepared['userid']">
<br />
<span style="font-weight: normal">User ID Number: {vb:raw prepared.userid}</span>
</vb:if>
<vb:if condition="$prepared['usertitle']">
<br />
<span class="usertitle">{vb:raw prepared.usertitle}</span>
</vb:if>
mattltm
04-24-2015, 07:07 AM
Perfect!
You are a superstar :cool:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.