Registration through a different site to integrate with forum

Started by chrisgwood, March 14, 2006, 06:57:55 PM

Previous topic - Next topic

chrisgwood

Basically, I want a user to register with my site, and when logging in (as I understand it utilising SSI.php and redirects) they then gain access not just to my site but also the forum within my site.

In effect I just need to register users with my site but still have access to the forum.

I have done a few searches and nothing seems to pick up on the registration process away from the forum but still gain access to it, unless I'm missing something (which is to say likely).

I've tried various forum software setups and none are easy however this one does seem to be the closest I have come (and it has an excellent setup and features).

Any help is greatly received.

Chris G Wood
--
Tired, expecting a new baby and moving house.
That thing that's behind the thing, don't touch that, press the other thingy.

Dannii

When you say "I want a user to register with my site", what does that mean? Your own custom registration code?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

chrisgwood

Quote from: eldacar on March 14, 2006, 07:38:13 PM
When you say "I want a user to register with my site", what does that mean? Your own custom registration code?
Not exactly sure what you mean, the registration needs to be shared, ie they register with my site and the same details are inserted into the database for the forum (or the other way around) either way it saves having to register twice, and the registration 'look' is of my site rather than the forum site.

May need to clarify, the forum is on the same site, not a different URL, just that the forum won't be accessible until you register.
That thing that's behind the thing, don't touch that, press the other thingy.

Dannii

What is this other registration? Something you yourself wrote? A portal/CMS registration? A gallery?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

chrisgwood

Quote from: eldacar on March 14, 2006, 07:47:05 PM
What is this other registration? Something you yourself wrote? A portal/CMS registration? A gallery?

not really, in effect I have a web site that requires registration to gain access to certain items.
One of the items on the site I'd like a forum that only registered users can access.
Rather than have them register for the site, then register for the forum I'd like it integrated, but I don't want to have the users register with the forum registration process to gain access.

The site has blogs, articles etc as well as the forum.

Update: yes I've currently got my own registration, but this can be put aside if there is an easier solution, alternaitevely I could update the forum sql myself with the script (which is what i've attempted with other forum software)

Does that make it more clear, it's maybe a difficult thing to explain.

PS Thanks for the interest.
That thing that's behind the thing, don't touch that, press the other thingy.

Dannii

What exactly is the existing registration process? A name please.

And what information does it store? It might be better to use the SMF members table if it is more complex. Also SMF's passwords are probably hashed more securely.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

chrisgwood

Quote from: eldacar on March 14, 2006, 07:56:54 PM
What exactly is the existing registration process? A name please.

And what information does it store? It might be better to use the SMF members table if it is more complex. Also SMF's passwords are probably hashed more securely.

Sorry updated, whilst you replied.

I wrote it myself, it's a work in progress, no doubt the SMF's passwords are hashed more securley, i'd be happy to use them if I can tailor the page to look like my site (don't ask for the site url, it's not finished, and not in a working state atm).

Basically, I want to register a user but have the site look like my own but still, when clicking on a 'forum' link not have them log in again after they have logged in.
That thing that's behind the thing, don't touch that, press the other thingy.

Dannii

Well probably the simplest way is to have them register in SMF, and then use SSI.php or smf_api to give them access to the other sections of your website. If there are parts of your registration that aren't in SMF, then you can add extra columns to SMF's member table.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

chrisgwood

Quote from: eldacar on March 14, 2006, 08:03:34 PM
Well probably the simplest way is to have them register in SMF, and then use SSI.php or smf_api to give them access to the other sections of your website. If there are parts of your registration that aren't in SMF, then you can add extra columns to SMF's member table.

That would be the best solution, but ultimately SMF will be a small part of the site, so registering with it would make the user think it's just a forum site, which it is not, hence wanting to have an external registration process that can integrate with SMF.

It's a problem i've found with all forum software, they want to control the registration process, which is fine, but in my case it is not really an option (due to subscriptions etc).

Before you say anything, the site is not up and running, i'm just looking for the best software solution before parting with cash!
That thing that's behind the thing, don't touch that, press the other thingy.

Dannii

Well, then you could copy the SMF registration functions to your own code and your own templates.
SSI.php doesn't have registrations, but smf_api might. Have a look at it.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

chrisgwood

Quote from: eldacar on March 14, 2006, 08:13:04 PM
Well, then you could copy the SMF registration functions to your own code and your own templates.
SSI.php doesn't have registrations, but smf_api might. Have a look at it.

Err, excuse me if I'm being stupid but isn't the smf_api a different databse, can't find any files around it (albeit I am new to this forum and havn't gone through all the files as yet).
That thing that's behind the thing, don't touch that, press the other thingy.

Dannii

"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

chrisgwood

That thing that's behind the thing, don't touch that, press the other thingy.

chrisgwood

I've added some functionality to my site to register without using the forum registration process, it's very rough and ready, but it does work, I intend to make it more efficient etc but for now it's just a work in progress to make sure that 1. it's possible, and 2. that it works, and so far so good.

There are a few more additions to the mysql members database I have made for my own use, this includes them (ie address, telephone).

FIRST
Each page needs:
<?php require("forum/SSI.php"); ?>

at the top of it as the first thing, putting the direct path to SSI.php is required (ie it is unlikley to be as above).

SECOND
When you want a login forum put in
<?  ssi_login( "../the_redirect.php" );?>

