Automatic Forum account creation

And I believe an updated version of that was posted

and how can i correct that?  ???

This should be a fixed up version, using the proper API calls

<?php
class ForumRegister extends CodonModule
{

public function __construct()
{
	parent::construct();
	CodonEvent::addListener('ForumRegister');
}

public function EventListener($eventinfo)
{
	if($eventinfo[0] == 'registration_complete')
	{

		$userinfo = $eventinfo[2];

		$fname = $userinfo['firstname'];
		$lname = $userinfo['lastname'];
		$pass = $userinfo['password1'];
		$email = $userinfo['email'];
		$code = $userinfo['code'];


		$uinfo = PilotData::GetPilotByEmail($userinfo['email']);

		$code = PilotData::GetPilotCode($uinfo->code, $uinfo->pilotid);
		$pilot_id = $fname.$lname.$code.$pilot_id;
		$pilot_id_klein = strtolower($pilot_id);

		$passMD5 = md5($pass);

		$tm = time();

		DB::query("INSERT INTO phpbb_users (username, username_clean, user_password, user_email, group_id, user_timezone, user_dst, user_rank, user_lang, user_colour, user_type, user_actkey, user_dateformat, user_style, user_regdate) VALUES ('".$pilot_id."', '".$pilot_id_klein."', '".$passMD5."', '".$email."', '9','0.0', '0', '2','en','0099FF','1','5BN4938HB2','D M d, Y g:i a', '2', '".$tm."')");			


	}
}

}
?>

Website won’t even show up! This error is diplayed though:

Fatal error: Call to undefined method CodonModule::construct() in /home1/flymelit/public_html/core/modules/ForumRegister/ForumRegister.php on line 7

Delete this line:

parent::construct();

Brilliant! phpBB is working fine with this code! Thanks!

This should be a fixed up version, using the proper API calls

<?php class ForumRegister extends CodonModule { public function __construct() { parent::construct(); CodonEvent::addListener('ForumRegister'); } public function EventListener($eventinfo) { if($eventinfo[0] == 'registration_complete') { $userinfo = $eventinfo[2]; $fname = $userinfo['firstname']; $lname = $userinfo['lastname']; $pass = $userinfo['password1']; $email = $userinfo['email']; $code = $userinfo['code']; $uinfo = PilotData::GetPilotByEmail($userinfo['email']); $code = PilotData::GetPilotCode($uinfo->code, $uinfo->pilotid); $pilot_id = $fname.$lname.$code.$pilot_id; $pilot_id_klein = strtolower($pilot_id); $passMD5 = md5($pass); $tm = time(); DB::query("INSERT INTO phpbb_users (username, username_clean, user_password, user_email, group_id, user_timezone, user_dst, user_rank, user_lang, user_colour, user_type, user_actkey, user_dateformat, user_style, user_regdate) VALUES ('".$pilot_id."', '".$pilot_id_klein."', '".$passMD5."', '".$email."', '9','0.0', '0', '2','en','0099FF','1','5BN4938HB2','D M d, Y g:i a', '2', '".$tm."')"); } } } ?>

So this is the final answer to the phpBB3 integration? I really want to use something like this but I can wait until all the kinks have been worked out.

I really appreciate all the hard work everyone puts into phpVMS. I can mod the hell right out of phpBB2.x and 3.x but this phpVMS is REAL brand new to me.

If I do use this, I create that folder in the modules folder and insert the php doc that I create and then install a phpBB3 using the same database as phpVMS and thats it? When a new person registers it will create a phpBB3 account?

Or do I need to do something further in the Admin section of my phpVMS install? Sorry to sound like such a newb, but I really am here  ;D

So this is the final answer to the phpBB3 integration? I really want to use something like this but I can wait until all the kinks have been worked out.

I really appreciate all the hard work everyone puts into phpVMS. I can mod the hell right out of phpBB2.x and 3.x but this phpVMS is REAL brand new to me.

If I do use this, I create that folder in the modules folder and insert the php doc that I create and then install a phpBB3 using the same database as phpVMS and thats it? When a new person registers it will create a phpBB3 account?

