Connect SMF to another User Database

Started by Urkman, August 23, 2007, 09:04:25 AM

Previous topic - Next topic

Urkman

Hello,

we have an Online Game running and we want to use SMF as our Forum.

But we don't want our Users to register agin just to use the Forum.
We want them to use their Game Account to log in to SMF.

Is there a Way to do this?

Thanks for your Help,
Urkman

Tony Reid

You can integrate into SMF - yes... various methods exist.

Bridge files, API or SSI - or plain old php.
Tony Reid

Urkman

Hello,

Quote from: Tony on August 23, 2007, 09:08:42 AM
You can integrate into SMF - yes... various methods exist.

Bridge files, API or SSI - or plain old php.

where can I finfd some Documentation? I browsed the Online Docs, but couldn' tfind something...

Thanks,
Urkman

Tony Reid

What script does your online game currently use?
Tony Reid

Jim R

Urkman,

I use SMF's permissions to control who sees non-SMF pages in my site.  It looks something like this:


<?php
 
 
$allowed_groups 
= array(12914);
$can_see FALSE;
foreach (
$allowed_groups as $allowed)
{
if (in_array($allowed$user_info['groups']))
{
$can_see TRUE;
break;
}
}

//If allowed to see...show this.
if ($can_see)
{
//Just stay right here and do nothing.

}

elseif (
$can_see == FALSE && $context['user']['is_logged'])
{


//If you want to redirect the user to another place you can use the redirectexit() function.
redirectexit('http://www.hoosierhoopsreport.com/payment/subscribeSMF.php');
}
else
{
//Just redirect since they are just a guest.

    echo 
'<div id="password" style="position:absolute; left:25; top:170; width:825; height:2000; z-index:1000; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000;">
  <table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td><p><font size="3">You have reached a section of Hoosier Hoops Report.com 
          that requires a Subscription (College Network is for college coaches 
          only). If you have already subscribed enter your account information below.</font></p>
        <p><font size="3">You need to be a registered user and logged in to choose 
          your subscription. [<a href="http://hoosierhoopsreport.com/smf/index.php?action=register">Register</a>]</font></p></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>'
;
     
     ssi_login();
    
echo '</td>
    </tr>
    <tr> 
      <td><a href="http://hoosierhoopsreport.com/smf/index.php?action=reminder">Forgot 
        your password?</a></td>
    </tr>
  </table>
  <div align="center"></div>
</div>'
;


}
?>



It's basically looking for members of specific groups to allow access to pages.  I put that code in my template for that section, and every page I create is "protected".  I also added some SSI stuff to customize the look, so it says, "Hello Urkman, thanks for visiting."


Advertisement: