PART 1
Please note, I'm not a programmer and I'm writing this as I go along. I may make mistakes along the way. Feel free to point them out as we go.
My answer assumes that you have been following the instructions for single sign on posted at http://www.question2answer.org/single-sign-on.php and that you are now editing qa-external-users.php
In qa-external-users.php you will need to make a few edits, but first I need to look at our Joomla table (I used phpmyadmin to do this).
Joomla user information is stored in abs_users table (note that the prefix abs will likely be different in each Joomla website.)
You can see that the user is identified using id of type int(11). This information is important, because we need to add it to our qa-external-users.php file. Specifically you will need to edit function qa_get_mysql_user_column_type() on line 57.
Change return null; to //return null;
Next delete lines 67-73
/*
Example 2 - suitable if:
* You use unsigned numerical user identifiers in an INT UNSIGNED column
return 'INT UNSIGNED';
*/
and in their place put
return 'INT';
Next go to your website and get the address for the login, the address for the registration page and the address for the logout page.
Once you have done that you need to comment out lines 105-109
/* return array(
'login' => null,
'register' => null,
'logout' => null
); */
Then on line 111 add
return array(
'login' => 'http://www.mysite.com/login',
'register' => 'http://www.mysite.com/register',
'logout' => 'http://www.mysite.com/logout',
);
Remember to substitute your login, registration and logout addresses for the ones above.
The next part we need to edit is the function qa_get_logged_in_user()
Unfortunately this is where it gets a bit harder.
If you read the example listed in qa-external-users.php example 2 best matches Joomla's situation. Unfortunately, when a user logs into Joomla, Joomla creates a cookie with a random cookie name. The Joomla session cookie contains only alphanumeric characters (0-9 and a-f) and is 32 characters long, e.g. a8a70d9559bc6548b1b2aed88c45753b.
The cookie name is important because if we don't know the visitors cookie name we can't look up the user's logged in status from the database (at least-not in a straight forward way). Visitor session data is stored in abs_session in the database.
So, I'm kind of stuck here. Since I don't know ahead of time what the cookie name will be, I guess I need to look at each cookie to see if its name is 32 characters long and is composed only of alphanumberic characters. If it fits that description it is a good guess that it is the joomla cookie.
There is an alternative way. That way would require including the Joomla framework into Q2A. The problem with this is that Joomla uses its own session management so I think it would cause problems with Q2A's sessions. I'm not sure though. I will continue this in PART 2.