vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Username Registration (A-Z, 0-9 Characters Only) (https://vborg.vbsupport.ru/showthread.php?t=92309)

altsounds 09-19-2005 02:21 AM

How can I use this to allow a-z A-z 0-9 and spaces?? In other words what would I need to do to get this existing hack to work but still allow spaces in usernames??

untold4you 09-19-2005 04:28 AM

Quote:

Originally Posted by altsounds
How can I use this to allow a-z A-z 0-9 and spaces?? In other words what would I need to do to get this existing hack to work but still allow spaces in usernames??

PHP Code:

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

Like you asked, how to allow spaces? Just put a space in the regex :)

altsounds 09-19-2005 04:44 AM

Thanks will try this tommorow :D

altsounds 09-21-2005 08:07 PM

Added this today and it works a treat!! Thanks untold4you.

akanevsky 10-10-2005 08:15 PM

Nice hack bro, but could you please make a vBulletin option that would allow board administrator to specify a custom allowed letter range (so that besides English, another language or languages would be allowed)? Thanks :)

untold4you 10-10-2005 09:09 PM

Quote:

Originally Posted by Dark Visor
Nice hack bro, but could you please make a vBulletin option that would allow board administrator to specify a custom allowed letter range (so that besides English, another language or languages would be allowed)? Thanks :)

Will look into that m8, however 3.5.0 version it will be.

Gr3?Tz...

akanevsky 10-10-2005 09:19 PM

Quote:

however 3.5.0 version it will be
It's all good, because I plan to upgrade each my board shortly... And why would I want any more hack for 3.0.x, if 3.5.0 is much better? :P

untold4you 10-10-2005 09:28 PM

Quote:

Originally Posted by Dark Visor
a vBulletin option that would allow board administrator to specify a custom allowed letter range (so that besides English, another language or languages would be allowed)

Hmm let me think, i could make a field in the options where you can enter your own regex? Would that do the job ? Because i'm not a regex freak :disappointed:

akanevsky 10-10-2005 09:36 PM

Yes, and all you have to do is replace
Code:

if (!eregi("^[A-Za-z0-9]+$", $_POST['username']))
With
Code:

if (!eregi("^[A-Za-z" . $vboptions['mycustomoption'] . "0-9]+$", $_POST['username']))
That way when the option is filled by the admin, it will automatically be inserted into your regex :)
Also, a shorter form of "A-Za-z" in a regex would be a simple "A-z" :)

eljeffe 12-11-2005 03:28 PM

Quote:

Originally Posted by untold4you
PHP Code:

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

Like you asked, how to allow spaces? Just put a space in the regex :)

Is there a way to modify this to accept dash and underscore as valid characters?


All times are GMT. The time now is 07:53 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.01105 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete