MyBB Source

everyBB - The forum owners community

4,000 Members! | Small Policy Change

Latest Releases: Valid Referrals - Bonus - Mark Thread Read

 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Force lowercase usernames at registration level
Author Message
euantor
Designer/Themer


Posts: 501
Joined: Jun 2009
Reputation: 1
MyBux: 573
Post: #1
Force lowercase usernames at registration level
There was a question posed on MyBBCentral about how you would go about forcing users to have lowercase usernames. I had a quick look at the core files and found a way of doing it that I thought I would share in case anybody else wanted it.

First of all, we're going to need to edit the member.php core file. Open it up in your favorite editor (I recommend notepad++ for a plain text eitor or Aptana Studio as an IDE).

Find:
PHP Code:
        "username" => $mybb->input['username'], 

Replace with:
PHP Code:
        "username" => strtolower($mybb->input['username']), 

This edit will change all registered usernames to be lowercase after the registration form has been submitted.

I have tested this a fair bit locally in both 1.4.13 and 1.6 BETA so all should be fine

Love to play XBox 360? Visit http://www.360elites.net for News, Reviews & Previews of the biggest up-coming and current games like Halo:Reach, Battlefield: Bad Company 2 and more. We have forums too!

Visit http://www.mypurebb.com/ to see some examples of my work with MyBB themes and web designs. I even sometimes take on custom jobs, so why not sign up to the forums so you know when I'm open and designing?
06-03-2010 05:28 AM


laeresh
Member


Posts: 124
Joined: Sep 2009
Reputation: 2
MyBux: 90
Post: #2
RE: Force lowercase usernames at registration level
So it chances to lowercase letter, even if they submitted something like DaSpamBot,(-> daspambot).
Without any message or something ?, unless you add a text line yourself.


Your port towards a mad filled community, why not join us today ? It's free and easy !
06-03-2010 05:25 PM
euantor
Designer/Themer


Posts: 501
Joined: Jun 2009
Reputation: 1
MyBux: 573
Post: #3
RE: Force lowercase usernames at registration level
Yup. That's basically what it does You could probably add some kind of notification using an if statement (like if $new = $old { } else { print "your name has been changed"; }; )

Love to play XBox 360? Visit http://www.360elites.net for News, Reviews & Previews of the biggest up-coming and current games like Halo:Reach, Battlefield: Bad Company 2 and more. We have forums too!

Visit http://www.mypurebb.com/ to see some examples of my work with MyBB themes and web designs. I even sometimes take on custom jobs, so why not sign up to the forums so you know when I'm open and designing?
06-03-2010 07:00 PM
laeresh
Member


Posts: 124
Joined: Sep 2009
Reputation: 2
MyBux: 90
Post: #4
RE: Force lowercase usernames at registration level
I don't think i'd be using this, but if i would i would add a text line above the username bar notifying that uppercase will be set to lowercase.

Once again thanks for this great share which is pure simplicity to use !.


Your port towards a mad filled community, why not join us today ? It's free and easy !
06-03-2010 08:13 PM
ProneLegacy
Junior Member


Posts: 21
Joined: Jun 2010
Reputation: 0
MyBux: 22
Post: #5
RE: Force lowercase usernames at registration level
I am thinking about this for my forum, But I am not sure weather it will cause people to leave :S
06-07-2010 12:05 AM
ms365
MybbSource Skinner


Posts: 62
Joined: Dec 2009
Reputation: 0
MyBux: 72
Post: #6
RE: Force lowercase usernames at registration level
Yah some usernames are really Messy(Not that Argentina One ).Is there something which will forbid users to enter symbols and special chars?
(This post was last modified: 06-08-2010 05:02 AM by ms365.)
06-08-2010 04:57 AM
euantor
Designer/Themer


Posts: 501
Joined: Jun 2009
Reputation: 1
MyBux: 573
Post: #7
RE: Force lowercase usernames at registration level
I'm sure there would be a way by preg_replacing the symbols and special chars, but I can't really think of one atm. I'll have a play with it.

Love to play XBox 360? Visit http://www.360elites.net for News, Reviews & Previews of the biggest up-coming and current games like Halo:Reach, Battlefield: Bad Company 2 and more. We have forums too!

Visit http://www.mypurebb.com/ to see some examples of my work with MyBB themes and web designs. I even sometimes take on custom jobs, so why not sign up to the forums so you know when I'm open and designing?
06-08-2010 05:30 AM
 





Web Design | Web Design Jobs