vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Style and Graphics Requests (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=226)
-   -   Custom Profile Field on Postbit (https://vborg.vbsupport.ru/showthread.php?t=165892)

MET920 12-22-2007 08:05 PM

Custom Profile Field on Postbit
 
On my forums, I have a custom profile field called Nickname (because everyone is required to register with their real names since we all know each, but not well enough that we'd know who's who just from their nicknames). I was hoping someone would be so kind as to create a postbit template modification for me that would display the user's nickname between parenthesis after their username on their posts. For example, if the user's username is John Doe and his nickname profile field is johnny, it would display as "John Doe (johnny)".

I know this is a very simple modification, but I'm just not familiar with the vB code and I've never really learned PHP, although I can understand it because of knowing other programing languages.

Edit: I also wouldn't mind having it the same way as how "Real name" is here between location and posts, but I would really prefer it to be between parenthesis.

Thank you very much in advance,
Met

Gray Matter 12-25-2007 02:08 PM

Open your postbit or postbit_legacy template, depending on which you're using.

Find this code:

Code:

<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
And replace it with this:

Code:

<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a> ($post[fieldX])
Make sure you change the X to the ID of the "nickname" field. To get the ID of the nickname field, visit your "User Profile Field Manager" in the Admin CP. :)


All times are GMT. The time now is 01:09 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.00892 seconds
  • Memory Usage 1,709KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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