The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Spacing
How would you make it so a username can have more than 1 space in their username?
At the moment you can only have one space in your name. |
#2
|
|||
|
|||
Would need to do a file edit:
Code:
/** * Verifies that the provided username is valid, and attempts to correct it if it is not valid * * @param string Username * * @return boolean Returns true if the username is valid, or has been corrected to be valid */ function verify_username(&$username) { // fix extra whitespace and invisible ascii stuff $username = trim(preg_replace('#[ \r\n\t]+#si', ' ', strip_blank_ascii($username, ' '))); |
#3
|
|||
|
|||
Which file would that be done in?
|
#4
|
|||
|
|||
File class_dm_user.php and maybe elsewhere, you'd need to check to be sure.
|
#5
|
|||
|
|||
Anyone know what I would specifically have to do?
--------------- Added [DATE]1292642489[/DATE] at [TIME]1292642489[/TIME] --------------- bump |
#6
|
|||
|
|||
You could try taking the space out of the pattern that condenses white space, like this:
Code:
// fix extra whitespace and invisible ascii stuff $username = trim(preg_replace('#[\r\n\t]+#si', ' ', strip_blank_ascii($username, ' '))); (the red is where I took out the space) But I haven't tried it, and I don't know if that's all you would have to do. |
#7
|
|||
|
|||
Im assuming some knowledge of regex patterns would be useful here?
|
#8
|
|||
|
|||
Quote:
Code:
preg_replace('#[ \r\n\t]+#si', ' ', ... |
#9
|
|||
|
|||
Quote:
Actually, when you edit it in the admin cp, the name has 2 spaces, but it only shows one space publicly on the current users, or users visited in 24 hours, so I'm guessing something else would have to be modified as well. |
#10
|
|||
|
|||
I wonder if that's just HTML - normally multiple spaces get condensed to one. I'm not sure how to fix that easily. You could find everywhere a user name is being displayed and change spaces to , but that seems like a lot of places.
There's a function called fetch_musername() in includes/functions that gets the "marked up" user name, so if you changed that it would probably handle most places, but I know there are some places where it's just the bare user name. In retrospect, the single-space thing is probably a good thing because having people with the same user name other than spacing could get confusing (but I'm sure you have your reasons for wanting to allow it). |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|