REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Want Help in Registration
#1
Hi.
I want Help with Registration Section. At my Site : http://www.xtreme-load.com User can register to forum with space in username . Like Under Takers. which i don't want. they need to Register their username without space. i dont' want to allow space in username, Can u help me out with coding. i can't take risk in coding.
Reply
#2
Try this...please test it.

PHP Code:
<?php

/*
Plugin NoSpace Username
(c) 2006 by democracyforums.com Labrocca
Website: http://www.mybbcentral.com
*/

function nospace_username_info()
{
    return array(
        
"name"            => "NoSpace Usernames",
        
"description"    => "Prevents users registering with a space in username.",
        
"website"        => "http://www.democracyforums.com",
        
"author"        => "labrocca",
        
"authorsite"    => "http://www.mybbcentral.com",
        
"version"        => "1.0",
    );
}

$plugins->add_hook("member_do_register_start""nospace_username");


function 
nospace_username_activate()
{
}

function 
nospace_username_deactivate()
{
}

function 
nospace_username()
{
    global 
$mybb$session$db;
    if(
preg_match("\s",$mybb->input['username']))
        {
            
error("Sorry, you cannot register a username with spaces");
        }
}

?>
Reply
#3
Hello labrocca,
But u didn't Tell me that it pluggin or something Else. Where I can add this code for test. thanks for your help.
Reply
#4
Save the file as nospace_username.php and upload it to /inc/plugins/ then activate in admincp.
Reply
#5
Hmm, i do the same but it's not working, i think. u didn't intialize where it check the loop for no space. can u check the code again .
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Exclamation Adding fields to registration page not working tjroughrider 3 3,022 Mar 03, 2015, 04:02 PM
Last Post: tjroughrider
  Send PM on Registration hellovivs 0 1,140 Dec 19, 2014, 06:32 AM
Last Post: hellovivs
  MyBB Registration Issue Kornox 1 1,166 May 26, 2014, 09:31 AM
Last Post: WallBB
  My MyBB registration is not working correctly. xarzu 1 1,212 Aug 26, 2013, 04:05 AM
Last Post: CharlemagneFR
  Hide thread content until registration? Raid0 0 817 May 14, 2012, 11:20 PM
Last Post: Raid0

Forum Jump:


Users browsing this thread: 1 Guest(s)