Jump to content

steelerboi

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by steelerboi

  1. Hi Nabeel, I was wondering whether it would be possible to change the format used to show total hours flown by an aircraft. I think the issue stems from the time first entered into the PIREP as a non-standard format, e.g. 1.3 for 1 hr 30 mins rather than 1.5 or 90 mins. As such, the total hours flown by one of my aircraft is showing as 3.9 which of course is actually 4 hrs 30 mins. It's not a mega problem, but just one which results in some head scratching when looking at the reports in the admin reports section
  2. 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.
  3. 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
  4. 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.
  5. 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)
  6. 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 ?
  7. 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
  8. When logged in as admin and viewing the overview report (reports & expenses), my aircraft usage was showing weird hours and miles totals. A quick delve into the StatsData.class.php showed that the sql query for AircraftUsage was using COUNT() rather than SUM(), i.e. public static function AircraftUsage() { $sql = 'SELECT a.name AS aircraft, a.registration, SUM(p.flighttime) AS hours, SUM(p.distance) AS distance FROM '.TABLE_PREFIX.'pireps p INNER JOIN '.TABLE_PREFIX.'aircraft a ON p.aircraft = a.id GROUP BY p.aircraft'; I changed the query accordingly and the totals now show correct values. Nabeel, was this the right thing to do, or was I missing something elsewhere ?
  9. Checkout this thread http://phpvms.net/forum/index.php?topic=523.0 I think that may be what you're after ?
  10. Not too sure about PHPBB, as I don't use that myself. Theoretically you should just be able to create the ForumRegister module and use the code which Mark posted earlier in your ForumRegister.php file, as that was specifically for PHPBB.
  11. Hi Nabeel, I also have this issue right now, but it looks like it's due to PHP not being compiled with GD, as I understand this is normally installed as a shared object extension.
  12. Dan, is your SMF running on a separate database, or the same one as phpvms ? One of the things I forgot to mention is that I have both using the same database, so if you're using 2 databases, you would need to call the correct database from the code.
  13. Hi guys, I was having probs integrating the membership into SMF too, so one night last week I sat down with a mate who's a programmer and working from the original ForumRegister module code which Mark posted, we came up with the following code which seems to work ok. [*]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 <?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'"); } } } ?> Save everything and try a signup from your VA site and all being well a new account will also be created in SMF We modified the code so that some different variables were inserted into the SMF database and also included the queries that perform an update to show the latest member. In addition, the password salt line has also been included, as otherwise without this the new user would need to login twice to SMF to begin with in order for the salt to be created. This is now generated automatically by the extra lines in the code above. The other thing we tweaked was the way of logging into SMF, as originally it used the fullname and pilot code. The code now uses the email address, so the pilot can use the exact same login as on the VA site. Hope this helps you all, as I know it was a huge relief to me to finally get the memberships working together
  14. The way I've done this is to add a link to the schedules page directly. That way visitors can still see and search flights and pilots still have to login in order to bid on a flight. I've used the link within a php file, so mine is as follows: <a href="<?php echo SITE_URL ?>/index.php/Schedules">Flight Schedules</a> Don't forget that if you're making any alterations to core templates or modules, copy them into your skins folder so that they don't get overwritten when you perform an update.
  15. Hi Nabeel, Yeh I've noticed the same thing too actually. It's in the admin section > Reports & Expenses > Overview. An example of one of my rows is as follows: Route Times Flown PLA207 (EGNM to EIDW) 0 10, 0,-2 Often wondered myself what the strange numbers mean
  16. OK, well basically it allows a pilot to bid for a flight from your schedules and it will then store the details for later, e.g. for direct import into FSACARS by using the 'get flight from VA option' in that program. It saves the hassles of manually entering the details etc. Once the flight has been completed, the PIREP can be sent directly from FSACARS to your VA and the bid will be automatically removed. Looking at the latest update, it seems Nabeel has implemented an additional feature whereby once a bid is made, no other pilot can select that flight until the bid is released. I haven't actually uploaded the update as yet, but looking at the build log forum, I think that's what he's done
  17. Hmm, not entirely sure what you mean dude ? Do you mean you're having problems getting the bidding system to work, or simply that you're not sure how it works or what it's used for ?
  18. Hi Simon, Yep, by default the schedules will display flights applicable to that day of the week. If you want all the flights to show up, then you need to comment out a couple of lines in the schedule_results.tpl There are good notes in that file so it's easy to identify which lines you need to comment out. Make sure you copy any modified files to your skins folder of course, otherwise they'll get overwritten when you do an update Hope that helps.
  19. I'm no expert and I've picked up the basics by watching the tutorials/reading the API docs and managed to get a skin working for my VA, but unfortunately I'm a bit too busy tweaking the rest of it and also repainting aircraft in order for a live launch that I don't really have much time to develop another site, lol. I see from your post in the skins forum that someone else has emailed you offering help, so I hope that works out. However, if you're really stuck and can't find anyone else, then by all means drop me a PM and I'll help you out All the best.
  20. Hi there, Go to the admin section and in Site & Settings there's an option for Profile Fields. Click on that and it will display an option to 'Add a Custom Field'. Click that link and the box to enter the relevant field data will appear, giving you the option to show it during registration and also to show it in the user profile.
  21. After applying the latest beta update, I noticed an error after adding a schedule via the admin centre: Warning: implode() [function.implode]: Invalid arguments passed in /home/plusair/public_html/admin/modules/Operations/Operations.php on line 514 The fix to this (as identified by a dev friend of mine) is to the input sanitisation in Vars.class.php public static function cleaned(&$V) { if(is_array($V)) { foreach($V as $k => $val) { $V[$k] = self::cleaned($val); } return $V; } return htmlspecialchars(addslashes(stripslashes($V))); } Hope this helps anybody suffering from the same error.
  22. You're welcome Chris, it's something I did on my own site earlier this morning, so you timed the question well Not sussed out the schedule time search yet though, that's proving a bit tricky !
  23. Hi Chris, I can help you with the 2nd question, but will have to do some investigation on the schedule search thing. To remove the 'posted by' text, go into the Core/Templates folder and open up news_newsitem.tpl Simply remove the following line: <p>Posted by <?php echo $postedby;?> on <?php echo $postdate;?></p> Hope that helps,
×
×
  • Create New...