Administrators simpilot Posted March 10, 2010 Administrators Report Share Posted March 10, 2010 TOPPilot beta 1.0 phpVMS module to extract monthly flight statistics for individual pilots from your phpVMS based virtual airline. Developed by: simpilot www.simpilotgroup.com Developed on: phpVMS 2.0.874 php 5.2.11 mysql 5.0.51 apache 2.2.11 Included files: readme.txt top_flight.sql TopPilot.php TpPilotData.class.php tp_index.tpl tp_previous.tpl Install: -Download the attached package. -unzip the package and place the files as structured in your root phpVMS install. -use the top_flights.sql file to create the table needed in your sql database using phpmyadmin or similar. -after the initial install point your browser to yoursite/index.php/TopPilot/refresh_pilot_stats one time. This will populate the database table with any data available. -to view the main TopPilot index create a link yoursite/index.php/TopPilot -everytime a pirep is filed the module will recalculate the pilot stats and update the database There are three main display functions within the TopPilotData class that you can configure to use in various parts of your site. Flights flown - TopPilotData::top_pilot_flights($month, $year, 5) Hours flown - TopPilotData::top_pilot_hours($month, $year, 5) Miles flown - TopPilotData::top_pilot_miles($month, $year, 5) $month should be the two digit month id of the month you want data from – ie 06 = June $year is the four digit year you are pulling – ie 2010 5 – can be changed to how many records you want returned. Excluding PIREPS that are not accepted yet. TopPilot.php line 52. Uncomment the trailing section and the module will not include unapproved PIREPS. Doing this will cause the module not to display any newly accepted PIREPS in the TopPilot data listings until after another PIREP is filed although you can refresh the stats at anytime using – yoursite/index.php/TopPilot/refresh_pilot_stats Although this script carries no limits of use a link back to www.simpilotgroup.com would be greatly appreciated! Have fun! Code hosted on Github - Link In Signature. 13 Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted March 10, 2010 Moderators Report Share Posted March 10, 2010 Top man!!!!! What a fantastic addition.... Thank you very much, this is now on my site. Easy to install and customise. 1 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted March 10, 2010 Report Share Posted March 10, 2010 Awesome! Thanks for the hard work you do with all these MODS, and thank you very much for sharing. Very much appreciated! 1 Quote Link to comment Share on other sites More sharing options...
stuartpb Posted March 10, 2010 Report Share Posted March 10, 2010 Hi Simpilot, thank you again for your outstanding work. This module is the dogs wotsits! I have just finished styling the page up on my site, and I am well pleased with the end result. The module really is a great addon!! Thanks, Stu See it in action here! 4 Quote Link to comment Share on other sites More sharing options...
llju1 Posted March 11, 2010 Report Share Posted March 11, 2010 As Usual simpilot another sweet addon Thanks again for your work Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted March 11, 2010 Author Administrators Report Share Posted March 11, 2010 Thanks Guys Nice work styling the tables everyone. Don't forget to create a free account and submit news releases about your va and your Pilots of the Month at simpilotgroup.com, we are moving up in the google ranks! Quote Link to comment Share on other sites More sharing options...
Bueno93 Posted March 11, 2010 Report Share Posted March 11, 2010 Hi, as usually a very nice add-on . Just one short question: The old stats start with January 1970. Where can I edit this date & the names for the months. As we are a German airline we'd like to have the names in German, but I didn't find a way to change the names. Once again thank you for those useful add-ons. Kind regards Bueno Quote Link to comment Share on other sites More sharing options...
crnjola Posted March 11, 2010 Report Share Posted March 11, 2010 Thank you for usefull addons !! Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted March 11, 2010 Author Administrators Report Share Posted March 11, 2010 Hi, as usually a very nice add-on . Just one short question: The old stats start with January 1970. Where can I edit this date & the names for the months. As we are a German airline we'd like to have the names in German, but I didn't find a way to change the names. Once again thank you for those useful add-ons. Kind regards Bueno To change the month names to German, Open tp_index.tpl After the opening php tag of the file add date_default_timezone_set('Europe/Berlin'); setlocale(LC_ALL, "de_DE", "de_DE@euro", "deu", "deu_deu", "german") ; find around line 58 if(!$topflights) {$month = date( 'F', mktime(0, 0, 0, $today[mon])); echo 'No Pireps Filed For '.$month.' '.$today[year]; } else { $month_name = date( 'F', mktime(0, 0, 0, $topflights[0]->month) ); and replace with if(!$topflights) {$month = strftime( '%B', mktime(0, 0, 0, $today[mon])); echo 'No Pireps Filed For '.$month.' '.$today[year]; } else { $month_name = strftime( '%B', mktime(0, 0, 0, $topflights[0]->month) ); find around line 136 $month_name = date( 'F', mktime(0, 0, 0, $startmonth) ); and replace with $month_name = strftime( '%B', mktime(0, 0, 0, $startmonth) ); Save it and refresh For the first month being Jan 1970 tells me that there is probably a pirep in your database with a submit date of 0000 00 00, as jan 1970 is the start of php/mysql time function. Look for a pirep with 0's for a submit date and fix the date, I think you will find it will correct itself at that point. Quote Link to comment Share on other sites More sharing options...
Bueno93 Posted March 11, 2010 Report Share Posted March 11, 2010 Hi, everything is fixed now. Thank you once again for your support . Kind regards Quote Link to comment Share on other sites More sharing options...
OneWorldVirtual Posted March 11, 2010 Report Share Posted March 11, 2010 Can anyone give me some advice on editing this module? A kick in the right direction would be very much appreciated! Cheers, DeeQ @ OWV Quote Link to comment Share on other sites More sharing options...
stuartpb Posted March 11, 2010 Report Share Posted March 11, 2010 You need to do some reading up on CSS to be able to apply styles to the tables. Once you get the basics sussed out in your mind, it's pretty easy to use CSS to good effect. The page is made up of tables, and the tables are split into table headers and table bodies. Each component of the table can be styled individually or collectively, by applying a style class. Here's a decent website that works through the basics of CSS, with examples: http://www.w3schools.com/css/default.asp There are also many other websites that offer CSS tutorials too. It's really worth getting to know CSS, as it allows you to make stylistic changes across your website very easily, with the use of a CSS stylesheet. It also helps to mess around with a stylesheet on a localhosted or live testing site, and make changes here and there to see what effect they have. That's how I got interested in CSS. I'm very far from an expert, but I do like experimenting. 3 Quote Link to comment Share on other sites More sharing options...
RIco Linhas Virtuais Posted March 25, 2010 Report Share Posted March 25, 2010 How do I add a table to sort the rank touchdown? Att: presidente Rico virtual www.ricovirtual.br.tp Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted March 26, 2010 Moderators Report Share Posted March 26, 2010 You need to do some reading up on CSS to be able to apply styles to the tables. Once you get the basics sussed out in your mind, it's pretty easy to use CSS to good effect. The page is made up of tables, and the tables are split into table headers and table bodies. Each component of the table can be styled individually or collectively, by applying a style class. Here's a decent website that works through the basics of CSS, with examples: http://www.w3schools.com/css/default.asp There are also many other websites that offer CSS tutorials too. It's really worth getting to know CSS, as it allows you to make stylistic changes across your website very easily, with the use of a CSS stylesheet. It also helps to mess around with a stylesheet on a localhosted or live testing site, and make changes here and there to see what effect they have. That's how I got interested in CSS. I'm very far from an expert, but I do like experimenting. +1 for me, guys just take the time to understand, hey im in my late 30's and i have learnt it and still am, check out that page it will help you loads http://www.w3schools.com/css/default.asp Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted March 30, 2010 Moderators Report Share Posted March 30, 2010 Hi, For some reason i have just noticed that my history stats show the same month, the only change i have made is the update to beta 2.1.910. Clearly there have been some edits to the tpl but i removed all the added code and still get the same, any ideas on this one please? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted March 30, 2010 Author Administrators Report Share Posted March 30, 2010 I noticed it on my site last evening as well. I will look at it this evening when I get in. Odd it displays the same month but links to the correct month.... Quote Link to comment Share on other sites More sharing options...
Artjom Posted April 1, 2010 Report Share Posted April 1, 2010 Who can I download this file? Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 1, 2010 Moderators Report Share Posted April 1, 2010 All Sim Pilots modules have been temporary removed while they are licensed, they will be back soon. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 5, 2010 Author Administrators Report Share Posted April 5, 2010 Hi, For some reason i have just noticed that my history stats show the same month, the only change i have made is the update to beta 2.1.910. Clearly there have been some edits to the tpl but i removed all the added code and still get the same, any ideas on this one please? Seemed to fix itself on my site Has your listings corrected themselves as well? Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 5, 2010 Moderators Report Share Posted April 5, 2010 Yes it did, cheers. Dont know what all that was about be it seems OK now, Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 5, 2010 Author Administrators Report Share Posted April 5, 2010 Good - who knows, gremlins I guess.... Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 13, 2010 Author Administrators Report Share Posted April 13, 2010 Files attached to first post. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted May 4, 2010 Author Administrators Report Share Posted May 4, 2010 2.0 coming along Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted May 4, 2010 Report Share Posted May 4, 2010 2.0 coming along That looks pretty good so far. Quote Link to comment Share on other sites More sharing options...
lorlandi Posted May 10, 2010 Report Share Posted May 10, 2010 Excelent mod Simpilot, only one question, on Top Pilots All Time (Hours Flown)the code count the totalhours, in my case i have old data from the old site like tranferhours, whow can i include totalhours + transferhours. Thanks and regards Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted May 10, 2010 Moderators Report Share Posted May 10, 2010 2.0 coming along Im liking the look of that.... a lot! Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted May 11, 2010 Author Administrators Report Share Posted May 11, 2010 Excelent mod Simpilot, only one question, on Top Pilots All Time (Hours Flown)the code count the totalhours, in my case i have old data from the old site like tranferhours, whow can i include totalhours + transferhours. Thanks and regards I will work on putting that together, should not be a big deal. I am working on my new VA this week but I should have something out by the weekend. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted May 11, 2010 Report Share Posted May 11, 2010 I get this error: Top Pilots All Time (Flights Flown) Warning: Invalid argument supplied for foreach() in /home/woodsdom/public_html/CPC/core/templates/tp_index.tpl on line 24 Pilot Flights Flown And also this: Top Pilots All Time (Hours Flown) Warning: Invalid argument supplied for foreach() in /home/woodsdom/public_html/CPC/core/templates/tp_index.tpl on line 41 Pilot Hours Flown Line 24 is: foreach($all_flights as $all) { Line 41 is: foreach($all_hours as $all) { Not sure what I need to do to fix it. Here is the link to the page, if that helps: http://www.canadianclassicairlines.com/CPC/index.php/TopPilot Quote Link to comment Share on other sites More sharing options...
CPC900 Posted May 11, 2010 Report Share Posted May 11, 2010 BTW, there is NO data in the database, after running the sql script?! Not sure if there should be or not?! Quote Link to comment Share on other sites More sharing options...
CPC900 Posted May 12, 2010 Report Share Posted May 12, 2010 Ok, fixed the problem.... I had to change the references of : "phpvms_pireps" to my own database names (I don't use the "phpvms_" part but something else). My other question is.....can transferred hours be accounted for in the Top Pilots Hours Flown?? 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.