Back to vBulletin 3.0 Add-Ons

Prevent shouting in usernames.
Mod Version: 1.1, by Jolten

This modification is in the archives.
vB Version: 3.0.7 Rating: (1 vote - 5.00 average) Installs: 11
Released: 17 Mar 2005 Last Update: Never Downloads: 0
Not Supported Re-usable Code  

What's this do?
If you're like me you hate users who register with names like USERNAME. What this mini-hack does is transform all uppercase usernames upon registration to lowercase with an uppercase first letter. This "borrows" a function from the posting functions, therefore if you've got "prevent shouting" applied for posts it will also effect usernames. Preventing shouting in usernames. It will still allow all lowercase names or mixed case names to register properly.

Time to intall: less than 5 minutes
Queries: 0
Files to edit:1
Templates to edit: 0

Open register.php

find:
PHP Code:
// convert any whitespace to a single space to prevent users entering 'user    one' to look like 'user one'
    
$_POST['username'] = trim(preg_replace('#\s+#si'' '$_POST['username'])); 

BELOW it add:
PHP Code:
// prevent username shouting 
    
function fetch_no_shouting_text($text)
    {
        
// stops $text being all UPPER CASE
        
global $vboptions;
        return 
iif($vboptions['stopshouting'] AND $text == strtoupper($text), ucwords(vbstrtolower($text)), $text);
    }
    
$_POST['username'] = fetch_no_shouting_text($_POST['username']); 
Save

upload

Your done!

This does not effect users already registered. It only prevents new registrations form shouting usernames.

There shouldn't be any support needed, but if there is, I'll handle it exclusively in this thread.

Version history
-------------------------------

v1.00 //initial release

v1.1 // updated to only prevent all uppercase usernames.

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024