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,911
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #11
RE: Display Name / User Nickname Plugin
Not entirely, do a search for $lang-> in the file and whenever it's an assignment, like the following:

Code:
$lang->something = 'some text';

you can replace it.
Sorry for not really making translation easy here.


(09-07-2010 08:32 PM)arang Wrote:  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؟
This plugin doesn't have separate uninstall and deactivate routines, so everything is bundled into deactivate.  So unfortunately not, since there needs to be a routine which removes all modifications.
I assume you want some way to retain display names but don't show them when deactivated?  Unfortunately, due to the nature of how this plugin is designed, that is difficult to do.

You can manually retain display names yourself without too much trouble however (create new column in users table and copy values over), however, restoring them is more difficult.

My Blog
09-07-2010 09:17 PM
Find all posts by this user Quote this message in a reply
arang Offline
Junior Member
**
Posts: 4
Joined: Aug 2010
Post: #12
RE: Display Name / User Nickname Plugin
Yipi multilanguage by me for multilanguage forum.

add persian lng in it.
you can translate it to other lng.


Attached File(s)
.zip  dispname-104-multilang.zip (Size: 6.08 KB / Downloads: 729)
(This post was last modified: 09-07-2010 10:06 PM by arang.)
09-07-2010 10:01 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #13
RE: Display Name / User Nickname Plugin
Thanks - I had a very quick look, but you missed this one:

PHP Code:
		$lang->userdata_bad_characters_loginname = 'The login name you entered contains bad characters. Please enter a different login name.';
		$lang->userdata_loginname_exists = 'The login name you entered already exists. Please enter a different login name.';


This one's tricky - it's used to edit the email message that gets sent out...

PHP Code:
			$lang->email_activateaccount = str_replace('Username: {1}', 'Username: '.$loginname, $lang->email_activateaccount);


My Blog
(This post was last modified: 09-08-2010 06:18 PM by ZiNgA BuRgA.)
09-08-2010 06:17 PM
Find all posts by this user Quote this message in a reply
arang Offline
Junior Member
**
Posts: 4
Joined: Aug 2010
Post: #14
RE: Display Name / User Nickname Plugin
(09-08-2010 06:17 PM)ZiNgA BuRgA Wrote:  Thanks - I had a very quick look, but you missed this one:

PHP Code:
		$lang->userdata_bad_characters_loginname = 'The login name you entered contains bad characters. Please enter a different login name.';
		$lang->userdata_loginname_exists = 'The login name you entered already exists. Please enter a different login name.';


Ok. Replace attachment file with Previous

Quote:This one's tricky - it's used to edit the email message that gets sent out...

PHP Code:
			$lang->email_activateaccount = str_replace('Username: {1}', 'Username: '.$loginname, $lang->email_activateaccount);



But I do not know this.


Attached File(s)
.php  dispname.php (Size: 14.4 KB / Downloads: 708)
09-09-2010 05:26 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #15
RE: Display Name / User Nickname Plugin
(09-09-2010 05:26 PM)arang Wrote:  But I do not know this.
If you take a look in inc/languages/english/messages.lang.php, you'll see this:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$l['email_activateaccount'] = "{1},

To complete the registration process on {2}, you will need to go to the URL below in your web browser.

{3}/member.php?action=activate&uid={4}&code={5}

If the above link does not work correctly, go to

{3}/member.php?action=activate

You will need to enter the following:
Username: {1}
Activation Code: {5}

Thank you,
{2} Staff";

Basically the code replaces the Username: {1} text.
Perhaps you could set a language variable with the text to replace
eg:

PHP Code:
$l['email_activateaccount_username_replace'] = 'Username: {1}';

PHP Code:
			$lang->email_activateaccount = str_replace($lang->email_activateaccount_username_replace, $lang->sprintf($lang->email_activateaccount_username_replace, $loginname), $lang->email_activateaccount);

Hope that helps.


My Blog
09-09-2010 07:05 PM
Find all posts by this user Quote this message in a reply
CyberHackers.org Offline
Junior Member
**
Posts: 1
Joined: Oct 2010
Post: #16
RE: Display Name / User Nickname Plugin
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1060 - Duplicate column name 'loginname'
Query:
    ALTER TABLE `mybb_users` ADD COLUMN `loginname` varchar(120) NOT NULL default ""
10-13-2010 05:57 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #17
RE: Display Name / User Nickname Plugin
Try dropping the column.

My Blog
10-13-2010 06:14 PM
Find all posts by this user Quote this message in a reply
gloss Offline
Junior Member
**
Posts: 3
Joined: Dec 2010
Post: #18
RE: Display Name / User Nickname Plugin
one the plugin is uploaded where do we go about to change the display name? because it seems to be not working for me.
12-05-2010 09:21 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #19
RE: Display Name / User Nickname Plugin
(12-05-2010 09:21 PM)gloss Wrote:  one the plugin is uploaded where do we go about to change the display name? because it seems to be not working for me.
In the first post, already said:
(03-13-2010 10:52 PM)ZiNgA BuRgA Wrote:  "username" often refers to the user's display name
Thus, to allow users to change their display name, simply give them their usergroup the ability to change username.

12-06-2010 01:31 AM
Find all posts by this user Quote this message in a reply
gloss Offline
Junior Member
**
Posts: 3
Joined: Dec 2010
Post: #20
RE: Display Name / User Nickname Plugin
hmm, well it won't work for me. the plugin is installed an activated, i just have no clue why it's not working.
12-06-2010 09:46 AM
Find all posts by this user Quote this message in a reply


Forum Jump: