Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Two word usernames

Voronwe
2008-11-24
2012-09-14
  • Voronwe
    Voronwe
    2008-11-24

    Hi all, I've been happily using a heavily tinkered-with version of phpMyChat that is successfully integrated with a phpBB2 forum database so our community members don't have to register more than once to use both programs.

    The only downside to this is that phpbb2 allows usernames with more than one word ('Firstname Lastname'), while phpmychat has no support for this, so commands such as /whois or /msg do not work for these people.

    Would anyone know how to change the code to fix this? Or would it not be a simple change? I don't think the minimal amount of PHP knowledge I have is good enough.

    For convenience, here is the code for the /msg command as it stands:

    elseif (eregi("^\/(msg|to)[[:space:]]([^[:space:]]{1,30})[[:space:]](.+)$", $M, $Cmd))
    {
    include("./lib/commands/priv_msg.cmd.php3");
    }

    // Check for invalid characters in the addressee name
    if (ereg("[\, ]", stripslashes($Cmd[2])))
    {
    $Error = L_ERR_USR_16;
    }
    elseif (trim($Cmd[2]) != "" && trim($Cmd[3]) != "")
    {
    // Check for swear words in the message if necessary
    if (C_NO_SWEAR == 1)
    {
    include("./lib/swearing.lib.php3");
    $Cmd[3] = checkwords($Cmd[3], false);
    }
    AddMessage(stripslashes($Cmd[3]), $T, $R, $U, $C, $Cmd[2]);
    $IsCommand = true;
    $RefreshMessages = true;
    }

    Huge thanks to anyone who can help me figure out how to fix this!