Jump to content

SMFRegister 1.0


simpilot

Recommended Posts

  • Administrators

SMFRegister 1.0

phpVMS module to automatically register a new pilot in your smf 1.1.11 forum.

Developed by:

simpilot

www.simpilotgroup.com

Developed on:

phpVMS ver 934

smf ver 1.1.11

php 5.2.11

mysql 5.0.51

apache 2.2.11

Included files:

readme.txt

license.txt

SMFRegister.php

SMFRegisterData.class.php

Install:

-Download the attached package.

-unzip the package and place the files as structured in your root phpVMS install.

-your structure should be:

root

core

common

SMFRegisterData.class.php

modules

SMFRegister

SMFRegister.php

- Your smf database must reside in the same datbase as your phpVMS install and use the standard "smf_" prefix.

- I have built this to work with smf forum version 1.1.11, it has not been tested with any other version.

- The module will register a new user in the forum when a new pilot registers with the VA.

the format for registration into the forum is:

user: John Smith ABC1234

pass: same as they used to register on the main site.

I am working on making it catch the hook for the "approve pilot" event, which Nabeel is building in, but it does not seem to catch it right yet. As of now it will register the pilot upon the initial registration. If you reject the pilot remember to go and ban or delete him from your forum.

Although not required, a link back to www.simpilotgroup.com would be greatly appreciated!

Have fun!

SMF_Register_1.0.zip

  • Like 5
Link to comment
Share on other sites

  • 2 weeks later...
  • Moderators

any new version for the SMF RC2?

Thanks :rolleyes:

Why do we need to release a new version that the SMF is still being build. You'll have to wait till the SMF 2.0 is fully done then porbalry he will release a new one.

Becasue he may not know what changed to the files in order for this add on to work.

  • Like 1
Link to comment
Share on other sites

  • Administrators

any new version for the SMF RC2?

Thanks :rolleyes:

Until they take the "RC" off of it I will wait on building anything. I have not been too impressed with 2.0 so far anyway. 1.1.11 is stable and addon's are not a big deal to be built.

  • Like 2
Link to comment
Share on other sites

  • 2 months later...

Hi,

I'm new as writer in the forum but I'm an old-reader. I'm working with phpVMS to move my VA website from Joomla to phpVMS only, even if I was already full automated with FS Acars; but you know it is not the best around.

So I discovered this fantastic add on but I was not happy at all with the user and displayed name that is imported in SMF and I decided to make this small change: the user name is now equal to "ABC1234" only while the displayed name is "FirstName Surname".

Just in case you want the same the new code for the file SMFRegisterData.class.php is:

class SMFRegisterData extends CodonData

