Jump to content

Recommended Posts

Posted

Mark, a while back you made a post about flight report delay with kacars. You removed the listener for top pilots and made it a cron. Can you share how you did that?

Posted

That code isn't doing the trick, since I removed the listener and cronned that code it's still not working. I'm getting a sytax error and top pilot isn't updating now.

Guest lorathon
Posted

Roger,

Sorry but I do not use the module. I am sure that Mark should be able to help you out.

  • Moderators
Posted

HI Roger yes it wasn't specific to kACARS it was when any pirep was filed.

I tracked it down to the top pilot module, I think David was going to release a fix for it not sure if he updated or not yet.

Basically this is what i did, removed the listener >Core>Modules>TopPilot like this at the top section,


<?php
//by:simpilot
//www.simpilotgroup.com

class TopPilot extends CodonModule {

public $title = 'Top Pilots';

//public function __construct() {
// CodonEvent::addListener('TopPilot', array('pirep_filed'));
//}
public function EventListener($eventinfo) {
if($eventinfo[0] == 'pirep_filed') {
self::refresh_pilot_stats();
}
}

Then i put that function in to a php file in the admin directory,


<?php

define('ADMIN_PANEL', true);
include dirname(dirname(__FILE__)).'/core/codon.config.php';
Auth::$userinfo->pilotid = 0;
/*
error_reporting(E_ALL);
ini_set('display_errors', 'on');
*/
set_time_limit(0);
ini_set('memory_limit', '-1');

TopPilot::refresh_pilot_stats();
echo 'Top Pilot Stats Updated';

?>

Then set up the cron the same way as its usually run for maintenance.

php -f /srv/www/xxx/xxx/admin/YOUR_FILE_NAME.php

Just change the YOUR_FILE_NAME.php to whatever you call the file you create and should be good to go.

  • Moderators
Posted

Ok so first thing call the page directly in your browser to see if it works, then you can add it as a cron or a timed script, there are other ways to get that to run without a cron if you dint have access.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...