Hi there,
Due to a forum need and with the user simplicity in mind i wrote i little code that
will insert the same username and password and other user informations in PAS and SMF forum
in the same time. This is let's say BETA ( i've tried it on my server and worked ).
Requirements:
PAS and SMF must use the same database ( but with different table prefixes ) and the same database username and password ( all this is to simplify the script ).
download the attached files ( signup.php and register.php ) - with these file an user can create his account on PAS and SMF in the same time ( with the same user and password ).
I recommend the use of this script on new installations so that the users id in the databases will be the same for PAS and SMF.
note: to ensure that no users is slicker and registers only on forums it is recommended that you disable the user registration in SMF

note: put the files in the root directory of PAS ( SMF doesn't matter where is installed, mine was in PAS root directory under /forum/ )
note: i changed a little the way PAS works on user login -
initial user login in PAS is done by email and password but for more simplicity for users
i changed that by a standard user / password login:
so here are the changes in userhome.php:
- around 224 line there is
$bOK = EmailValid( $sLogin ) && PasswordValid( $sPassword );
-change it to
$bOK = NameValid( $sLogin ) && PasswordValid( $sPassword );
- around 230 line there is
$res = $db->super_query( "SELECT * FROM ".$cMain['dbPrefix']."users WHERE email=\"$sLogin\" AND password=\"".md5($sPassword)."\" LIMIT 1" );
-change it to
$res = $db->super_query( "SELECT * FROM ".$cMain['dbPrefix']."users WHERE username=\"$sLogin\" AND password=\"".md5($sPassword)."\" LIMIT 1" );
changed a little the toys theme to make register account to point to our new files

-navigate to templates/Toys and open user_login.html and on line 14 replace
<p>Don't have an account yet? Create one <a href="!SITEROOT!user/register/">
with
<p>Don't have an account yet? Create one <a href="!SITEROOT!signup.php">
note: if you use the MY FAVOURITES block also you need to change the link there.
you can do it by opening block_needaccount.html an on line 5 replace:
<p>Don't have an account yet? <a href="!SITEROOT!user/register/">
with
<p>Don't have an account yet? <a href="!SITEROOT!signup.php">
to add a someway to go back to main PAS page and start playing again i changed the SMF theme to include the link in the header part ( in the login / welcome ) part
so ... in SMF directory ( in my case is /forum/ ) go to Themes/default/Languages and open index.english.php and on line 155 replace:
$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
with
$txt['welcome_guest'] = 'Welcome, <b>' . $txt[28] . '</b>. Please <a href="' . $scripturl . '?action=login">login</a> / <a href="' . $scripturl . '?action=register">register</a> or go <a href="../">play</a>.';
in this way when a guest user hits the forum page it will see a the go play link

now go one level upper ( /forum/Themes/default ) and open index.template.php and on line 236 change:
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
with
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
and add a new line under the above line:
<a href="../">Go back to play</a></br />';
in this way when a registered user hits the forum page it will have the option to go back to games

note: this changes must be applied to every theme that you use for SMF.
LATER EDIT:
- version 0.2b uploaded -
added a nice interface based on PAS Toys theme
added a lot of username / password / email checkings
added a redirect for a successful signup
added no-cache to signup page