I got myself in over my head again.
phpbb3 seems far more complicated then phpbb2.

What I need is the registration to check another table for the username.
If that username exists, continue with the registration as normal.

This is used to restrict registration to a private forum. (invite only)

In phpbb2 this was done in includes/functions_validate.php
and error message in language/lang_english/lang_main.php

Any ideas?

    19 days later

    This is what i have THUS far.
    usernames are checked in /includes/functions_user.php of phpbb3.

    This is the piece of script check if the name is open in phpbb3.

    	$sql = 'SELECT username
    		FROM ' . USERS_TABLE . "
    		WHERE username_clean = '" . $db->sql_escape($clean_username) . "'";
    	$result = $db->sql_query($sql);
    	$row = $db->sql_fetchrow($result);
    	$db->sql_freeresult($result);
    
    if ($row)
    {
    	return 'USERNAME_TAKEN';
    }
    

    I've been trying a roster check before and after with less than desirable result.

    Been trying to add this to the script, but it just goes white screen when it goes to run it.

    $sql = "SELECT name
            FROM roster_members
            WHERE LOWER(name) = '" . $db->sql_escape($clean_username) . "'";
        if ($result = $db->sql_query($sql))
        {
            if ($db->sql_numrows($result) < 1)
            {
                $db->sql_freeresult($result);
    		return 'USERNAME_TAKEN';
            }
        }
        $db->sql_freeresult($result); 
    

    Any Ideas?

      14 days later

      Well although I didn't get much input, thanks anyway.
      My need and determination, I FINALLY worked it out. lol
      I've posted the complete MOD on WoWRoster (where it belongs) if anyone else finds this post and has the same need.

        Write a Reply...