Hi everyone
I have an issue that i have seen talked about in the forums but have not come up with a suitable solution.
I have a user on my site who has joined with the username being numbers only. Eg. 1234
The user shows up in the all members display function of the site and also you can find them displayed in search results by this username.
However when you click on the said profile it shows a message stating this profile is unavailable for view.
I wish to either fix the issue or do something to prevent users from creating usernames with only numbers.
I have used the Fileds builder to enter a message for the join form when a user mouses over the help feature, but this does not prevent the user from using numbers only.
Has anyone come up with a solution to this. Ideally a fix so that users can create their username with just numbers (or is this frowned upon for some reason)
Thanks
Jeff
clubbeyourself |
AFAIK, it is an ongoing bug/problem with no solution so far .....
Reference: Block Certain Nicknames Bug: Numbers only profile ID . |
yeah its pretty easy just use the check feature and paste this in:
return !strstr($arg0,"12345") and !strstr($arg0,"11111");
above stops only 12345 and 1111 _and !strstr($arg0,"11111")<<to addmore "_" denotes a space
in Check error message: put you cannot use all numbers
now users that enter 12345 you can really blast them!!! hahahaha make a 250 word message that says why are so lazy? Come to my site and deface with these crazy usernames.
Good job keeping these connected bumpy!
I have video tutorials to help you mrpowless.com |
Thanks MrPowless and RumpyBumpy, Will look into it all.
Cheers
jeff
clubbeyourself |
Mr Powless
I have entered what you said and it won't let people past the join page now but it is not saying what the error is, I have just tried to join a fake user to test and it would normally bring up highlighted section to correct these errors, but it isn't...
Any ideas
clubbeyourself |
Please make sure your error message is inserted. My posts assume you know basic functionality lol
Ok why is there no error message like the rest? well lets look at one that does it. How is it setup. Copy structure from working to another.
In this case what uses check ..find one, nickname.
I have video tutorials to help you mrpowless.com |
I must be missing something out as there is messages in there about what to put etc... So um.. clubbeyourself |
please provide a screen shot. |
Admin > settings > Builders > Fields Builder> DateOfBirth > Advanced > Check: add code: return !strstr($arg0,"12345") and !strstr($arg0,"11111"); _and !strstr($arg0,"11111")
Admin > settings > Builders > Fields Builder> DateOfBirth > Advanced > Check error message: add whatever you want to say if they enter all numbers: you cannot use all numbers or don't use all numbers dummy or whatever ..... .
|
i fixed it for him..he added all text even<< lol
my mistake sorry i should have split it up
I have video tutorials to help you mrpowless.com |
If you really want to just check if the username is all numbers do a regex for any alpha character, a-z A-Z, if that comes back false - well, it's all numbers... or at least no a-z.
Simple really... don't know why that seems so hard.
Chris
www.convictionscommunity.com
|
Okay, for all wanting a fix to this - it's simple - for ALL versions of dolphin, open profiles.inc.php in your /inc directory - goto approx. line 260 find the function conf_nick($nick, $ID = 0 ) - find:
if (file_exists($dir['root'].$nick)) { return FALSE; }
Change to:
if (file_exists($dir['root'].$nick) || is_numeric($nick)) { return FALSE; }
This will stop all registrations with only numbers - it will never clear the check.
As always, simple and sweet - php is the instrument, I'm the artist :)
Chris
www.convictionscommunity.com
|
I am using Dolphin 6.1.4 and this is the code I have:
function conf_nick($nick, $ID = 0 ) { global $exist_arr;
if (file_exists(BX_DIRECTORY_PATH_ROOT.$nick)) { return FALSE; }
Can I use your code here like this:
function conf_nick($nick, $ID = 0 ) { global $exist_arr;
if (file_exists(BX_DIRECTORY_PATH_ROOT.$nick)) || is_numeric($nick)) { return FALSE; }
Many thanks,
Stuart
Okay, for all wanting a fix to this - it's simple - for ALL versions of dolphin, open profiles.inc.php in your /inc directory - goto approx. line 260 find the function conf_nick($nick, $ID = 0 ) - find:
if (file_exists($dir['root'].$nick)) { return FALSE; }
Change to:
if (file_exists($dir['root'].$nick) || is_numeric($nick)) { return FALSE; }
This will stop all registrations with only numbers - it will never clear the check.
As always, simple and sweet - php is the instrument, I'm the artist :)
Chris
www.convictionscommunity.com
There are none so blind as those that will not see. |
if (file_exists(BX_DIRECTORY_PATH_ROOT.$nick) || is_numeric($nick))
You had one too many ')' 's - but yes! :)
|
There are none so blind as those that will not see. |
if (file_exists(BX_DIRECTORY_PATH_ROOT.$nick) || is_numeric($nick))
You had one too many ')' 's - but yes! :)
Ok, sorted!!
There are none so blind as those that will not see. |
WOW! Boonex made a mistake!! Yes, my code will not work - they forgot to check for it in the fields builder.
One second - fix coming!
|
Okay - goto admin panel, field builder, click NickName, advanced - replace this:
return ( preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );
with
return ( preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 ) && conf_nick($arg0) );
That should fix everything - including my quick bad nickname filter I wrote under that other post.
EVERYONE needs to change this....
|
Okay - goto admin panel, field builder, click NickName, advanced - replace this:
return ( preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );
with
return ( preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 ) && conf_nick($arg0) );
That should fix everything - including my quick bad nickname filter I wrote under that other post.
EVERYONE needs to change this....
Well it appears to be working now!!
Many thanks.
Stuart
There are none so blind as those that will not see. |