This will insert the login form on the page, and when clicked re-direct you to 'the_redict.php' (obviously you'll need to change this to what you want).

THIRD
Entering the following will put a 'Logout' Link in your code:
ssi_logout("../goodbye.php");

Again changing the 'goodbye.php' will redirect it to the signoff page.

FORTH
(this is a big one)
I use the following for my form (where the form can post to another file, or you can handle it all in the same file if your proficient, i've not gone into detail about that here, but I could).
-----------------
<form name="registration" method="post" action="/registration.php">
            <table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="350" align="left" valign="top"><table width="223" border="0">
        <tr>
          <td> <p>Username: 
              <input name="memberName" type="text" id="memberName" size="40" value="<? echo $memberName; ?>">
            </p></td>
        </tr>
      </table>
      <table width="223" border="0">
        <tr>
          <td><p>Password:
              <input name="passwd" type="password" id="passwd" size="40" value="<? echo $passwd; ?>" />
          </p></td>
        </tr>
      </table>
      <table width="223" border="0">
        <tr>
          <td><p>Verify Password:
              <input name="password2" type="password" id="password2" size="40" value="<? echo $password2; ?>" />
          </p></td>
        </tr>
      </table>
      <table width="223" border="0">
        <tr>
          <td> <p>Real Name: 
              <input name="realName" type="text" id="realName" size="40" value="<? echo $realName; ?>">
            </p></td>
        </tr>
      </table>
            <table width="223" border="0">
              <tr>
                <td><p>Email:
                  <input name="emailAddress" type="text" id="emailAddress" size="40" value="<? echo $emailAddress; ?>" />
                </p></td>
              </tr>
            </table>
            <table width="223" border="0">
               <tr>
                  <td> <p> Address1:
                        <input name="address1" type="text" id="address1"  size="40" value="<? echo $address1; ?>">
                     </p></td>
               </tr>
               <tr>
                  <td>Address2:
                     <input name="address2" type="text" id="address2"  size="40" value="<? echo $address2; ?>"> </td>
               </tr>
            </table>
      </td>
    <td align="left" valign="top"><table width="223" border="0">
      <tr>
        <td><p>Town:
          <input name="town" type="text" id="town" size="40" value="<? echo $town; ?>" />
        </p></td>
      </tr>
    </table>
      <table width="223" border="0">
              <tr>
                <td><p>Country:
                  <input name="country" type="text" id="country" size="40" value="<? echo $country; ?>" />
                </p></td>
              </tr>
            </table>
            <table width="223" border="0">
              <tr>
                <td><p>Postcode:
                  <input name="postcode" type="text" id="postcode" size="40" value="<? echo $postcode; ?>" />
                </p></td>
              </tr>
            </table>
            <table width="246" border="0">
              <tr>
                <td width="240" height="16" align="left" valign="top"> Phone:
                  <table width="223" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="45"><input name="telephone" type="text" id="telephone" size="40" value="<? echo $telephone; ?>" /></td>
                      </tr>
                  </table></td>
              </tr>
            </table>
            <table width="223" border="0">
        <tr>
          <td width="203"> <p> Amount:
                        &pound;9.99
            </p></td>
        </tr>
      </table>
        <table width="252" border="0">
          <tr>
            <td width="124">
         <input name="the_action" type="hidden" value="check" />
         <input type="submit" name="submit"></td>
            <td width="118"><input type="reset" name="reset"></td>
          </tr>
        </table>
       
      </td>
  </tr>
</table>
</form>
------------------
Then when this is clicked it can either reload the page utilising 'the_action', or go to another page (it's up to you).
Either way I use the following (where database_connect.php it's just to setup mysql so it's easier)
------------------
   include_once('database_connect.php');

   $result = mysql_query("SELECT * from smf_members") or die ("Error in registration sql:".mysql_error());
   $error="";
   while($row = mysql_fetch_array($result))
      {
      if ($memberName==$row[memberName]) { $error.="Unfortunately you have an entered a username that already exists, please update this field.<br>"; }
      if ($emailAddress==$row[emailAddress]) { $error.="Unfortunately you have a email address that already exists, please update this field.<br>"; }
      }

   if ($memberName=="") { $error.="Unfortunately your username is blank, please enter a valid username.<br>"; }
   if (($passwd==$password2) and (strlen($passwd)<7) and ($passwd<>"")) { $error.="Your password needs to be more a minimum of 7 characters.<br>"; }
   if ($passwd=="") { $error.="One or more of your password fields are blank.<br>"; }
   if ($passwd<>$password2) { $error.="The password and verify password fields do not match, please update them.<br>"; }
   if ($realName=="") { $error.="Your realname field has been left blank and is required for registration.<br>"; }
   if ($emailAddress=="") { $error.="Your email address needs to be populated and is required for registration.<br>"; }
   if ($error=="")
      {
      echo "<p class=\"bodyText\">Your registration has been accepted, you have almost completed this process.</p>";
      $address=$address1."-".$address2."-".$town."-".$country."-".$postcode;
      $passwd=md5($passwd);
$result = mysql_query("INSERT INTO smf_members (memberName,emailAddress,realName,address,passwd,telephone,dateRegistered) VALUES('$memberName','$emailAddress','$realName','$address','$passwd','$telephone','" . time() . "')") or die ("Error in registration sql:".mysql_error());
      }      

   if ($error<>"")
      {
      echo "<p class=\"bodyText\"><span class=\"style1\">".$error."</span></p>";
      $the_action="";
      }
------------------


Not I must stress that as mentioned above it is very rough and ready and the code could be much more efficient, but in terms of getting it to work I tend to write things quickly that work and then update them.

Hope this may be of use to someone, just thought I would contribute.
That thing that's behind the thing, don't touch that, press the other thingy.

Jim R

I am interested in this topic too.  As much as I'm finding a way to use SMF to offer paid subscriptions to Users who can access premium content, my User Authentication software provides a lot of tracking options that I like.

Advertisement: