Jump to content

Route Map


mark1million

Recommended Posts

  • Moderators

This is something that i never seem to get round to but i have the following error with my hub / routemap,

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'RouteMap::hubmap' was given in /home/mgrant/public_html/grantsva.com/core/classes/MainController.class.php on line 292

I posted about a year ago and Nabeel posted a line of code to add, is this still relevant?

Im on the latest beta but its never worked now or ages :)

Link to comment
Share on other sites

  • Moderators
<?php

class RouteMap extends CodonModule
{
   
   public function __construct()
   {
      CodonRewrite::AddRule('routemap', array('maptype', 'hub'));
   }

   public function index()
   {
      
      if($this->get->maptype == 'hubmap')
      {
         // Show hubmap
         $params = array(
            's.depicao'=>$this->get->hub,
            's.enabled'=>1
         );

         // Show only 20 routes
         $allschedules = SchedulesData::findSchedules($params, Config::Get('ROUTE_MAP_SHOW_NUMBER'));

         if(count($allschedules) == 0)
         {
            echo 'There are no departures from this airport!';
            return;
         }

         $airportinfo = OperationsData::GetAirportInfo($this->get->hub);

         echo '<h3>Departures from '.$airportinfo->name.'</h3>';

      }
      else
      {
         # Get all of the schedule
         $allschedules = SchedulesData::findSchedules(array('s.enabled'=>1), Config::Get('ROUTE_MAP_SHOW_NUMBER'));
      }
      
      $this->set('allschedules', $allschedules);
      $this->render('flown_routes_map.tpl');
   }
}

Link to comment
Share on other sites

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...