News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

reserved names

Started by pocttopus, December 24, 2017, 05:04:32 AM

Previous topic - Next topic

pocttopus

Hello folks,

How to disable numbers names only?
I want new registrations to include letters too, not just numbers.

Thanks!

Dzonny

Hello there,

Hows that so you can use only numbers in usernames? Normally, you can use letters.

pocttopus

I want to disable numbers only i.e. "42", "369"...
Numbers with letters are fine.

Kindred

there is no way to do this out of the box and I have never seen a mod to do so either.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

pocttopus

Quote from: Kindred on December 24, 2017, 08:48:32 AM
there is no way to do this out of the box and I have never seen a mod to do so either.
Thanks for your response and I guess that I must accept the way it is. :-[
Hope one day that there will be modification for this issue. :)

I'll mark this topic as solved.
:)

Stanyy

Hi,
You can achieve this by adding an additional condition in the RegisterCheckUsername() function.
If you are okay with modifying files, try this.

PS: I haven't tested this yet.

In Sources/Register.php

Find:

if (trim($context['checked_username']) == '')
$context['valid_username'] = false;


Add below it:

if (is_numeric(trim($context['checked_username'])))
$context['valid_username'] = false;

Arantor

Yeah, I see no reason why that wouldn't work out fine.
Holder of controversial views, all of which my own.


pocttopus

IT WORKS!!!
Thanks @Stanyy

Advertisement: