roboa Posted April 20, 2009 Report Share Posted April 20, 2009 Is it possible for the pilot to automatically sign upto the forums when they sign up for the va? cheers, roboa Quote Link to comment Share on other sites More sharing options...
Toyuko Posted April 20, 2009 Report Share Posted April 20, 2009 Search the forum and you will find codes to insert. What forum system are you using? Quote Link to comment Share on other sites More sharing options...
roboa Posted April 20, 2009 Author Report Share Posted April 20, 2009 SMF forums. Search the forum and you will find codes to insert. Ok, i'll take a look. thanks, roboa Quote Link to comment Share on other sites More sharing options...
roboa Posted April 20, 2009 Author Report Share Posted April 20, 2009 Ok, I found the code for the smf forum. Where do I put this? Also I was testing the registration form and it just keeps on going back to the registration form and not processing anything. Any suggetsions? cheers, roboa Quote Link to comment Share on other sites More sharing options...
goldenairways Posted May 6, 2009 Report Share Posted May 6, 2009 Is there coding avalible for phpBB forums? Quote Link to comment Share on other sites More sharing options...
steelerboi Posted May 6, 2009 Report Share Posted May 6, 2009 Roboa, These are the steps I posted in a different thread (possibly the one you found the code in) and it all worked fine for my SMF integration (assuming you are using the same database for the forum and PHPVMS) * Step 1: Create a new folder in /core/modules called ForumRegister * Step 2: In that folder create a new php file called ForumRegister.php * Step 3: Copy and paste in the following code Code: [select] <?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']; $get_uinfo = mysql_query("SELECT * FROM phpvms_pilots WHERE firstname='".$fname."' AND lastname='".$lname."' AND email='".$email."'"); $uinfo = mysql_fetch_array( $get_uinfo ); $str = $uinfo['pilotid']; $pilot_id = str_pad ($str,4,"0",STR_PAD_LEFT); $pilot_id = $code.$pilot_id; $pilot_name = mysql_escape_string ($fname. ' ' .$lname); $passsha1 = mysql_escape_string (sha1(strtolower($email) . $pass)); $passsalt = substr(md5(mt_rand()), 0, 4); $email = mysql_escape_string($email); $tm = time(); mysql_query("INSERT INTO smf_members (member_name, real_name, passwd, email_address, hide_email, id_group, time_offset, location, lngfile, validation_code, id_theme, is_activated, id_msg_last_visit, date_registered, password_salt) VALUES ('".$email."', '".$pilot_name."', '".$passsha1."', '".$email."', '1', '4', '', '', '', '', '0', '1', '1', '".$tm."', '".$passsalt."')"); $member_id = mysql_insert_id(); mysql_query("update smf_settings set value = '$pilot_name' where variable='latestRealName'"); mysql_query("update smf_settings set value = '$member_id' where variable='latestMember'"); } } } ?> Regarding the registration issue, are you using the latest build which contains the captcha ? I was having a similar issue until I realised I was still using an older version without the captcha Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 6, 2009 Administrators Report Share Posted May 6, 2009 The captcha shouldn't matter, since you're bypassing a form and going straight to a database Quote Link to comment Share on other sites More sharing options...
roboa Posted May 6, 2009 Author Report Share Posted May 6, 2009 The registration form was fixed with the help of Roger a while ago, but thanks all the same! roboa Quote Link to comment Share on other sites More sharing options...
goldenairways Posted May 6, 2009 Report Share Posted May 6, 2009 Is it possible to do with phpBB Quote Link to comment Share on other sites More sharing options...
roboa Posted May 6, 2009 Author Report Share Posted May 6, 2009 A quick search pulled up this: http://phpvms.net/forum/index.php?topic=272.0 roboa Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 7, 2009 Report Share Posted May 7, 2009 This doesn't work, stop telling people it does. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 7, 2009 Administrators Report Share Posted May 7, 2009 It's probalby missing some queries. I would advise looking at the bridge scripts for smf and find 'clues' in there as to the proper sequence Quote Link to comment Share on other sites More sharing options...
steelerboi Posted May 7, 2009 Report Share Posted May 7, 2009 Guys, just to clarify, the integration code does work fine with SMF (at least with the version of SMF that I'm using anyway, which is SMF 2.0 RC1 Public Released on February 04, 2009), but not sure about PHPBB integration as I don't use that. Having said that, all I did was take the original PHPBB code posted by Mark and change the variables to those used by SMF, then tweaked it for creating a password salt and running the latest member query etc and it works a treat. Surely, someone using PHPBB must also have got this to work by now ? Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 7, 2009 Report Share Posted May 7, 2009 I am using SMF 1.1.8 and it doesn't work. It shows in the newest member field but never actually creates the user in the database. I personally can't stand PHPBB. Quote Link to comment Share on other sites More sharing options...
steelerboi Posted May 7, 2009 Report Share Posted May 7, 2009 Hi Roger, It's possible that there's a version conflict in that case then. Oh btw, that last reply is much better than your original, as detailed info is preferable to simply saying it doesn't work and asking me to stop telling people it does, when it's clearly working 100% for me Working together is the way to get things achieved, so we need to find out what the differences are between various setups. OK, first things first, are the tables in your version of SMF named exactly as those in the query ? Secondly, what field type is member_name (assuming it's called that in your version) ? Mine is set to varchar(80) Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 8, 2009 Report Share Posted May 8, 2009 Everything appears to check out. Mine is also varchar 80. Tables check out Quote Link to comment Share on other sites More sharing options...
steelerboi Posted May 8, 2009 Report Share Posted May 8, 2009 Okey doke, in which case I'll download and install 1.18 over the weekend and see if I can figure out what the difference is. Quote Link to comment Share on other sites More sharing options...
goldenairways Posted May 8, 2009 Report Share Posted May 8, 2009 I have been trying a script in a different topic and it was made for phpBB which I am using. But I am having trouble making it work. So I contacted somebody who I know and he has been helping me alot with my site, but he updated the registration in the phpVMS thing and I tried to put it in and my sites down. I am going to tell him that it didn't work and see what happens from there. But I am not a good person at programming at all. Quote Link to comment Share on other sites More sharing options...
goldenairways Posted May 8, 2009 Report Share Posted May 8, 2009 To add, I have now sorted two problems which were there but there is another one which the person couldn't help me with. Its this message: Parse error: syntax error, unexpected '/' in /home/goldenair/domains/goldenairways.co.uk/public_html/core/modules/ForumRegister/ForumRegister.php on line 44 Please could somebody help me with it as I have no idea how to do it. Thanks. Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 8, 2009 Report Share Posted May 8, 2009 Could you post the code for line 44? Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 8, 2009 Report Share Posted May 8, 2009 Sorry about the comment Nige, been a bad week and I shouldn't of done it. Much apologies. One other question, what setting does the forum need to be set on in the admin panel? Member activate, admin?? Quote Link to comment Share on other sites More sharing options...
goldenairways Posted May 8, 2009 Report Share Posted May 8, 2009 I have now fixed that The only problem now is this which I have no idea about: "Fatal error: Cannot redeclare class template in /home/goldenair/domains/goldenairways.co.uk/public_html/forum/includes/template.php on line 24" And all that is on line 24 is this "{" Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 8, 2009 Administrators Report Share Posted May 8, 2009 That means there's already a class called Template and you can't create another one Quote Link to comment Share on other sites More sharing options...
steelerboi Posted May 9, 2009 Report Share Posted May 9, 2009 Apologies accepted Roger, thanks dude. I actually have my registration set to disabled, since I want to restrict forum membership to those on my V.A. Since the code essentially updates the SMF database, I don't think that the setting should be an issue. I've downloaded and installed 1.18 now, so once I've applied the same changes as I did with version 2.0 the investigation can begin Quote Link to comment Share on other sites More sharing options...
steelerboi Posted May 9, 2009 Report Share Posted May 9, 2009 Looks like the problem is down to changes of field names in the smf_members table. I've amended the code accordingly and tested it out with the 1.18 version I installed and it appears to be doing the job, adding the member to the database and updating the latest member. For those of you using SMF 1.18, the following code for your ForumRegister.php file should now work ok. <?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']; $get_uinfo = mysql_query("SELECT * FROM phpvms_pilots WHERE firstname='".$fname."' AND lastname='".$lname."' AND email='".$email."'"); $uinfo = mysql_fetch_array( $get_uinfo ); $str = $uinfo['pilotid']; $pilot_id = str_pad ($str,4,"0",STR_PAD_LEFT); $pilot_id = $code.$pilot_id; $pilot_name = mysql_escape_string ($fname. ' ' .$lname); $passsha1 = mysql_escape_string (sha1(strtolower($email) . $pass)); $passsalt = substr(md5(mt_rand()), 0, 4); $email = mysql_escape_string($email); $tm = time(); mysql_query("INSERT INTO smf_members (memberName, realName, passwd, emailAddress, hideEmail, ID_GROUP, timeOffset, location, lngfile, validation_code, ID_THEME, is_activated, ID_MSG_LAST_VISIT, dateRegistered, passwordSalt) VALUES ('".$email."', '".$pilot_name."', '".$passsha1."', '".$email."', '1', '4', '', '', '', '', '0', '1', '1', '".$tm."', '".$passsalt."')"); $member_id = mysql_insert_id(); mysql_query("update smf_settings set value = '$pilot_name' where variable='latestRealName'"); mysql_query("update smf_settings set value = '$member_id' where variable='latestMember'"); } } } ?> Let me know how it goes. Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 9, 2009 Report Share Posted May 9, 2009 Works great, thanks for your effort! ;D Maybe Nabeel could sticky these two versions or they could be put in the add on section. Quote Link to comment Share on other sites More sharing options...
steelerboi Posted May 9, 2009 Report Share Posted May 9, 2009 Glad it works ok now Quote Link to comment Share on other sites More sharing options...
Nagelfar Posted May 14, 2009 Report Share Posted May 14, 2009 Hey there I Did step 1 - 3 but theres still no Users inside the SMF Member Liste I installed the forum in a sub Folder inside my phpvms directory Does is have to install a integration bridge in smf? Thanks for your help Quote Link to comment Share on other sites More sharing options...
RogerB Posted May 14, 2009 Report Share Posted May 14, 2009 It only matters where the database is, phpvms and SMF have to be in the same database. I just did an export of my SMF database and imported it into phpvms. Quote Link to comment Share on other sites More sharing options...
packo88 Posted May 15, 2009 Report Share Posted May 15, 2009 For those of you using SMF 1.18, the following code for your ForumRegister.php file should now work ok. Fantastic work Nige, Works great. A big thumbs up from me mate :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.