gosox116 Posted January 10, 2010 Report Posted January 10, 2010 I've already looked at the simpilot post with his landingstats module, but all of the versions and modifications just confused me. From step one, how can I get a greased landing box (top 10 with aircraft types and pilot names) WITH VERSION 2.085 on my homepage? Thanks a ton!! Quote
Administrators simpilot Posted January 11, 2010 Administrators Report Posted January 11, 2010 EDIT - Download removed This function is now included in version 2.0. You can just use a sql select to gather the data out of the pireps table and then sort and display as you would like. 1. Download the attached package 2. unzip and place the files in the paths as defined in the package 3. use the landing_stats.sql file to create the two new columns in your database using phpmyadmin or similar. 4. file a pirep, manual or automated, it does not mattter, even if it is a test and you will delete it later. This will populate the DB for the first time. After the initial run of the module it will re-run each time a pirep is filed and update the listings. 5. Place the following code where you want the table to display. <?php MainController::Run('Landingstats', 'display_landingstats', '8'); ?> 6. Done This should produce something like this -> Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 Wait, Dave, the landing rate is pulled out by ACARS into the landing rate column already (I included that as a default). Or did you already account for that? Quote
Administrators simpilot Posted January 11, 2010 Administrators Report Posted January 11, 2010 No I did not, but I have not gotten the default landingstat to work on any of my sites yet. The column is always a zero. I looked through the PirepData and can not find the code where it should be pulling the stat out - All i see is around line 580 where it is looking for it and setting it to 0 if it is not there.... So i modified my old code to work with the newer version. I will take it down until I figure it out. Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 No I did not, but I have not gotten the default landingstat to work on any of my sites yet. The column is always a zero. I looked through the PirepData and can not find the code where it should be pulling the stat out - All i see is around line 580 where it is looking for it and setting it to 0 if it is not there.... So i modified my old code to work with the newer version. I will take it down until I figure it out. It's in the individual acars connector files in core/modules/acars Quote
Administrators simpilot Posted January 11, 2010 Administrators Report Posted January 11, 2010 hmmm.. I will have to do some more digging to figure out what is wrong on my end then. I have updtated everything including the ini files for fsacars... ??? Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 Weird, from the testing we were doing the field was being populated. I hadn't included any of your display code on the client side though, so that could be an addon Quote
TennShadow Posted January 24, 2010 Report Posted January 24, 2010 I'm confused on this one. I have the code put where I want it but nothing shows up. I see the landing rates in the pireps but none of the landingstats tpl files are included in the new release. I'm guessing I need to download them but the attachment is gone stating that everything is included in the new release? So, as you can see, I'm confused. :-[ Quote
Administrators Nabeel Posted January 24, 2010 Administrators Report Posted January 24, 2010 I think in another thread the column was still refernced as landing_stat when its landingrate, so you have replace all instances with that Quote
TennShadow Posted January 24, 2010 Report Posted January 24, 2010 What are the .tpl files called so I can find the varibles and replace them? This is where I'm confused. Are they included in this release or are you talking about changing the below. Change this <?php MainController::Run('Landingstats', 'display_landingstats', '8'); ?> to <?php MainController::Run('Landingrate', 'display_landingrate', '8'); ?> Quote
Administrators Nabeel Posted January 24, 2010 Administrators Report Posted January 24, 2010 The addon isn't included, only the back-end data collection peice. The rest, with the front-page display, isn't. I'm not sure what tpls they are, I imagine they'd be as part of the download. Quote
TennShadow Posted January 24, 2010 Report Posted January 24, 2010 Ok, thanks... I've seen the light! What was confusing me was the below quote from Simpilot. EDIT - Download removedThis function is now included in version 2.0. You can just use a sql select to gather the data out of the pireps table and then sort and display as you would like. Quote
savagegrave Posted May 30, 2010 Report Posted May 30, 2010 Hiya I would like to use the Greased Landings, but like some other noobs here I have limited knowledge of php and mysql. I can see the downloads have been removed due to version 2 having it "pre-installed".... does the following code <?php MainController::Run('Landingstats', 'display_landingstats', '8'); ?> do this or is there othercoding required? Sorry to ask a silly question but after hours of reading these postings I'm on the verge of being very confused..... Thanks for you time Steve Quote
Administrators simpilot Posted May 30, 2010 Administrators Report Posted May 30, 2010 Ok Guys, I will write a version 2 class in order to display the info out of the database. Give me a day and I will post something in the Addons forum. Quote
llju1 Posted May 30, 2010 Report Posted May 30, 2010 Will this work with Kacars? Because all my Pilots use Kacars for their Pireps Quote
TennShadow Posted May 30, 2010 Report Posted May 30, 2010 Will this work with Kacars? Because all my Pilots use Kacars for their Pireps It should. I'm using v1 and it works fine with KACARS. Quote
llju1 Posted May 30, 2010 Report Posted May 30, 2010 It should. I'm using v1 and it works fine with KACARS. Ok thanks. do I just need to add <?php MainController::Run('Landingstats', 'display_landingstats', '8'); ?> To my frontpagetpl? Quote
Jeff Posted May 30, 2010 Report Posted May 30, 2010 How about FSPassengers... will it also be available to pull it from there as well? Quote
TennShadow Posted May 30, 2010 Report Posted May 30, 2010 How about FSPassengers... will it also be available to pull it from there as well? Yep, it will. You don't get Live Map ability with FSPax. Keith Quote
Administrators simpilot Posted May 30, 2010 Administrators Report Posted May 30, 2010 Try this guys, basic but I think it is what you are looking for. http://forum.phpvms.net/topic/2989-touchdownstats-10/ 1 Quote
Jeff Posted May 31, 2010 Report Posted May 31, 2010 Yep, it will. You don't get Live Map ability with FSPax. Keith Yeah, unfortunately, I knew that already and accounted the fact that I just completely removed the Live Map link from my site since FSPassengers is all we use anyways. I now just use google maps to show routes instead of current flights in progress. Quote
llju1 Posted May 31, 2010 Report Posted May 31, 2010 I have <?php MainController::Run('Landingstats', 'display_landingstats', '8'); ?> on my frontpage.tpl But it just shows Top Ten Landings Pilot ID Arrival Field Touchdown Rate 0000 ft/min so what am I missing? Quote
Administrators simpilot Posted May 31, 2010 Administrators Report Posted May 31, 2010 I have <?php MainController::Run('Landingstats', 'display_landingstats', '8'); ?> on my frontpage.tpl But it just shows Top Ten Landings Pilot ID Arrival Field Touchdown Rate 0000 ft/min so what am I missing? Looks like you have the old LandingStats module which does not work with 2.1 without some modification. There is a link to a newer TouchdownStats module eariler in the thread that works with 2.1 1 Quote
llju1 Posted June 1, 2010 Report Posted June 1, 2010 (edited) Looks like you have the old LandingStats module which does not work with 2.1 without some modification. There is a link to a newer TouchdownStats module eariler in the thread that works with 2.1 I have found this link http://forum.phpvms....chdownstats-10/ in the earlier thread and it works for a separate Landing stats page What do I need to display it in a box on my fronpage.i.e. just to show the PID the Airport and the landing rate. I am sure some it must be simple to do but I am old and confused I guess is how do I show in on my front page tpl like you have at Westjets? Edited June 1, 2010 by llju1 Quote
Administrators simpilot Posted June 2, 2010 Administrators Report Posted June 2, 2010 You should be able to just use -> <?php MainController::Run('TouchdownStats', 'top_landings', '5'); ?> within your template and it will show the table. You can adjust the view in the touchdownstats_index.tpl file as to what/how you want to see things. Quote
llju1 Posted June 2, 2010 Report Posted June 2, 2010 You should be able to just use -> <?php MainController::Run('TouchdownStats', 'top_landings', '5'); ?> within your template and it will show the table. You can adjust the view in the touchdownstats_index.tpl file as to what/how you want to see things. Thanks I knew it was something simple like that. I had some of it worked out but could not get it all worked out. Again thanks Quote
llju1 Posted June 4, 2010 Report Posted June 4, 2010 one Last(I hope ) silly question. How do I sort by month or can I? I am sure that it must be a mod of these lines in the core/TouchdownStats.php public function top_landings($howmany) { $this->set('stats', TouchdownStatsData::get_stats($howmany)); $this->show('touchdownstats/touchdownstats_index.tpl'); } I am sure it must be by changing the ($howmany ) to month or something. Thanks in advance Lloyd Quote
Administrators simpilot Posted June 5, 2010 Administrators Report Posted June 5, 2010 The stats module on WestJets is actually a very modified version of the the orignal VAStatsData module I put together about a year ago. I dont think it would be wise to post that code as it is connected to other custom classes and db tables within WestJets and would be a mess. What you could/should do is add another sql query to TouchdownStatsData.class.php to pull the unique month you want and then sort as you wish. Dont forget to add the year into the query as well, or you will have a mess when you get to looking at a month that has stats for multiple years. Quote
llju1 Posted June 5, 2010 Report Posted June 5, 2010 Ok here is what I now have on the TopPilotData.class.php. <?php //simpilotgroup addon module for phpVMS virtual airline system // //simpilotgroup addon modules are licenced under the following license: //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) //To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/ // //@author David Clark (simpilot) //@copyright Copyright (c) 2009-2010, David Clark //@license http://creativecommons.org/licenses/by-nc-sa/3.0/ class TouchdownStatsData extends CodonData { public function get_all_stats() { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' ORDER BY landingrate DESC"; return DB::get_results($query); } public function get_stats($howmany) { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' ORDER BY landingrate DESC LIMIT $howmany"; return DB::get_results($query); } public function get_stats($month,$year) { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' ORDER BY landingrate DESC LIMIT $month,$year"; return DB::get_results($query); } } And on the TouchdownStats.php I have this. <?php //simpilotgroup addon module for phpVMS virtual airline system // //simpilotgroup addon modules are licenced under the following license: //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) //To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/ // //@author David Clark (simpilot) //@copyright Copyright (c) 2009-2010, David Clark //@license http://creativecommons.org/licenses/by-nc-sa/3.0/ class TouchdownStats extends CodonModule { public function index() { $this->set('stats', TouchdownStatsData::get_all_stats()); $this->show('touchdownstats/touchdownstats_index.tpl'); } public function top_landings($howmany) { $this->set('stats', TouchdownStatsData::get_stats($howmany)); $this->show('touchdownstats/touchdownstats_index.tpl'); } public function top_landings($month,$year) { $this->set('stats', TouchdownStatsData::get_stats($month,$year)); $this->show('touchdownstats/touchdownstats_index.tpl'); } } and I get this error. Fatal error: Cannot redeclare TouchdownStats::top_landings() in /hermes/web06b/b338/pow.llju1/htdocs/core/modules/TouchdownStats/TouchdownStats.php on line 24 so what am I doing wrong? thanks in advance Lloyd Quote
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.