Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Prevent shouting in usernames. Details »»
Prevent shouting in usernames.
Version: 1.1, by Jolten Jolten is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-16-2005 Last Update: Never Installs: 11
Re-useable Code  
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-17-2005, 06:02 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you don't need the ucwords function and the strtolower, ucwords should if i read correctly convert all but the first letter to lower, or make all but the first letter to lower.

also by installing this hack you make sure that every username starts with an Upper and the rest are Lower, that could be annoying for a user like me who has his whole username lower by choice.

what would be nice is if you could check if it was shouting then only convert the shouted usernames to lowercase.

oh well bar that, nice addition, it's always nice to see something new being released.
Reply With Quote
  #3  
Old 03-17-2005, 06:13 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ucwords will not convert characters internally to lowercase so usernames would still appear as UsERnaMe. Therefor the strtolower is necessary.

I realize some users prefer an all lowercase username. That may be an addition to this hack. But right now, this prevents most odd case usernames.
Reply With Quote
  #4  
Old 03-17-2005, 07:03 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay.. I've updated the hack. It will now only prevent all uppercase names if you have your vbOptions set to prevent shouting.
Reply With Quote
  #5  
Old 03-18-2005, 07:57 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jolten
ucwords will not convert characters internally to lowercase so usernames would still appear as UsERnaMe. Therefor the strtolower is necessary.

I realize some users prefer an all lowercase username. That may be an addition to this hack. But right now, this prevents most odd case usernames.
my bad

good luck with it
Reply With Quote
  #6  
Old 03-18-2005, 11:43 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

gee. I guess no one wanted this at all
Reply With Quote
  #7  
Old 03-20-2005, 05:25 PM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
 
Join Date: Aug 2004
Location: Arizona, USA
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That seemed to work great. Thank You!
Reply With Quote
  #8  
Old 04-22-2005, 04:07 AM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed! Thanks!
Reply With Quote
  #9  
Old 04-22-2005, 05:10 PM
PIKenPIK PIKenPIK is offline
 
Join Date: Feb 2005
Location: Netherlands
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks ... gettin' a Hangover from those members :tired:

** Clicks Install **
Reply With Quote
  #10  
Old 05-12-2005, 11:38 PM
Jenta Jenta is offline
 
Join Date: Dec 2004
Posts: 377
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you know what i would like
make them go back and edit it...return an error

make them mend their riduculous names themselves
jeez i cant stand people that shout with their names
i even have it in big bold letters...do not use all caps!
but they still do

heh, found it
https://vborg.vbsupport.ru/showthrea...=495219#495219 :up:
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08112 seconds
  • Memory Usage 2,294KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete