Rickisani Posted November 22, 2011 Report Posted November 22, 2011 I've tried to install the TouchdownStats, get the following message: Warning: Invalid argument supplied for foreach() in /var/www/html/web907/html/freedomair/core/templates/touchdownstats/touchdownstats_index.tpl on line 21 I have the pireps will file manually, here and read the tread but what it does not work for me. can anyone help me what files must I change in as Quote
Administrators simpilot Posted November 23, 2011 Author Administrators Report Posted November 23, 2011 Are all your PIREP's manually reported? Check the database amd see if there are any figures in the landing rate coloumn of the PIREPs table. Manual PIREP's do not have a landing rate recorded. Quote
Rickisani Posted November 23, 2011 Report Posted November 23, 2011 in the database are those landing rate at "0", what must I change there Quote
Administrators simpilot Posted November 24, 2011 Author Administrators Report Posted November 24, 2011 You must be submitting manual PIREP's, they do not have a landing rate, it just defaults to 0. You will need to use some kind of ACARS reporting system in order to record landing rates. Quote
mattia Posted January 3, 2012 Report Posted January 3, 2012 How about something like this Mark; Add to TouchdownstataData.class.php function get_averages($howmany) { $avg = array(); $pilots = PilotData::findPilots(array('retired' => '0')); foreach($pilots as $pilot) { $query = "SELECT AVG(landingrate) as average, pilotid FROM ".TABLE_PREFIX."pireps WHERE landingrate < '0' AND pilotid='$pilot->pilotid'"; $result = DB::get_row($query); if($result->pilotid != '') {$avg[] = $result;} } rsort($avg); return array_slice($avg, '0', $howmany); } Add to TouchdownStats.php function averages($howmany) { $this->set('stats', TouchdownStatsData::get_averages($howmany)); $this->show('touchdownstats/touchdownstats_averages.tpl'); } Add a new template in core/templates/touchdownstats called touchdownstats_averages.tpl <h3>Best Average Landing Rate</h3> <?php if($stats) { echo '<table>'; echo '<tr>'; echo '<th>Landing Rate</th>'; echo '<th>Pilot</th>'; echo '</tr>'; foreach($stats as $stat) { $pilot = PilotData::getPilotData($stat->pilotid); echo '<tr>'; echo '<td>'.round($stat->average, 1).'</td>'; echo '<td>'.PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname.'</td>'; echo '</tr>'; } echo '</table>'; } else { echo 'No Stats Available'; } ?> Then call it by url and pass how many records you want as the last element http://www.yoursite.com/index.php/touchdownstats/averages/10 or within another template <?php MainController::run('touchdownstats', 'averages', '10'); ?> Hi Dave! does not work for me, no result, only exits "No Stats Available" http://s3.imagestime.com/out.php/i631825_Immagine.png thanks and happy new year Quote
Cor Posted February 2, 2012 Report Posted February 2, 2012 Hi Simpilot, I have a problem with the montly stat. This is the code that is use in the Touchdownstatsdata.class public function get_stats_by_cur_month_limited($howmany){ $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' AND YEAR(submitdate)=YEAR(curdate()) AND MONTH(submitdate)=MONTH(curdate()) ORDER BY landingrate DESC" LIMIT $howmany"; At the page its showing also the landigsrate of februari 2011. Can you or somebody else help me. Tnx in advange, regards, Cor Quote
Administrators simpilot Posted February 5, 2012 Author Administrators Report Posted February 5, 2012 Has this corrected itself? I am guessing it was a conflict when the month turned over between the server time and PIREP times. Quote
SteveK Posted April 1, 2012 Report Posted April 1, 2012 is there any chance that someone can help me? im trying to remove duplicates that are shown example this is what my stats look like at the moment pilot1 -57 pilot3 -59 pilot2 -125 pilot1 -132 pilot3 -138 pilot2 -148 this is what i would like it to look like pilot1 -57 pilot3 -59 pilot2 -125 ect ect please help as the top 20 list that i have is full of the same 3 pilots thanks Steve Quote
Jeff Posted April 1, 2012 Report Posted April 1, 2012 That's never going to happen since the TD Stats shows the best landings of All Time. pilot1 -57 ---> Best landing ever pilot3 -59 ---> 2nd best landing pilot2 -125 --->3rd best landing pilot1 -132 --->4th best landing pilot3 -138 --->5th best landing pilot2 -148 --->6th best landing It doesn't matter who the pilot is, it only matters what the best landing is, so that's what it is going to show. Quote
SteveK Posted April 1, 2012 Report Posted April 1, 2012 is there any addon that could be edited or made to just show 1 landing rate per pilot then? Quote
michael Kraan Posted April 8, 2012 Report Posted April 8, 2012 He i have a error? Notice: The template file "/home/lufthan1/public_html//core/templates/touchdownstats/touchdownstats_index.tpl" doesn't exist in /home/lufthan1/public_html/core/classes/TemplateSet.class.php on line 248 how can i fix this? greets Michael Kraan Quote
Industrialshadow Posted April 9, 2012 Report Posted April 9, 2012 Hi where can i find the zip file? i dont see any file here thanks Quote
flyalaska Posted May 22, 2012 Report Posted May 22, 2012 How can you make to display a text " No Flights" if the pilot hasn't flown yet on the pilots average landing rate? Now if the pilot has no flights it shows an error. I am using this to display the pilots average landing rate in the public profile. <?php echo ''.round(TouchdownStatsData::pilot_average($userinfo->pilotid), 2); ?> Quote
Administrators simpilot Posted May 22, 2012 Author Administrators Report Posted May 22, 2012 I have change dthe code a little in TouchdownstatsData.class.php to solve the error and return a '0' instead of an error. It has been updated on GitHub to reflect the following. public function pilot_average($pilotid) { $stats = self::pilot_stats($pilotid); $total = 0; $count = 0; if(!empty($stats)) { foreach ($stats as $stat) { $total = $total + $stat->landingrate; $count++; } return $total / $count; } else {return '0';} } You could do something like this in your template to get the 'No Flights' message; <?php $avg_rate = TouchdownStatsData::pilot_average($userinfo->pilotid); if($avg_rate == '0') {echo 'No Flights';} else {echo round($avg_rate, 2);} ?> Quote
Ariel Posted May 30, 2012 Report Posted May 30, 2012 How are you including it on your frontpage? something like <?php MainController::run('touchdownstats', 'index'); ?> should be all you need if the data is there. you might want to include this to your HOW TO INSTALL section...took me hours to find this....had to read through all the pages...and this was all i needed!! THANX Quote
flyalaska Posted May 31, 2012 Report Posted May 31, 2012 I believe it's already in the install guide. Quote
Ariel Posted May 31, 2012 Report Posted May 31, 2012 I believe it's already in the install guide. not the maincontroller code Quote
smeely Posted July 2, 2012 Report Posted July 2, 2012 I can't seem to see the attachment I am supposed to download Quote
flyalaska Posted July 3, 2012 Report Posted July 3, 2012 I can't seem to see the attachment I am supposed to download https://github.com/DavidJClark Quote
ARV187 Posted May 22, 2013 Report Posted May 22, 2013 I have a issue with this addon, In logs of pilots you can see a descent rate, but in admin page/recent pireps have different data. Touchdown stats give the admin/recent pireps value. Pilot #1 In LOG: 16:10 Flaps:3 at 242 Knots 16:13 Flaps:4 at 218 Knots 16:16 TouchDown:Rate -923 ft/min Speed: 204 Knots 16:17 Land In admin recent pireps: No additional data found Client: fsacars Aircraft: B747-400 (A002) Flight Time: 02:45:00 Distance: 801 Landing Rate: 0 Pilot #2 In LOG: 09:14 Flaps:7 at 180 Knots 09:14 Flaps:8 at 174 Knots 09:20 TouchDown:Rate -381 ft/min Speed: 152 Knots 09:20 Land In admin recent pireps: No additional data found Client: fsacars Aircraft: B747-400 (A002) Flight Time: 01:45:00 Distance: 672 Landing Rate: -3 How i can fix this? its impossible win with this descent rates Regards Quote
Administrators simpilot Posted May 22, 2013 Author Administrators Report Posted May 22, 2013 @ARV187 This is not really an issue with the Touchdown Stats module as it only grabs the info that is in the pireps database. I would take a look at what is actually in the landing rate column of your PIREPS table and go backwards from there. I would guess it is how your ACARS log is being parsed or you have manually changed some pilot id's somewhere along the way and flights are getting crossed up between pilots. Quote
ARV187 Posted May 23, 2013 Report Posted May 23, 2013 Seems that only occurs sometimes with fsacars, has not changed the pilot id after their first flight, then could be the parsed data how you said. We only changed to pay hosting, but I think that should not affect. phpvms_pireps.sql.zip Another curiosity, with ifly 737-800, fsPassengerX only show this: CompanyName=ARGAVIRTUAL<br />nPilotName=ARV0006<br />nFlightId=ARV1434<br />nOnlineNetworkNbr=0<br />nFlightDate=2013-05-22<br />nAircraftName=iFly 737-800 (Normal screen) bar But apparently sends all data to database. Curious, its not it? Quote
Administrators simpilot Posted May 24, 2013 Author Administrators Report Posted May 24, 2013 Seems that only occurs sometimes with fsacars You need to look at issues with FSAcars then, I do not think the TouchdownStats module is the cause. Quote
ARV187 Posted May 24, 2013 Report Posted May 24, 2013 Ok, thanks!!. If i want reset the stadistics, how i can do it? Quote
Administrators simpilot Posted May 25, 2013 Author Administrators Report Posted May 25, 2013 Not really sure what you want to reset. If you want to erase all your PIREPS you could just trunacate the table from phpmyadmin or similar. If you want to set all the landing rates back to 0 then run a sql query to reset them -> somthing like -> UPDATE table SET landingrate = 0; Quote
ARV187 Posted May 25, 2013 Report Posted May 25, 2013 Landing rates resets to 0 with sql query. Thanks you very much!! Quote
Omerr01 Posted November 1, 2013 Report Posted November 1, 2013 How i can limit the number of the tochdownstats 10 pilots to 5 pilot. Quote
Administrators simpilot Posted November 4, 2013 Author Administrators Report Posted November 4, 2013 How i can limit the number of the tochdownstats 10 pilots to 5 pilot. Not sure exactly what you are looking for but the function "top_landings($howmany)" will return the top landings in order and limit it by the "$howmany" variable. 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.