2008-10-04, 11:35 PM
2008-10-05, 12:01 AM
I know, but what do I need to download besides the Authmybb.php?
2008-10-05, 12:02 AM
MediaWiki script.
2008-10-14, 12:25 AM
Hello, sorry, I forgot to update you.
Modifying the related queries like this:
seems to solve the problem.
Modifying the related queries like this:
$query = mysql_query("SELECT username FROM {$this->table_prefix}users WHERE username='".$this->escape_string($username)."' OR username='".$this->escape_string(str_replace(' ','_',$username))."'", $this->db);
seems to solve the problem.
2008-10-14, 05:30 AM
If you look at my implementation you'll see that this fix is already present.
function fixUserName($username)
{
if(strpos($username, " ") === false)
return $username;
$db = &$this->db;
$query = $db->simple_select("users", "username", "username='$username' OR username='" . str_replace(" ", "_", $username) . "'", array('order_by' => 'regdate', 'order_dir' => 'ASC', 'limit' => 1));
$result = $db->fetch_array($query);
$user = $result['username'];
if($user)
return $user;
else
return $username;
}
2008-11-10, 06:15 AM
Thanks, flash.tato, for the new script version!
I noticed the script won't work, if a user has multiple underscores in his/her name, though - as MediaWiki seems to combine these into one. Two consecutive underscores can be fixed easily by adding the following in the function fixUserName, before $query = ...
However, a more generic (and elegant ) solution would be nice...
I noticed the script won't work, if a user has multiple underscores in his/her name, though - as MediaWiki seems to combine these into one. Two consecutive underscores can be fixed easily by adding the following in the function fixUserName, before $query = ...
$username = str_replace(" ", "__", $username);
However, a more generic (and elegant ) solution would be nice...
2008-11-11, 01:42 PM
I found a small, but serious bug from flash.tato's code
This piece of code
Should be:
So, in the beginning, the string is searched for an underscore - not space. With the current code, usernames with spaces in them don't seem to work - at least if the user has already successfully created an account for the wiki.
This piece of code
function fixUserName($username)
{
if(strpos($username, " ") === false)
...
Should be:
function fixUserName($username)
{
if(strpos($username, "_") === false)
...
So, in the beginning, the string is searched for an underscore - not space. With the current code, usernames with spaces in them don't seem to work - at least if the user has already successfully created an account for the wiki.
2008-11-15, 07:33 AM
Here's an updated version of Chris's plugin to work with the latest MediaWiki release.
You will need to configure the url to your forum in the source code of the attached file.
You will need to configure the url to your forum in the source code of the attached file.
2008-12-27, 06:22 PM
I updated the attachment in the post above with a few bug fixes
2008-12-28, 09:35 PM
thanks ryan exactly what i was searching for