Jump to content

simpilot

Administrators
  • Posts

    2773
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by simpilot

  1. Your best bet would probably be to build a module around your code. The module will already be connected to the database, I am assuming you are using the same db as your phpvms install is, so you would not have to make the connection and such. Build a model class in the common folder to get the data you want, put it together in the module (controller), then use a template to just display the page you would like. You could also use the pages function and try a php include function, but that is not always a stable method.
  2. simpilot

    Rank Order

    You need to change the sql command that is loading the $ranks variable. It is probably ending in something like ORDER BY minhours ASC Change the ASC to DESC and it should reverse the order.
  3. simpilot

    Signatures

    You can add all the backgrounds you would like in the signatures/backgrounds/ folder and when the pilot goes to edit their profile there will be a dropdown with all the background file names to chose from.
  4. Are you either pilot id #1 in the database (the default exam admin) or has pilot #1 assigned you as an admin of the exam center?
  5. You can use the recent pireps function for the individual pilot and then echo out the 'dep' and 'arr' fields into the url for the map.
  6. I found a small glitch in the sql command - update your function to this -> public static function TopRoutes($airline_code='') { $key = 'top_routes'; if($airline_code != '') { $key .= '_'.$airline_code; } $top_routes = CodonCache::read($key); if($top_routes === false) { $sql = 'SELECT * FROM `'.TABLE_PREFIX.'schedules`'; if($airline_code != '') { $sql = $sql . " WHERE `code`='{$airline_code}'"; } $sql = $sql .' ORDER BY `timesflown` DESC LIMIT 10'; $top_routes = DB::get_results($sql); CodonCache::write($key, $top_routes, 'medium'); } return $top_routes; } Also, you will not be able to echo this command out as you are trying to do. You will need to use a foreach statement to break up the array, for example -> <?php $stats = StatsData::TopRoutes(''); foreach($stats as $stat) { echo $stat->code.$stat->flightnum.' - Times Flown '.$stat->timesflown.'<br />'; } ?> Remember to clear your cache after updating this code.
  7. Hi Chris, You can contact me at admin(at)simpilotgroup.com or I am on msn messenger most nights (2000 - 000 EST), user id capecodcontroller(at)gmail.com Dave
  8. simpilot

    Signature

    The text for the signature badge is located in the PilotData.class.php file starting at line 958. You will need to go through it form there to change things. Example, on line 976 is $output[] = 'Total Flights: ' . $pilot->totalflights; You can change the 'Total Flights: ' to your needs. Remeber that any changes will be overwritten in an update. You could also tie it to the language file and store your translations there so it would not get over-written in the future. Hope this helps
  9. Got to your admin section, all the links to accomplish these items are in the menu on the left. www.yoursite.com/admin
  10. You could create a custom profile field for the pilots where they could insert the callsign using the edit function in the pilot center, then include the custom field in front of the pilot number wherever it is displayed. The pilot number is tied to just about every function in the system (the database id) so changing that would have to be accomplished the same way, and used only as a display field. All records for the pilot, including the ability to log in and file pireps need to be tied to the database id of the pilot.
  11. You need to place the link for the exam center within the "Logged in" section of links in the core_navigation.tpl file. Use the Pilot Center link already in the file as an example.
  12. Add this to your local.config.php /* For PILOT_ORDER_BY use p.[column_name] [ASC/DESC] */ Config::Set('PILOT_ORDER_BY', 'p.ranklevel DESC');
  13. simpilot

    Slideshow

    There is not much info to go on, but if I were to take a shot in the dark, I would say it is your link paths. You are probably using relative paths for your js links. The template files are buried in the file tree and most times you need to use the absolute path to the script you are using within the framework.
  14. I will probably release this as a module on my site sometime in early 2011. The one catch on a script like this is that you must have root access to the server in order to set up a cron job. If you are on a shared plan you may not have this access and will have to have the host, if they want to, set it up for you. The cron job runs every 10 minutes in order to update the badges.
  15. Well... seeing as Nabeel offers hosting here in the forum to try and help with the expenses of running the site and supplying this great software at no charge, and that would be directing members to use someone else.... I wouldnt do it, but it is a free world.
  16. Try replacing that line with: echo $pilot->firstname.' '.$pilot->lastname; It just looks like a syntax error. Also I made a quick layout for a module to try to show the relationship of the three pieces (Model(data class), Controller(module files), View(templates)) here -> http://forum.phpvms.net/topic/4095-solved-with-many-thanks-coding-noob-need-help/page__view__findpost__p__27456 See what you think. I am also on msn most evenings (Eastern USA), feel free to add me.
  17. I believe body is a good variable throughout the module. You would replace the "echo $body" verbage with the new code in order to limit the characters output to the display.
  18. What template are you using, or is it one you have built? Also, what version phpvms are you on currently?
  19. If you want to pm me your ftp and database info I will take a look and try to get it installed for you. I can not get the site to do anything at this point.
  20. Yes, it is the order of your ranks and will change if you add or remove ranks to the system. lowest would be 1 and go up from there.
  21. There are a few functions available in the native stats class of phpVMS. StatsData.class.php::PilotAircraftFlownCounts($pilotid) will get you an array of the aircraft that the pilot has flown and how many times he has flown each one. StatsData.class.php::AircraftUsage() will return an array that shows how many times each aircraft in the fleet has been flown on a route To get other customized stats it would be much easier to build a data class within phpVMS, it would alread be connected to the database and would make things a lot easier on you.
  22. It will depend on what you are working on as to what to use for a variable. In the popupnews module if you are trying to limit the characters of the subject line the data is presented in the template using the $subject variable. If you wanted to limit the subject to just say 10 characters you could do something like this in the template. <?php echo substr($subject, 0 , 9).'...'; ?>
  23. There is something going on with the server you are on, even trying to check the whois of the domain comes up with an error. Have you contacted the host about the problems, will any other php application (forum, cms, etc) run on the server?
  24. The "no route passed" error is a template issue. And again, what errors did you fix? It may help for us to solve your new problem.
  25. I created a data call for vACA for individual pilot stats in my touchdownstatsData.php file like this -> public function get_pilot_landingstats($pilot, $howmany) { $query = "SELECT * FROM phpvms_pireps WHERE landingrate <'0' AND pilotid = '$pilot' ORDER BY landingrate DESC LIMIT $howmany;"; return DB::get_results($query); } Then in your module you can set the variable using something like -> $this->set('stats' = TouchdownstatsData::get_pilot_landingstats($pilotid, 5); You will just need to load the $pilotid ahead of it to call the pilot you are looking for, and the '5' is how many records you want returned in the array.
×
×
  • Create New...