Display Name / User Nickname Plugin
Author Message
This plugin allows users to have differing display and login names.  The former is displayed publicly to everyone (what is seen in posts), whereas the latter is only used for login purposes.

This plugin primarily patches MyBB's login, registration and lost password routines, so "username" often refers to the user's display name (perhaps this should be clarified a bit...).
Thus, to allow users to change their display name, simply give them their usergroup the ability to change username.

Known limitations/issues:
  • Only tested on (and intentionally designed for) MySQL - dunno if it works on other DB engines
  • During un/installation, the plugin will close the board whilst it performs processing to prevent potential issues with database integrity
  • It relies on a few things in the supplied English messages.lang.php and may not work correctly with other languages - this only really affects activation emails
  • Various English phrases are hard coded in
  • Login names aren't quite as vigorously checked as MyBB checks user names - this is to somewhat give users more flexibility, but a potential issue is that when this plugin is deactivated, everyone's username will be set to the login name.  This will generally be a minor issue however.
  • Like login names, display names must be unique (no two people can have the same display name at the same time)
  • Quotes in posts may become a little confusing/misleading if people change their display name often - you may wish to consider my vB Quote plugin which can get around this issue
  • Often "Username" is referred to, although whether it refers to a login name or a display name may be unclear.  For example, when a user tries to log in, it asks for their username and password.  Perhaps I might change this to "login name and password" in a later version.
  • I haven't done a lot of testing on this, so you probably should do some before you use it (and do so at your own risk)



Changelog:
v1.10
- compatibility fixes for MyBB 1.8
- template modifications are now performed on activate/deactivate instead of install/uninstall.  Please note that deactivating the plugin may cause things to go into a weird state, so please don't leave it in that state for long (it's only intended to allow you to fix templates)
- Please see this note if you are upgrading from MyBB 1.6 to 1.8

v1.05
- fix compatibility issues with MyBB 1.6 ACP logins

v1.04
- fixed bug: couldn't update login name

v1.03
- updated control_object function again (no functional difference, but may be required to keep compatibility with my other plugins)
- fixed a potential issue during uninstallation if there's a conflict between login and display names of different users

v1.02
- updated control_object function with more accurate version; functionally indifferent, but may be required to be compatible with my other plugins

v1.01
- fixed bug in regards to activation emails

v1.00
- initial release
(This post was last modified: 12-08-2014 05:27 PM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: dispname.php (17.65 KB)
Plugin Version: 1.10
Last Updated: 12-08-2014, 05:21 PM

Downloads: 3,910
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Display Name / User Nickname Plugin
If we want to display the login name in postbit/postbit_classic template (only admin can see it):

HTML Code
<if $post['loginname'] and $mybb->usergroup['cancp'] == 1 then>
<func htmlspecialchars_uni>{$post['loginname']}</func>
</if>


Is it right, Yumi? (I'm using PHP In Templates / Complex Templates plugin).


04-02-2010 10:01 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #3
RE: Display Name / User Nickname Plugin
^ Yes, that _should_ be right (haven't tested it).  Unsure if loginname is pulled by MyBB's query by default, but from memory, it is.

Updated to v1.03:
- updated control_object function again (no functional difference, but may be required to keep compatibility with my other plugins)
- fixed a potential issue during uninstallation if there's a conflict between login and display names of different users

My Blog
(This post was last modified: 04-02-2010 10:21 AM by ZiNgA BuRgA.)
04-02-2010 10:19 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: Display Name / User Nickname Plugin
Thanks, for the update, Yumi.

04-02-2010 10:36 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #5
RE: Display Name / User Nickname Plugin
Very good Plug-in

[Image: logo.png]

[Image: twitter.png]
04-26-2010 05:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
arang Offline
Junior Member
**
Posts: 4
Joined: Aug 2010
Post: #6
RE: Display Name / User Nickname Plugin
Hi
thanks for this plugin.
But i have one problem, when i try to edit user's <loginname>, it not change.
What is the reason?
08-25-2010 08:38 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #7
RE: Display Name / User Nickname Plugin
Sorry about that.  Can you see if the v1.04 update fixes this?  Thanks.

My Blog
08-26-2010 09:49 AM
Find all posts by this user Quote this message in a reply
Heishim Offline
Junior Member
**
Posts: 1
Joined: Aug 2010
Post: #8
RE: Display Name / User Nickname Plugin
Now I have problems with the register window.

The field to put the display name don't appear
08-28-2010 06:19 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #9
RE: Display Name / User Nickname Plugin
Please make sure you have this line in your member_register template, just before the {$passboxes} variable:

HTML Code
<tr>
<td><input type="text" class="textbox" name="loginname" id="loginname" style="width: 100%" value="{$loginname}" /></td><td><input type="text" class="textbox" name="username" id="username" style="width: 100%" value="{$username}" /></td>
</tr>


08-28-2010 07:18 AM
Find all posts by this user Quote this message in a reply
arang Offline
Junior Member
**
Posts: 4
Joined: Aug 2010
Post: #10
RE: Display Name / User Nickname Plugin
in the name of god

hi my firend

Can we asign other language to this plugin?

creat dispname.lang.php file and include this variable:

PHP Code:
<?php 
$l['loginname'] = 'Login Name';
$l['username'] = 'Display Username';
$l['js_validator_checking_loginname'] = 'Checking if login name is available';
?>


than opload it to inc/languages/english and translate file to inc/languages/other lng

Now, edit dispname.php and find:

PHP Code:
1
2
3
4
5
6
7
8
9
function dispname_register_langs() {
	global $lang;
	$lang->loginname = 'Login Name';
	$lang->username = 'Display Username';
	//$lang->js_validator_checking_username = 'Checking if display name is available';
	$lang->js_validator_checking_loginname = 'Checking if login name is available';
	
	$GLOBALS['loginname'] = htmlspecialchars_uni($GLOBALS['mybb']->input['loginname']);
}


and Replace it whit :

PHP Code:
1
2
3
4
5
6
function dispname_register_langs() {
    global $lang;
    $lang->load("dispname");
    
    $GLOBALS['loginname'] = htmlspecialchars_uni($GLOBALS['mybb']->input['loginname']);
}


Is it right?

If No please help me.

I have another problem too.
when Deactivate and so activate again plugin, all displayname reset to loginname.!

Can it be adjusted so that hold the changes؟

thanks

09-07-2010 08:32 PM
Find all posts by this user Quote this message in a reply


Forum Jump: