vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Showing user number in profile and postbit (https://vborg.vbsupport.ru/showthread.php?t=318383)

mattltm 04-23-2015 03:20 PM

Showing user number in profile and postbit
 
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:

Code:

                                <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

Quote:

Originally Posted by mattltm (Post 2544038)
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:

Code:

                                        <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:


All times are GMT. The time now is 06:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01136 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete