phpBB Forum Registration Script

Originally from this topic:

<?php
class ForumRegister extends CodonModule
{
   
  public function __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 far, confirmed working by one person. But I would feel more comfortable if it were using the phpBB API for adding users.

Im also using this plugin/addon its working just fine!

It needs further work though.

didn’t work for me

Works Fine for me also, one reminder both databases need to be in the same one if you know what mean

Would anyone be able to write a quick tutorial on how to actually implement this code?

Im not quite sure what to do with it.

Cheers,

Tom.

Scrap that sorry. Ryan:

Make a module folder “ForumRegister”

Pase that code in as ForumRegister.php

done.

I’m having a problem though, the users are inactive and when I made them identical to other registered members they can’t see any of the forums.

Any ideas?

Don’t worry I fixed it myself.

Yeah the code provided only works for the person who posted it in the first place. You need to add quite a few more things and change things (e.g. group, unless you made a group 9)

It really needs to use the phpBB API to do it, not raw calls to the database. If someone can find out that info, I might be able to scratch something up real quick.

Works Fine for me also, one reminder both databases need to be in the same one if you know what mean

I guess thats why it doesnt work for me.