Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Preferred Name (Display Name) Details »»
Preferred Name (Display Name)
Version: 1.00, by Hex_legend Hex_legend is offline
Developer Last Online: Oct 2015 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.x Rating:
Released: 12-14-2007 Last Update: Never Installs: 28
Template Edits
Re-useable Code Translations  
No support by the author.

This minor template edit will enable your users to have a "Preferred Name" instead of their username showing on their posts and navbar. Users would still log in using their username and password just that their preferred name would show up instead of their username.

This will not change the displayed name in the "Who's online" box.

This would be a good protection against cases where an admin from another site steals passwords. Meaning they try to log in with the password of a username they recognise. But in the end, it isn't really the right username. Regardless .. this is a feature that would be useful to some members.

Step 1.

Go into your Admin CP
User Profile Fields
Add New Profile Field
Single Line Text Box

Name: Preferred Name
Description: What would you like to be known as on the site? you will still use your username to log in.
Required: Yes, Always
Private Field: No
Field Searchable: No
Show On Member List: No

Leave everything else the same.

Make a note of the user field number that is assigned to this field (for this example, we will use Field5)

Step 2.

In Styles & Templates

Open Navbar (Under Navigation Templates)

Search For:
Code:
$bbuserinfo[username]
Replace With:
Code:
$bbuserinfo[fieldX]
Where X is the field number from step 1.

Save.

Open up Postbit / Postbit Legacy (Depending on which one you use.

Search For:
Code:
$post[musername]
Replace With:
Code:
$post[fieldX]
Where X is the field number from step 1.

Save.

Step 3.

Click Language & Phrases.
Search For Phrase.
"Thank you for logging "
Click Edit.

Replace with:

Code:
Thank you for logging in, $bbuserinfo[fieldX] .
Where X is the field number from step 1.

Done. No more template edits.


THANKS TO
  • Kirk Y
  • DJ RREBEL

REMEMBER TO CLICK INSTALL

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-16-2007, 04:21 AM
shadowevil shadowevil is offline
 
Join Date: Apr 2006
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice mod .. But i want "display name" showing all is: register, login, who's online, profile ..v..v.. so, i want this mod show replace all username .... i waiting version 2.0

shadowevil install
Reply With Quote
  #13  
Old 12-16-2007, 05:50 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You might want to consider changing the replacements to:
Code:
<if condition="$bbuserinfo['fieldX']">$bbuserinfo[fieldX]<else />$bbuserinfo[username]</if>
Otherwise people who haven't set a "Preferred Name" won't have a Username.
Reply With Quote
  #14  
Old 12-18-2007, 11:16 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wish vbulletin had the one implemented like on IPB boards default
Reply With Quote
  #15  
Old 12-18-2007, 03:08 PM
MiahBeSmokin420 MiahBeSmokin420 is offline
 
Join Date: May 2007
Location: Ohio
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kirk Y View Post
You might want to consider changing the replacements to:
Code:
<if condition="$bbuserinfo['fieldX']">$bbuserinfo[fieldX]<else />$bbuserinfo[username]</if>
Otherwise people who haven't set a "Preferred Name" won't have a Username.
LMAO Good thinking
Reply With Quote
  #16  
Old 12-20-2007, 12:50 PM
PinkDaisy's Avatar
PinkDaisy PinkDaisy is offline
 
Join Date: Sep 2006
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay.. I did this and then decided agaisnt it. Took all my templates back and now everyones posts is showing up in their username, even if its posted by someone else, it shows their username in the threads. Any help?
Reply With Quote
  #17  
Old 12-20-2007, 02:14 PM
PinkDaisy's Avatar
PinkDaisy PinkDaisy is offline
 
Join Date: Sep 2006
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay.. now all my posts aren't showing up and it's just all messed up. Gosh.. what did I do?
Reply With Quote
  #18  
Old 12-23-2007, 05:06 AM
DJ RRebel DJ RRebel is offline
 
Join Date: Jul 2002
Location: CANADA
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry Pink .. Can't really understand what your problem is ... everything should be fine if you reverted your templates back to their defaults.
Reply With Quote
  #19  
Old 01-15-2008, 11:49 PM
RDx321 RDx321 is offline
 
Join Date: Jan 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I add this to the main page for the Last Post By .
Reply With Quote
  #20  
Old 02-12-2008, 04:21 AM
Illustrious Illustrious is offline
 
Join Date: Dec 2005
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I was just going to post that you may want to make it conditional:

Code:
<if condition="$post[field7]">$post[fieldX]<else />$post[musername]</if>
Also, by doing this, you're stripping the name of all of its markup. It may not be the best idea.

Edit: You can retain the usergroup's html markup if you edit it the functions.php file, but is there any other way to do it without file edits?
Reply With Quote
  #21  
Old 02-24-2008, 02:05 AM
landspeed landspeed is offline
 
Join Date: Oct 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Illustrious View Post
Yeah, I was just going to post that you may want to make it conditional:

Code:
<if condition="$post[field7]">$post[fieldX]<else />$post[musername]</if>
Also, by doing this, you're stripping the name of all of its markup. It may not be the best idea.

Edit: You can retain the usergroup's html markup if you edit it the functions.php file, but is there any other way to do it without file edits?

I don't see any way to do it without code modification. The board isn't developed to handle the thought of a user having a different editable bit that is displayed aside from login. It would be nice.

I'll look at hacking the function code.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:55 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05895 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete