Nickname multiple words with spaces
QuoteNov 20, 2009 11:330 likesLike
 

First I would like to explain that on my site the nickname it going to be a business name, not a real name. My users will be logging in via their email address. Because of this I would like to use more than two names for the nickname.

 

I know that this is what you do for two names:

 


 

goto admin panel, fields builder, join form, click nickname, advanced tab - find:

preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 )

-

Replace with:

preg_match('/^[a-zA-Z0-9_-]{3,15}(| [a-zA-Z0-9_-]{3,15})$/i', $arg0)

-

Be sure everything else including the ( before the preg_match stays the same.   This will allow one or two word nicknames, with 0-9 and - _ also.

-

Change minimum value to 3 and maximum value to 31.

-

 

Next, open .htaccess in dolphin root - find:

RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L]

-

Add this line directly AFTER the above line:

RewriteRule ^([A-Za-z0-9_-]+)\ ([A-Za-z0-9_-]+)$ profile.php?ID=$1\ $2 [QSA,L]
-

That will send the double worded nicks to the profile.php for friendlyurl support (mod_rewrite).


 

However what do I need to do to change it to unlimited spaces (or at least 4)? I dont use friendly urls so the second part I am not that worried about. I think the following would work for 4 spaces, but is their a cleaner way to do it?

 

goto admin panel, fields builder, join form, click nickname, advanced tab - find:

preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 )

-

Replace with:

preg_match('/^[a-zA-Z0-9_-]{3,15}(| [a-zA-Z0-9_-]{3,15})(| [a-zA-Z0-9_-]{3,15})(| [a-zA-Z0-9_-]{3,15})/i', $arg0)

-

 

 

 

Thanks in advance,

Travis