Or do I need to do something further in the Admin section of my phpVMS install? Sorry to sound like such a newb, but I really am here  ;D

Welcome! And yep, that should be it! It hooks in using the EventListener() function, so no core code has to be touched to extend.

It may break in phpBB updates, or something might be nulled or wrong with the user created - I’m not sure. To be sure, it has to use the phpBB API, but I haven’t had the time to search that out. There was another post around here where I grabbed it from, it might be worth skimming through that

Ok I’ll have a search and read. Thanks a bunch.

So you simply add the ForumRegister module… and that’s it?

Is there anything that you need to modify in the registration scripts?

This is what you need to do,

Create a folder in your core/modules called ForumRegister, in that folder create a new php file and past Nabeels code in and save.

That should be it…

Ah and dont forget if your forum db is not in your vms install then you need to add a connect statement before the insert.

I have gone back to look at this and i hope some one can help, presently the code inserts the username and pilot id with out spaces between,

$pilot_id = $fname.$lname.$code.$pilot_id; would result in FirstnameLastnamePilotid,

How can i change this to get Firstname Lastname Pilotid. with the space in between?

That would be:

$pilotid = $fname . ' ' . $lastname . ' ' . $code . $pilot_id;

simply throw in some quoted spaces and join them with the full stop.

That would result in, in my case:

Kieran McHugh KLM227

So, does this ForumRegister module automatically add a user when they register?

My phpbb tables are in the same location as my phpVMS tables.

Theres no include() or similar that I need to have in the register module?

So, does this ForumRegister module automatically add a user when they register?

My phpbb tables are in the same location as my phpVMS tables.

Theres no include() or similar that I need to have in the register module?

I will give that a go, thanks, and yes no include is needed because your not using the forum registration, your directly putting in values to the users table collected from the registration page of phpvms.

<?php
class ForumRegister extends CodonModule
{
   
  public function __construct()
  {
      CodonEvent::addListener('ForumRegister');
  }
   
  public function EventListener($eventinfo)
  {
      if($eventinfo[0] == 'registration_complete')
      {
echo 'Receiving You!';

        $userinfo = $eventinfo[2];

        $fname = $userinfo['firstname'];
        $lname = $userinfo['lastname'];
        $pass = $userinfo['password1'];
        $email = $userinfo['email'];
        $code = $userinfo['code'];

      
        $uinfo = PilotData::GetPilotByEmail($userinfo['email']);
                              
        $code = PilotData::GetPilotCode($uinfo->code, $uinfo->pilotid);
        $pilot_id = $fname. '' .$lname. '' .$code.$pilot_id;
        $pilot_id_klein = strtolower($pilot_id);
         
        $passMD5 = md5($pass);

        $tm = time();

DB::Query("INSERT INTO phpbb_users (username, username_clean, user_password, user_email, group_id, user_timezone, user_dst, user_rank, user_lang, user_colour, user_type, user_dateformat, user_style, user_regdate) VALUES ('".$pilot_id."', '".$pilot_id_klein."', '".$passMD5."', '".$email."', '2','0.0', '0', '2','en_us','0099FF','1','1', jS F Y g:i:s A', '1', '".$tm."')");         


      }
  }

}
?>

Is My script. It Displays ‘Receivng You’ but doesn’t put anything into the Database?

My phpbb_users is in the same directory as my phpVMS database :S

Try changing the last few lines around your query to this->

$query = "INSERT INTO phpbb_users (username, username_clean, user_password, user_email, group_id, user_timezone, user_dst, user_rank, user_lang, user_colour, user_type, user_dateformat, user_style, user_regdate) 
            VALUES ('$pilot_id', '$pilot_id_klein', '$passMD5', '$email', '2','0.0', '0', '2','en_us','0099FF','1','1', 'S F Y g:i:s A', '1', '$tm')";         

            DB::query($query);

also - not sure if it makes a difference but for time I use ->

$tm = NOW();

Doesn’t seem to be inserting anything either :s

Nope just add it

Sorry?