Jump to content

phpBB Forum Registration Script


Nabeel

Recommended Posts

  • Administrators

Originally from this topic:

http://forum.phpvms.net/index.php?topic=272.0

<?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.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

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.

Link to comment
Share on other sites

Guest Ryyaann

OK, found out the problem.

They send over fine but they are placed in inactive users. Reason: Unknown

Any help?

Thanks in advance,

Ryan

Could anyone tell me how I could get it to change the username every time their airline changes? So if they are STP555 on the forums and they change airlines they would change to PTY555.

Link to comment
Share on other sites

  • 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...