TAV1702 Posted March 5, 2011 Report Posted March 5, 2011 I believe some time ago Nabeel integrated this into the default install. Am I correct in saying that? And if so, do we still need this module to get his version to work? I tried the original version but could never get the table or the database to populate the info. I am wanting to add top landings to my site just not sure how to go about it now. Is this module now deprecated? Quote
flyalaska Posted March 6, 2011 Report Posted March 6, 2011 The download link is on the start of the post. Quote
TAV1702 Posted March 6, 2011 Report Posted March 6, 2011 Thanks for the reply flyalaska. What I am curious of is do we still need to use this module or can we use regular code now? I know Nabeel put these stats in as default. I thought I had read that Simpilot said this module is deprecated now. Quote
Administrators simpilot Posted March 7, 2011 Author Administrators Report Posted March 7, 2011 The old LandingStats module is no longer needed, it had the code to catch pireps and extract the landing rate which has been rolled into the main application. The landing stats module is just a way to extract the data from the table and have a few displays. 1 Quote
TAV1702 Posted March 7, 2011 Report Posted March 7, 2011 The old LandingStats module is no longer needed, it had the code to catch pireps and extract the landing rate which has been rolled into the main application. The landing stats module is just a way to extract the data from the table and have a few displays. I went and grabbed the file from the first post and sure enough, it is exactly as you say. Worked like a charm. Thanks for the reply. I appreciate it. +1 Quote
5SA CEO Posted March 16, 2011 Report Posted March 16, 2011 Hi guys, got touchdown in and is running and displaying stats for the guys who are flying FSpax only and not the Xacars guys. I have checked the pireps and those who are using Xacars show a landing rate of 0 and the guys with FSpax show -168 for example, any ideas on how to get the data from Xacars? cheers. Deano Quote
Cor Posted March 17, 2011 Report Posted March 17, 2011 As far as I understand it. Xacars does not log the landing rate. Regards, Cor Quote
TAV1702 Posted March 21, 2011 Report Posted March 21, 2011 The function does not return anything to echo, it returns a variable filled with the info you requested. An example to use it would be to set the variable, preferably in your module: $this->set('myvariable', TouchdownStatsData::get_stats('5')); Then in your template use a foreach command to show what data you want to display: foreach($myvariable as $variable) { Do Stuff } To see what is available to echo do a: print_r($myvariable); in your template. If you want to call the data within the template just do: $myvariable = TouchdownStatsData::get_stats('5'); in your template before you need the info. You know, from time to time the strangest of things happen. I have been struggling with this stuff (phpVMS)for a year or more now. And now somehow, after reading this very post, it just clicked in my head what each part does and how to use it. I can t believe it took me this long. Better late than never I suppose. The funny part is, I bet I have read this very post no less then 20 times. Since I have my hubs broken up in to individual pages, I am going to attempt to extract the data to those hub pages that show the landing rate for that hubs pilots only. Think this plan of mine will work? Quote
vazquezjm Posted May 2, 2011 Report Posted May 2, 2011 Hi! I'm trying to filter results by aircraft, and added the following code to TouchdownStats.php: public function by_aircraft($aircraftId) { $this->set('stats', TouchdownStatsData::by_aircraft($aircraftId)); $this->show('touchdownstats/touchdownstats_index.tpl'); } and this code to TouchdownStatsData.class.php: public function get_stats_by_aircraft($aircraftId) { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' AND aircraft = $aircraftId ORDER BY landingrate DESC"; return DB::get_results($query); } When I invoke the listing (/index.php/Touchdownstats/by_aircraft/2), I get: Fatal error: Call to undefined method TouchdownStatsData::get_stats_by_aircraft() in .../core/modules/TouchdownStats/TouchdownStats.php on line 25 What am I missing? Quote
Administrators simpilot Posted May 3, 2011 Author Administrators Report Posted May 3, 2011 In your class you are calling "by_aircraft" But in your data model you have named the function "get_stats_by_aircraft" Quote
vazquezjm Posted May 3, 2011 Report Posted May 3, 2011 In your class you are calling "by_aircraft" But in your data model you have named the function "get_stats_by_aircraft" That's why!! Quote
Jeff Posted May 10, 2011 Report Posted May 10, 2011 Error! , please help me Well...without you posting any information of what LINE 21 is then maybe you can check your code against mine to see what your problem may be. <?php if(Auth::LoggedIn() == false) { echo 'You must be logged in to view this page!'; return; } ?> <?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/ ?> <table width="100%" border="1" bgcolor="#042233"> <tr> <td align = "center"><b><font color="#CCCCCC">Pilot</b></td> <td align = "center"><b><font color="#CCCCCC">Aircraft</b></td> <td align = "center"><b><font color="#CCCCCC">Arrival Field</b></td> <td align = "center"><b><font color="#CCCCCC">Landing Rate</b></td> <td align = "center"><b><font color="#CCCCCC">Date Posted</b></td> </tr> <?php foreach($stats as $stat) { $pilot = PilotData::getPilotData($stat->pilotid); $aircraft = OperationsData::getAircraftInfo($stat->aircraft); echo '<tr>'; echo '<td align = "center"><font color="#CCCCCC">'.PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.$aircraft->fullname.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.$stat->arricao.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.$stat->landingrate.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.date(DATE_FORMAT, strtotime($stat->submitdate)).'</td>'; echo '</tr>'; } ?> </table> You do not need to have this code in there. I just use it for members eyes only. <?php if(Auth::LoggedIn() == false) { echo 'You must be logged in to view this page!'; return; } ?> Quote
SkilledPilotA320 Posted May 10, 2011 Report Posted May 10, 2011 Well...without you posting any information of what LINE 21 is then maybe you can check your code against mine to see what your problem may be. <?php if(Auth::LoggedIn() == false) { echo 'You must be logged in to view this page!'; return; } ?> <?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/ ?> <table width="100%" border="1" bgcolor="#042233"> <tr> <td align = "center"><b><font color="#CCCCCC">Pilot</b></td> <td align = "center"><b><font color="#CCCCCC">Aircraft</b></td> <td align = "center"><b><font color="#CCCCCC">Arrival Field</b></td> <td align = "center"><b><font color="#CCCCCC">Landing Rate</b></td> <td align = "center"><b><font color="#CCCCCC">Date Posted</b></td> </tr> <?php foreach($stats as $stat) { $pilot = PilotData::getPilotData($stat->pilotid); $aircraft = OperationsData::getAircraftInfo($stat->aircraft); echo '<tr>'; echo '<td align = "center"><font color="#CCCCCC">'.PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.$aircraft->fullname.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.$stat->arricao.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.$stat->landingrate.'</td>'; echo '<td align = "center"><font color="#CCCCCC">'.date(DATE_FORMAT, strtotime($stat->submitdate)).'</td>'; echo '</tr>'; } ?> </table> You do not need to have this code in there. I just use it for members eyes only. <?php if(Auth::LoggedIn() == false) { echo 'You must be logged in to view this page!'; return; } ?> THNXXXXX!!!! WORKED FOR ME ))) Quote
Allan Posted June 1, 2011 Report Posted June 1, 2011 How would I display this in the pilot center??? I would also like to show it in the Pilot Public Profile, Thanks for the help Regards, Quote
Francisco Posted June 9, 2011 Report Posted June 9, 2011 Hello, I have the problem on line 21 of the field: touchdownstats_index.tpl. Somebody help to me? please Picture: Thanks so Much, Kind Regards. Quote
Moderators mark1million Posted June 9, 2011 Moderators Report Posted June 9, 2011 Do you have filed flights in the database? Quote
Francisco Posted June 9, 2011 Report Posted June 9, 2011 Do you have filed flights in the database? Hello, Mark, I don't have flight in DB, only i have installer the SQL. Is this the problem, that i don't have flights? Kind Regards! Quote
Moderators mark1million Posted June 9, 2011 Moderators Report Posted June 9, 2011 Yes, as soon as there is a flight in the system that will go away. Quote
Francisco Posted June 9, 2011 Report Posted June 9, 2011 Okay, thanks so much Mark! Another thing, as I can I put the map of flights above? Kinds Regards. Quote
Moderators mark1million Posted June 9, 2011 Moderators Report Posted June 9, 2011 This may help, http://forum.phpvms.net/topic/3358-gcmap-great-circle-mapper/ Quote
Francisco Posted June 9, 2011 Report Posted June 9, 2011 This may help, http://forum.phpvms.net/topic/3358-gcmap-great-circle-mapper/ Hello Mark, Yes, I have a problem with frontpage_main.tpl and I think that the problem is the '<div>' Picture: CODE (frontpage_main.tpl): <div id="mainbox"> <h3>Bienvenido a Fly Green Virtual<h3> </div> <div id="mainbox"> <?php $flights = PIREPData::getRecentReportsByCount(10); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=650x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /><br /> Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl L. Swartz</a> <div> </div> <div id="mainbox"> <?php // Show the News module, call the function ShowNewsFront // This is in the modules/Frontpage folder MainController::Run('News', 'ShowNewsFront', 5); ?> </div> <div id="sidebar"> <div class="mcbox01"> <div class="mc01t2"> Acceso </div> <div class="mc01cc"> <p> <?php /* Quick example of how to see if they're logged in or not Only show this login form if they're logged in */ if(Auth::LoggedIn() == false) { ?> <form name="loginform" action="<?php echo url('/login'); ?>" method="post"> <p>Log in to your pilot center or <a href="<?php echo url('/registration'); ?>">register</a><br /> <input type="text" name="email" value="Email/Pilot ID" onClick="this.value=''" /> </p> <p> <input type="password" name="password" value="Password" /> </p> <p> <input type="hidden" name="remember" value="on" /> <input type="hidden" name="redir" value="index.php/profile" /> <input type="hidden" name="action" value="login" /> <input type="submit" name="submit" value="Log In" /> </p> </form> <p> <?php } /* End the Auth::LoggedIn() if */ else /* else - they're logged in, so show some info about the pilot, and a few links */ { /* Auth::$userinfo has the information about the user currently logged in We will use this next line - this gets their full pilot id, formatted properly */ $pilotid = PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid); ?> <strong>Pilot ID: </strong> <?php echo $pilotid ; ?> <strong>Rank: </strong><?php echo Auth::$userinfo->rank;?><br /> <strong>Total Flights: </strong><?php echo Auth::$userinfo->totalflights?>, <strong>Total Hours: </strong><?php echo Auth::$userinfo->totalhours;?> <br /> <a href="<?php echo url('/pireps/new');?>">File a New PIREP</a></p> <p><a href="<?php echo url('/schedules/bids');?>">View My Bids</a></p> <p><a href="<?php echo url('/profile/');?>">View Pilot Center</a><?php } /* End the else */ ?> </p> <p> <?php MainController::Run('Mail', 'checkmail'); ?> </p> <div class="mc01b"> <img src="http://flygreenva.com/img_272.jpg" alt="" /> </div> </div> <div class="mcbox01"> <div class="mc01t2"> Spotting </div> <div class="mc01cc"> <?php Screenshots::show_random_screenshot(); ?> <div align="center"><img src="http://flygreenva.com/img_272.jpg" alt="" /> </div> </div> <div class="mcbox01"> <div class="mc01t2"> Usuarios On line </div> <div class="mc01cc"> <p><i>HabÃa <?php echo count($usersonline)?> usuario(s), y <?php echo count($guestsonline);?> visitante(s) On line hace <?php echo Config::Get('USERS_ONLINE_TIME')?> minutos.</i></p> <?php /* $usersonline also has the list of users - really simple example Or if you're not on the frontpage: $usersonline = StatsData::UsersOnline(); foreach($usersonline as $pilot) { echo "{$pilot->firstname} {$pilot->lastname}<br />"; } */ ?> <div align="center"><img src="http://flygreenva.com/img_272.jpg" alt="" /> </div> </div> </div> <div align="center"> <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> </div> <fb:like-box href="http://www.facebook.com/pages/Fly-Green-Virtual/233652459983234" width="205" show_faces="true" border_color="#298625" stream="false" header="false"></fb:like-box> </div> Kind Regards. Quote
Moderators mark1million Posted June 12, 2011 Moderators Report Posted June 12, 2011 Take a look at those dive on line 3 and also below the map code you have an empty div there fir no reason, your right it is a div issue just finding the right one As a start get rid of that div id mainbox extra one so remove lines 3 and 4 Quote
Francisco Posted June 12, 2011 Report Posted June 12, 2011 Take a look at those dive on line 3 and also below the map code you have an empty div there fir no reason, your right it is a div issue just finding the right one As a start get rid of that div id mainbox extra one so remove lines 3 and 4 Hello Mark, the problem was solved, now i have the problem with the table of info pilot: <style type="text/css"> <!-- .Estilo1 {font-size: 10px} --> </style> <div id="mainbox"> <h3>Vuelos Recientes</h3> <div align="left"> <?php $flights = PIREPData::getRecentReportsByCount(10); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <img src="http://www.gcmap.com/map?P=&MS=bm&MP=RECT&MR=350x350&PM=pemr:star10:white%2b%22%25I%22:white&PC=orange" /><br /> <span class="Estilo1"> Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl L. Swartz</a></span> <?php $count = 15; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table width="94%" border="0" bordercolor="#FFFFFF"> <thead> <tr align="center" valign="middle" bgcolor="#7D95AF"> <th>Flight #</th> <th>Departure</th> <th>Arrival</th> <th>Duration</th> <th>Pilot</th> <th>Landing Rate</th> <th>Aircraft</th> </tr> </thead> <tbody> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); echo "<tr>"; echo "<td align=center> $pirep->code $pirep->flightnum </td>"; echo "<td align=center> $pirep->depicao </td>"; echo "<td align=center> $pirep->arricao </td>"; echo "<td align=center> $pirep->flighttime </td>"; echo "<td align=center> $pilotid $pilotinfo->firstname $pilotinfo->lastname </td>"; echo "<td align=center> $pirep->landingrate </td>"; echo "<td align=center> $pirep->aircraft </td>"; echo "</tr>"; } } else { echo "<tr><td>There are no recent flights!</td></tr>"; } ?> <?php // Show the News module, call the function ShowNewsFront // This is in the modules/Frontpage folder MainController::Run('News', 'ShowNewsFront', 5); ?> </div> </div> </div> <div id="sidebar"> <div class="mcbox01"> <div class="mc01t2"> Acceso </div> <div class="mc01cc"> <p> <?php /* Quick example of how to see if they're logged in or not Only show this login form if they're logged in */ if(Auth::LoggedIn() == false) { ?> <form name="loginform" action="<?php echo url('/login'); ?>" method="post"> <p> Sí aú no estas registrado</p> <p>registrate <a href="<?php echo url('/registration'); ?>">aquí</a>.<br /> <input type="text" name="email" value="FLE" onClick="this.value=''" /> </p> <p> <input type="password" name="password" value="Password" /> </p> <p> <input type="hidden" name="remember" value="on" /> <input type="hidden" name="redir" value="index.php/profile" /> <input type="hidden" name="action" value="login" /> <input type="submit" name="submit" value="Log In" /> </p> </form> <p> <?php } /* End the Auth::LoggedIn() if */ else /* else - they're logged in, so show some info about the pilot, and a few links */ { /* Auth::$userinfo has the information about the user currently logged in We will use this next line - this gets their full pilot id, formatted properly */ $pilotid = PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid); ?> <strong>Pilot ID: </strong> <?php echo $pilotid ; ?> <strong>Rank: </strong><?php echo Auth::$userinfo->rank;?><br /> <strong>Total Flights: </strong><?php echo Auth::$userinfo->totalflights?>, <strong>Total Hours: </strong><?php echo Auth::$userinfo->totalhours;?> <br /> <a href="<?php echo url('/pireps/new');?>">File a New PIREP</a></p> <p><a href="<?php echo url('/schedules/bids');?>">View My Bids</a></p> <p><a href="<?php echo url('/profile/');?>">View Pilot Center</a><?php } /* End the else */ ?> </p> <p> <?php MainController::Run('Mail', 'checkmail'); ?> </p> <div class="mc01b"> <img src="http://flygreenva.com/img_272.jpg" alt="" /> </div> </div> <div class="mcbox01"> <div class="mc01t2"> Spotting </div> <div class="mc01cc"> <?php Screenshots::show_random_screenshot(); ?> <div align="center"><img src="http://flygreenva.com/img_272.jpg" alt="" /> </div> </div> <div class="mcbox01"> <div class="mc01t2"> Usuarios On line </div> <div class="mc01cc"> <p><i>HabÃa <?php echo count($usersonline)?> usuario(s), y <?php echo count($guestsonline);?> visitante(s) On line hace <?php echo Config::Get('USERS_ONLINE_TIME')?> minutos.</i></p> <?php /* $usersonline also has the list of users - really simple example Or if you're not on the frontpage: $usersonline = StatsData::UsersOnline(); foreach($usersonline as $pilot) { echo "{$pilot->firstname} {$pilot->lastname}<br />"; } */ ?> <div align="center"><img src="http://flygreenva.com/img_272.jpg" alt="" /> </div> </div> </div> <div align="center"> <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> </div> <fb:like-box href="http://www.facebook.com/pages/Fly-Green-Virtual/233652459983234" width="205" show_faces="true" border_color="#298625" stream="false" header="false"></fb:like-box> </div> Kind Regards. Quote
cubanos Posted June 15, 2011 Report Posted June 15, 2011 Notice: The template file "/var/www/vhosts/athensairwaysva.gr/httpdocs//core/templates/touchdownstats/touchdownstats_index.tpl" doesn't exist in /var/www/vhosts/athensairwaysva.gr/httpdocs/core/classes/TemplateSet.class.php on line 248 ANY IDEAS??? I TRY TO FIX A FEW DAYS NOW AND I CANT! PLEASE HELP!!! THANKS A LOT Quote
Moderators mark1million Posted June 15, 2011 Moderators Report Posted June 15, 2011 Notice: The template file "/var/www/vhosts/athensairwaysva.gr/httpdocs//core/templates/touchdownstats/touchdownstats_index.tpl" doesn't exist in /var/www/vhosts/athensairwaysva.gr/httpdocs/core/classes/TemplateSet.class.php on line 248 ANY IDEAS??? I TRY TO FIX A FEW DAYS NOW AND I CANT! PLEASE HELP!!! THANKS A LOT Is the file there? /core/templates/touchdownstats/touchdownstats_index.tpl" Quote
fsx Posted June 16, 2011 Report Posted June 16, 2011 i have installed the addon but i have error in line 21 http://www.tcaf.it/phpvms/index.php/TouchdownStats/top_landings/10 edit: it is possible that this error because I use xacars ? Quote
Administrators simpilot Posted June 16, 2011 Author Administrators Report Posted June 16, 2011 @fsx I do not think xacars reports any landing rates. Look in your pireps database table and see if there is any data in the landing rate field. By your error it looks to me like there is no data in that column. Quote
fsx Posted June 16, 2011 Report Posted June 16, 2011 thank's but i not find the landing rate field Quote
Francisco Posted June 16, 2011 Report Posted June 16, 2011 Hi, This problem is because you don't have flights. Kind Regards. 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.