{

public function forum_register($eventinfo) {

$id = PilotData::getPilotByEmail($eventinfo[2]);

$pid = PilotData::getPilotCode($eventinfo[2]

, $id->pilotid);

$username = $pid;

$name = $eventinfo[2][firstname].' '.$eventinfo[2][lastname];

$password = $eventinfo[2][password1];

$email = $eventinfo[2][email];

$register_vars = array(

'memberName' => "'$username'",

'realName' => "'$name'",

'emailAddress' => "'" . addslashes($email) . "'",

'passwd' => "'" . sha1(strtolower($username) . $password) . "'",

'passwordSalt' => "'" . substr(md5(mt_rand()), 0, 4) . "'",

'posts' => '0',

'dateRegistered' => (string) time(),

'is_activated' => '1',

'personalText' => "''",

'pm_email_notify' => '1',

'ID_THEME' => '4',

'ID_POST_GROUP' => '4',

'lngfile' => "''",

'buddy_list' => "''",

'pm_ignore_list' => "''",

'messageLabels' => "''",

'websiteTitle' => "''",

'websiteUrl' => "''",

'location' => "''",

'ICQ' => "''",

'AIM' => "''",

'YIM' => "''",

'MSN' => "''",

'timeFormat' => "''",

'signature' => "''",

'avatar' => "''",

'usertitle' => "''",

'memberIP' => "''",

'memberIP2' => "''",

'secretQuestion' => "''",

'secretAnswer' => "''",

'validation_code' => "''",

'additionalGroups' => "''",

'smileySet' => "''",

);

$query = "INSERT INTO smf_members (" . implode(', ', array_keys($register_vars)) . ")

VALUES (" . implode(', ', $register_vars) . ")";

instead of:

class SMFRegisterData extends CodonData

{

public function forum_register($eventinfo) {

$id = PilotData::getPilotByEmail($eventinfo[2][email]);

$pid = PilotData::getPilotCode($eventinfo[2][code], $id->pilotid);

$username = $eventinfo[2][firstname].' '.$eventinfo[2][lastname].' '.$pid;

$password = $eventinfo[2][password1];

$email = $eventinfo[2][email];

$register_vars = array(

'memberName' => "'$username'",

'realName' => "'$username'",

'emailAddress' => "'" . addslashes($email) . "'",

'passwd' => "'" . sha1(strtolower($username) . $password) . "'",

'passwordSalt' => "'" . substr(md5(mt_rand()), 0, 4) . "'",

'posts' => '0',

'dateRegistered' => (string) time(),

'is_activated' => '1',

'personalText' => "''",

'pm_email_notify' => '1',

'ID_THEME' => '4',

'ID_POST_GROUP' => '4',

'lngfile' => "''",

'buddy_list' => "''",

'pm_ignore_list' => "''",

'messageLabels' => "''",

'websiteTitle' => "''",

'websiteUrl' => "''",

'location' => "''",

'ICQ' => "''",

'AIM' => "''",

'YIM' => "''",

'MSN' => "''",

'timeFormat' => "''",

'signature' => "''",

'avatar' => "''",

'usertitle' => "''",

'memberIP' => "''",

'memberIP2' => "''",

'secretQuestion' => "''",

'secretAnswer' => "''",

'validation_code' => "''",

'additionalGroups' => "''",

'smileySet' => "''",

);

$query = "INSERT INTO smf_members (" . implode(', ', array_keys($register_vars)) . ")

VALUES (" . implode(', ', $register_vars) . ")";

Regards!

Link to comment
Share on other sites

Hi BlackYet. Thanks for the contribution. Please do avoid posting that much code in a topic. Pastebin works real good. As well, you can zip the text file up and attach it. ;)

But yeah I was a wondering how to make it match the username in phpVMS. Thanks again.

Link to comment
Share on other sites

Hi BlackYet. Thanks for the contribution. Please do avoid posting that much code in a topic. Pastebin works real good. As well, you can zip the text file up and attach it. ;)

But yeah I was a wondering how to make it match the username in phpVMS. Thanks again.

OK, in case of other contribution I will follow your advise, many thanks and sorry for the mess!! :unsure:

In case you want the displayed name as ABC1234 FirstName Surname you have just to change the "$name" variable...

Link to comment
Share on other sites

OK, in case of other contribution I will follow your advise, many thanks and sorry for the mess!! :unsure:

In case you want the displayed name as ABC1234 FirstName Surname you have just to change the "$name" variable...

Hey no probs. I am no authority figure, I was just saying is all. Kind advice. ;) thanks for your understanding. It just makes the forum look much cleaner. And please do feel free to contribute any time. That's what this place is all about. Take Simpilot for example since we are in his threads here. B)

And I am gonna try out your code snippet for the smf register and see if she works for me or not. I hope so. I really like your idea.

Link to comment
Share on other sites

  • 4 months later...
  • Moderators

Is There Anyway Of Changing the database it writes them to?

Happy New Year,

Jon

Hi Jon,

Yes just call the mysql connection before the script,

mysql_connect("localhost", "db_username", "db_pw") or die(mysql_error());
mysql_select_db("Your_database") or die(mysql_error());

Your code

mysql_close();

Or to be more secure you could use a require, ie create a file, forum_config.php or anything you like and add it in to the page,

<?php require("forum_config.php"); ?>

Link to comment
Share on other sites

  • 1 month later...

Hello all,

Is there somebody with the solution to register the pilot into the forum when they are excepted.

Now for example when somebody register to the VA he is assigned with the callsign VBV113, but because there is no VBV050 anymore

I change the VBV113 to VBV050 before I accept the pilot but in the forum he is registerd as VBV113.

Also we need something that if somebody changes his password on the site that automaticly also his forum password changes and

the last thing what would be nice is that if you go from the site to the forum you automaticly been signed in. I have this at

this moment with Joomla.

Maybe somebody has some solutions :D

Regards,

Cor

Link to comment
Share on other sites

  • Administrators

The module is not a bridge, it is only a system to auto register the pilot in the forum when they signup with the VA. I would love to see how you built the bridge for the phpVMS to Joomla link though, if you were willing to share I will see if I can adapt it to the smf forum. That has been the biggest hang I had was getting the two login systems to mesh together as they use different password hashes and session data. If I could see how you intergrated Joomla I am be able to adapt the concept to smf.

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 2 months later...

I'm curious. Has anyone ever made this so when a pilot logs on to the website, it logs them in to the forum as well? So If I am browsing my VA website and click the forum link, it recognizes the cookie and I would be logged in. Was just curious if anyone every figured out a way to do that or not.

I understand that this is not a bridge and it does in fact work great as Simpilot has coded it. Many kudos Simpilot!

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...