Back to vBulletin 3.0 Add-Ons

Username Registration (A-Z, 0-9 Characters Only)
Mod Version: 1.00, by untold4you

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 10
Released: 16 Jul 2005 Last Update: Never Downloads: 2
Not Supported DB Changes Code Changes  

In Reply to this thread: index.php?t=92308

Only accept usernames with no special characters or spaces.

Database query:

Open up PhpMyAdmin, goto to your vbulletin database, run following query:
Code:
INSERT INTO setting ( varname , grouptitle , value , defaultvalue , optioncode , displayorder , advanced , volatile )
VALUES (
'az09characters', 'register', '1', '1', 'yesno', '101', '0', '1'
)
Phrases To Add:

Code:
Phrase Type: Front-End Error Messages
Varname:     az09charactersonly
Text:        Only  characters A-Z, 0-9 may be used in usernames, no spaces, no special ascii-type letters.
Phrase Type: vBulletin Settings
Varname:     setting_az09characters_title
Text:	     Disallow Special Characters
Phrase type: vBulletin Settings
Varname:     setting_az09characters_desc
Text:        Setting this to "yes" prevents users from using special characters or spaces in there user name.

File Modifications:

Open:

[forumroot]/register.php

Find:

PHP Code:
    // check username does not contain semi-colons
    
if (preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/'$_POST['username']))
    {
        
//eval(print_standard_error('error_username_semicolon'));
        
eval('$errors[10] = "' fetch_phrase('username_semicolon'PHRASETYPEID_ERROR) . '";');
    } 
Above that add:

PHP Code:
    // Only A-Z, 0-9 Characters Only */
    
if ($vboptions['az09characters'])
    {
        if (!
eregi("^[A-Za-z0-9]+$"$_POST['username']))
        {
            eval(
print_standard_error('error_az09charactersonly'));
        }    
    } 
Save:

register.php

Now users can not use special chars or spaces in their username when signing up.

To disable the function goto, Admin CP > vBulletin Options > User Registration Options.
Find the yes/no option under “Disallow Special Characters “

That's all, Gr3³Tz Untold....

Download

No files for download.

Supporters / CoAuthors

  • untold4you

vblts.ru supports vBulletin®, 2022-2024