MyBB Community Forums

Full Version: Username registration without spaces
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've search this problem already and the only solution was this: http://mods.mybb.com/view/strict-username but, go to the link. And you will see nothing. So do someone know an other way to make it possibile to let users only register without let them using spaces?

Thank you.
A plugin that hooks into registration is how you'd go about doing it. I'd just use this regex to remove any space if present:

$data['username'] = preg_replace("/(\s)/is", "", $data['username']);

\s matches any whitespace characters making it better than just using str_replace.
Users & Groups >> Banning >> Disallowed Usernames
(2014-05-22, 12:57 PM)marcus123 Wrote: [ -> ]Users & Groups >> Banning >> Disallowed Usernames

That won't work because you can't ban with regular expressions.
There is a plugin for this at MyBB hacks.

http://mybbhacks.zingaburga.com/showthread.php?tid=261
(2014-05-22, 01:01 PM)dragonexpert Wrote: [ -> ]That won't work because you can't ban with regular expressions.

It can work (to some extent at least) if you add * * there.

Anyways, here's the plugin you're looking for: https://github.com/lukasamd/MyBB-Strict_Username
The * * works, I will use this for now. Thank you all people of MYBB!