Jump to content

Nabeel

Administrators
  • Posts

    8151
  • Joined

  • Last visited

  • Days Won

    39

Everything posted by Nabeel

  1. Ah, this code will only work on the latest betas/next release
  2. Ok, 3 steps: 1. create a new module called IVAOFlightPlan (so create a module in core/modules called that), then inside that create IVAOFlightPlan.php, then inside that, paste this: <?php class IVAOFlightPlan extends CodonModule { public function download_ivao($schedule_id='') { // Make sure they specified a schedule if($schedule_id == '') { $this->set('message', 'No Schedule specified'); $this->render('core_error.tpl'); return; } $schedule = SchedulesData::findSchedules(array('s.id'=>$schedule_id), 1); // Make sure the schedule was valid/exists if(!$schedule) { $this->set('message', 'The schedule doesn't exist!'); $this->render('core_error.tpl'); return; } // Now write out our template file $this->set('schedule', $schedule[0]); $file = $this->get('ivao_flightplan.tpl'); // And send it to the browser to download Util::downloadFile($file, 'ivao_flightplan.fpl'); } } The Util::downloadFile() function will be available after tonight's commit. If you don't want ot wait, replace that line with: # Set the headers so the browser things a file is being sent $filename = 'ivao_flightplan.fpl'; header('Content-Type: text/plain'); header('Content-Disposition: attachment; filename="'.$filename.'"'); header('Content-Length: ' . strlen($file)); echo $file; You can change the filename to what you want it to be, I'll let you figure that out 2. Create in core/templates a file called 'ivao_flightplan.tpl', and paste your flightplan code into it [FLIGHTPLAN] ID=<?php echo $schedule->code.$schedule->flightnum; ?> RULES=I DEPICAO=<?php echo "{$schedule->depicao}"; ?> DEPTIME=<?php echo "{$schedule->deptime}"; ?> LEVELTYPE=F LEVEL=<?php echo "{$schedule->flightlevel}"; ?> ROUTE=<?php echo "{$schedule->route}"; ?> DESTICAO=<?php echo "{$schedule->arricao}"; ?> EET=<?php echo "{$schedule->flighttime}"; ?> 3. Add a link to your briefing page: <a href="<?php echo actionurl('/IVAOFlightPlan/download_ivao/'.$schedule->id);?>">Download IVAO Flight Plan</a> Then you should be all set. You can add different flight plan types the same way (adding a public function download_XXXX($schedule_id) and then you can have different flight plan types within the same module. Hope that helps, it might not work exactly, but should be the general gist of it
  3. Hey, So where do you want this downloadble from? How do you know which schedule?
  4. You could try setting a "negative expense" (so add an expense, with a negative value, -100 ie), with the release so close, I'm not sure if I can add income in time.
  5. Nabeel

    Skinning Help

    One of the video tutorials above goes over some of it. But, if you open those template files (frontpage_*.tpl), you'll see the code. It's just one line for most of those
  6. This I have to check. I think it was a quick workaround for what I was doing at the time. It shouldn't be recalculating all the PIREPs though, that would be wrong. Also, any other issues let me know since I'm planning to release soon so I can take care of any issues or other hooks you might need.
  7. For error messages or success messages, do: <?php $this->set('message', 'some message'); // error $this->render('core_error.tpl'); // success $this->render('core_success.tpl'); Or the Template::Set()/Template::Show() equivalents That keeps that standard across the other code, since those templates can be modified
  8. What ACARS program are you using?
  9. After the fact? You could manually calculate it when you edit the PIREP
  10. The parent div style probably needs a float: style="float: left" I'm not sure exactly what, but you might have to Google the problem and mess with the CSS. It's a bit difficult to tell just by looking at it
  11. I think the problem lies with fscars, maybe it's not reporting the right units. Do those numbers match? If the ACARS log should pounds, then fsacars isn't reporting the fuel properly
  12. Yep, make sure you grab the entire thing, all the { } braces and php start/end tags all intact
  13. Which ACARS app are you using? XAcars always reports fuel in lbs, I think I fixed that bug a few builds ago, but I'm pretty sure you're upto date.
  14. There's an error with PIREPs listing. I don't want to do another commit just yet, but to fix it: Open /admin/modules/pirepadmin/pirepadmin.php Line 159 is: $allreports = PIREPData::GetAllReports($this->get->start, $num_per_page); replace it with the next two lines: $params = array(); $allreports = PIREPData::findPIREPS($params, $num_per_page, $this->get->start);
  15. Revision 820: fixed #114 fixed #115 fixed #110 fixed #113, refs #27 19 December 2009, 1:29 pm fixed #114 fixed #115 fixed #110 fixed #113, refs #27 Source: Revisions of / Download from http://downloads.phpvms.net/phpvms.beta.zip --- ALOT of internal changes on this one, there shouldn't be any changes on the front-end. Finally got to implement a powerful new schedule and PIREP search interface, and replaced all of that code in the modules to use it. Simply put, queries like this are easily possible now, without any new *Data classes or writing any SQL or adding any functions: <?php // Find flights out of KJFK that leave at 10:00-10:59, // and are longer than 400 distance units $search=array( 's.depicao' => 'KJFK', 's.deptime' => '10:%', 's.distance' => '> 400', ); $schedules = SchedulesData::findSchedules($search); // Find passenger flights which are on Mondays, and // haven't been bid on $search=array( 's.type' => 'P', 's.dayofweek' => '%1%', 's.bidid' => 0, ); $schedules = SchedulesData::findSchedules($search); // Get flights which have been bid on (doesn't return pilot info, however) $search = array( 's.bidid != 0', ); $schedules = SchedulesData::findSchedules($search); This makes it much easier for add-on modules or for your site to develop custom searches. The same thing has been done for PIREPs: <?php // Return all the PIREPS which are accepted, where the user's hub // who subitted it is KJFK $search = array( 'p.accepted' => PIREP_ACCEPTED, 'u.hub' => 'KJFK', ); $pireps = PIREPData::findPIREPS($params); Hopefully sometime this weekend there will be another update, which will enabled vaCentral and that will be in open-beta, so I can fix some of those bugs up. I don't think there's anything major left for phpVMS, so I'm aiming for a final version sometime between Christmas and New Years. --- Note There's an error with PIREPs listing. I don't want to do another commit just yet, but to fix it: Open /admin/modules/pirepadmin/pirepadmin.php Line 159 is: $allreports = PIREPData::GetAllReports($this->get->start, $num_per_page); replace it with the next two lines: $params = array(); $allreports = PIREPData::findPIREPS($params, $num_per_page, $this->get->start);
  16. It should be showing the heading, yes. FSACARS doesn't report it, so I just try to calculate it
  17. Just a note to anyone else looking - make sure the /core/local.config.php file is completely empty with a filesize of 0
  18. Can you PM me a link? What version of phpVMS did you download? When you goto the install page (/install/install.php), and you click "Check Database Connection" after entering your data, what does that say?
  19. Sorry, no problem. You probably have something like this: <table> <tr> <td>Column one</td> <td>Column two</td> </tr> </table> Fixed width would be: <table> <tr> <td width="50%">Column one</td> <td width="50%">Column two</td> </tr> </table> Or the width could be a pixel value: <td width="130px"> Right now there's no fixed width, so they're just automatically sizing to the content. So much make all the columns (the <td> are columns) with that width
  20. Hey Dan, thanks for trying us out! 1. I would go with 5.0, though it runs on 4.1, I personally do all my testing and development on 5.0 2. Don't worry about it 3. You can say no, you don't need external access. I think they'll give you the address you need to connect to the database, note that down, since the phpVMS installer will ask for it. Good luck, feel free to post any other questions
  21. And, I agree with simpilot. This time of year is really busy for everyone, and it's going to take a while to get back to you on some things. I also suggest trying to learn some PHP, watch the video tutorials, and look and search around at other solutions, maybe you can derive what you're trying to find.
  22. As of next beta, you can do something like: <?php $search = array( 'a.registration' => $route->registration, 's.bidid != 0' ); $schedules = SchedulesData::findSchedules($search); if(is_array($schedules)) { continue; // skip } This would presumably go in the foreach() loop in schedule_results.tpl. It basically looks at the current route it's processing, find any schedules with the current aircraft registration and have been bid on (the bidid is not 0) and returns those. If it finds something, then it means that route has been bid on, and will skip it
  23. As of next release, you can do: <?php $params( array('a.registration'=>'[Registration]', 'p.accepted'=>PIREP_ACCEPTED ); $pirep = PIREPData::findPIREPS($params, 1); $current_location = $pirep->arricao; To give you the current location of the aircraft with the given registration. It'll be explained in the build notes.
  24. Actually, those are two new features, but they should only show if you're logged in. I just fixed that bug, thanks. But, it allows the pilot to enter a comment after it's been submitted, and then edit any custom fields for PIREPs. Admins can do it from the admin panel
×
×
  • Create New...