Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 0 replies
- 1.7k views
Hi all,Iwould like someonecould help me, ImountedmyAVsystembutwhen I connectFSFKto trackon the map, insteadof maintaininga line tothe pilot and theflight dataposition andeachonceIupdatedacarsgeneratesa new lineandsoindefinitely, asinthe mapdoes not generatea singleplaneiconbutit generatesan icon ineach positionwith the correspondingaspect ofthe planerow of iconsfor eachpositionthatI triedsendingtheacars.Lowithfsacarsand does not generatethiserror, but reportsthat buildsFSFKare much morecomplete. I hopeyour help. Thanksand sorry forthe grammarbecauseI do not speakEnglishproperly
Last reply by AirLevante, -
- 3 replies
- 1.5k views
Hi, there is some error in getReportsByAcceptStatus function in PIREPData.class.php. It is in around line 438. Change /** * Get all of a pilot's reports by status * * @param int $pilotid The Pilot ID to find * @param integer $accept PIREP_PENDING, PIREP_ACCEPTED, PIREP_REJECTED, PIREP_INPROGRESS * @return */ public static function getReportsByAcceptStatus($pilotid, $accept = 0) { return self::findPIREPS(array( 'pilotid' => intval($pilotid), 'accepted' => intval($accept) ) ); } to /** * Get all of a pilot's reports by status * * @param int $pilotid The Pilot ID to find * @param integer $accept PIREP_PENDING, PIREP_ACCEPTED, PIREP_REJEC…
Last reply by Kyle, -
- 1 follower
- 8 replies
- 2.7k views
Hi made a little Snippet in /core/templates/schedule_results.tpl It shows like this : Here is the code (Line 14-78 in my code) <tbody> <?php foreach($schedule_list as $schedule) { ?> <tr> <td> <a href="<?php echo url('/schedules/details/'.$schedule->id);?>"><?php echo $schedule->code . $schedule->flightnum?> <?php echo '('.$schedule->depicao.' - '.$schedule->arricao.')'?> </a> <br /> <strong>Departure: </strong><?php echo $schedule->deptime;?> <strong>Arrival: </strong><?php echo $schedule->arrtime;?><br /> <strong>Equipm…
Last reply by tutmeister, -
- 2 replies
- 2.3k views
I have the currently booked flights showing on my main page of my site. I am having a problem trying to show the airline image for the current booked flight. I can get it to show the spot for the Airline in the title, but I cannot get the image to pull from my image folder. Can someone please please assist me with this. I have been up searching on here for hours and trying to make it work: this is my code:\ Thanks to anyone that can help me with this <h3>Currently Booked Flights</h3> <?php if(!$lastbids) { echo '<p align="left">No flights have currently been booked</p>'; return; } ?> <table width="100%" cellpadding="1" cellspacin…
Last reply by smoke2312, -
- 7 replies
- 3.1k views
Hello, Is there a way in PHPVMS to show the route that a pilot has flown so far on the ACARS page like this: http://screenshooter.net/9948368/rwksmof Greets, Martijn
Last reply by Scandi7, -
Hello guys, Is there a way to show a route that is generated from a website like this: http://www.vataware....om=LEMD&to=GCTS directly into a flightplan? So that it will show in this example the following route: "CCS UN975 BIRBA UN873 SOTEX UZ223 BEXAL UN866 KONBA ` Regards, Martijn
Last reply by tgycgijoes, -
- 7 replies
- 4.5k views
Anyone know how I can show the live flights on my home page?? Thanks
Last reply by Jeff, -
- 7 replies
- 3.4k views
Hi, I'm trying to add a color part in the touchdowns, but when i add this code: echo '<td>'.if($stat->landingrate > -300) echo '<font color="green">'.$stat->landingrate.' ft/m</font>'; elseif($stat->landingrate <= -300)echo '<font color="red">'.$stat->landingrate.' ft/m</font>'.'</td>'; I'm getting this error: Parse error: syntax error, unexpected T_IF in Why i put it on a different part of the page outside the <td> </td> it is working, so i'm doing something wrong, but can't figure out what. Hope someone can help me out. Edwin
Last reply by Edwin, -
- 5 replies
- 2.9k views
Hey guys, Just wondering if anyone have some code so that on the sidebar menu it will have "My Bookings" and underneath it will say "you havent booked a flight yet<br />Click Here to to get a flight. And when you have Bid for a flight it will shouw the departure and destination??? Thanks for the help (See ya in the skies) Kieran
Last reply by HighFlyerPL185, -
- 1 reply
- 2.2k views
Hello, I'm trying to create a code that alter the condition of the aircraft when a pirep is been submitted. it looks to the landing rate, so when the landing rate is below 200 than 0.5% off the condition. when a landing rate is higher than 200 than 2% of condition. when a landing rate is higher than 500 than 50% off condition. so far i have: $pos = find_in_fsacars_log('TouchDown:Rate', $log); $landingrate = str_replace('TouchDown:Rate', '', $log[$pos]); $count = preg_match('/([0-9]*:[0-9]*).*([-+]\d*).*/i', $landingrate, $matches); if($count > 0) { PIREPData::editPIREPFields($report->pirepid, array('landingrate' => $matches[2])); } PIREPData…
Last reply by Jakes, -
- 7 replies
- 3.4k views
There's an excellent post on this forum for calculating percentage complete. After scratching my head figuring out why this wouldn't work for me, I realized that xacars, and subsequently kacars as well, does not calculate distance remaining. Which explains why this data never shows up on my map. I modifed ACARS.PHP to manually calculate the distance remaining no matter what client you're using. I've only tested this with xacars client. I'll also post the percentage complete code here as well as I've modified that slightly. ASCARS.PHP located in core/modules/ACARS <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad *…
Last reply by CarlosGarcia, -
- 1 reply
- 2.1k views
I've got an arrivals board with latest flights but I want it to display whether it's early, on time or delayed. Here's my code: $actualtime = $pirep->flighttime; $schedtime = $schedule->flighttime; if($actualtime < $schedtime){ echo '<td>Early</td>'; } elseif($actualtime > $schedtime){ echo '<td>Delayed</td>'; } else { echo '<td>On Time</td>'; } It only shows it as delayed at the moment though. Anyone help? http://www.freshjetvirtual.com/
Last reply by Txmmy83, -
- 7 replies
- 4.8k views
need help with code to put up stats from a whazzup.txt file. I have this info...and am not sure what to do with it.... <? $whazzuptxt = "whazzup.txt"; //get file $file = file_get_contents('whazzup.txt'); //get clients preg_match('/!CLIENTS(.*?)!SERVERS/ms', $file, $results); $content = trim($results[1]); //get out \r\n so on $lines = preg_split('/(\015\012)|(\015)|(\012)/', $content); //filter for pilot and atc clients function filter ($value) { if (strpos($value, 'PILOT') !== false){ return true; }elseif(strpos($value, 'ATC') !== false){ return true; }else{ return false; } } $lines = array_filter($lines, 'filter'); $br = "<br>"; /g…
Last reply by Jeff, -
- 0 replies
- 1.5k views
If you have manual rank settings, this code seems more appropriate for promotion information than the default. Default file name: profile_main.tpl default code: <p>You have <?php echo ($nextrank->minhours - $pilot_hours)?> hours left until your promotion to <?php echo $nextrank->rank?></p replacement code: <p>You must have at least <?php echo ($nextrank->minhours)?> hours to be eligible for <?php echo $nextrank->rank?>.</p>
Last reply by C1971W, -
- 0 replies
- 1.8k views
Hi, i like have the module with Awards in the Pilot's Profile, with the comment: Issued by .... and the date and/or other comments from the staff member... Like IVAO's profile, or you can view it: http://www.transavia-virtual.com/index.php?action=rosterdetail〈=en&name=Nino&prefix=&surname=Beerens If you click in the images on the left you have this: Dispatch qualified by: Byron Visser @ 06-01-2010 18:09z Exam/training did on 6-01-2010, goodluck en have fun with dispatching ! I really like it... Do you know any code for do that? Thank you so much!
Last reply by Blu-Express VA, -
- 4 replies
- 2.8k views
Hello and Happy New Year to all, At my virtual airline, each pilot is required to submit two (2) PIREPs each month. I'm curious to know how I can modify either my app.config.php or local.config.php file to verify this for each pilot before declaring them inactive. I'm also looking to obtain a script that will send a pilot three (3) emails: 1) One email that alerts them that I've reached inactive status and need to complete two (2) flights to remain active. 2) Another email that gets sent out two (2) weeks after the previous one which will warn them that they are nearing termination. And 3) the third one will alert them that they are terminated following two (2) weeks of…
Last reply by AGuyFawkesMask, -
- 5 replies
- 3.8k views
Can somebody please explain to me how to get the vatsim ID on the pilot roster. If it is already here, i just cant find it... sorry, Thanks!
Last reply by rpalmer800, -
- 16 replies
- 5.2k views
Does anyone know the code for this? I have seen one before, however it was for the public profile. I've got it working too, but I want it now on the Pilot Centre, so when the pilot views the pilot centre, it says how long it's been since their last flight, for example: Your last flight was 3 days ago. That way, they know whether they are in danger of being marked inactive or not. I remember Virtual Norwegian had it when I flew for them...
Last reply by tutmeister, -
- 0 replies
- 1.8k views
The Europe Weather Maps have been down for a few months now, but here's the fix! Replace your old code with the following: <div align="center"> <img src="http://www.jetplan.com/weather/data/maps/euwt10006.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_st.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_st_anim.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_rh.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_rh_anim.gif" /> <img src="http://icons-ak.wunderground.com/data/640x480/2xeu_ws.gif" /> <img src="http://icons-ak.wunderground.com/data/…
Last reply by freshJet, -
- 2 replies
- 2k views
Is there any way to get like a roster of the pilots in a hub on to a hub page?
Last reply by rpalmer800, -
- 0 replies
- 1.7k views
friends, I wonder if you can, make a simple flight. example: A pilot with an initial rating, can operate for 6 airports to complete your scale flight. The pilot rating and an average amount of time is released routes to 12 airports to complete your scale flight. When you get to the last rating will be released all domestic and international flights, is it possible? the idea is good? tks.
Last reply by CN@ndo, -
- 0 replies
- 1.3k views
How can i make it that the search schedules on the site .../pireps/routesmap on several undersides are indicated. Any help would be great... Regards from Germany
Last reply by AEUfly, -
- 0 replies
- 1.4k views
Hey, I'm searching for an addon that let me see all the aircraft and their current location on a map (airport)... not like the Live map thanks
Last reply by Moritus, -
- 8 replies
- 3.4k views
I know this should be pretty simple but I can't get it to work! I've got this on my layout.tpl (it's part of the auth login code): $pilotname = PilotData::GetPilotData(Auth::$userinfo->$firstname); But it just shows blank - no errors or anything. Any ideas?
Last reply by freshJet, -
need help with free Pirep code
by Guest- 8 replies
- 2.5k views
this is HTML code for Free Pirep and i want use this code in my site can any one help me to change this code and how can i use it in my site <!doctype html public "-//w3c//dtd html 4.01 transitional//en"><HTML> <!-- saved from url=(0031)http://xxxxx/pirep.asp --> <!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Language" content="en-us"> <!-- Validated at 10/27/2011 10:10:38 PM --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin templat…
-
- 6 replies
- 3.8k views
Hello Apologies if this is elsewhere, I have been searching the forums and I couldn't find the information. I want to add to my pilot badge a line with "last flight" info, in the following format: Last Flight: KLAX-KBOS A320-232 CS-TYB Which is basically route, aicraft name/type and registration. Could someone please help me with this, in terms of code and which file to edit? Many thanks Cheers
Last reply by mark1million, -
- 2 replies
- 1.8k views
Hi how do I align my pilot roster so all the ranks and everything are all aligned under each other?
Last reply by bunoire14, -
- 3 replies
- 2k views
Is there any way at all to show pireps by certain hub only? I have been tossing around some code and got a few things to work but not this one. I have been at it for a few hours now. I keep getting it to pull pireps that have been filed, but it is giving it to me for all hubs, not just the one I would like it to show.
-
Mass Email Validation Form
by Guest lorathon- 1 reply
- 1.5k views
Replace the admin/templates/mailer_form.tpl with the one located in the ZIP file. It uses a validate script to stop you from submitting the email form without a subject. Minimally tested mailer_form.zip
Last reply by freshJet, -
- 1 reply
- 2k views
If any are interested in adding an image for each member on your site on the pilots list page, here you go. Add the table header that will hold the image headline: <th>Image</th> Next add the table data that will call for the image: <td align= "center"><img src="<?php echo fileurl('/images/members/'.$pilot->pilotid.'.jpg'); ?>" width="50px" height="75px" alt="<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?>" /> You will need to change this: ('/images/members/' if your images are located in another directory. You will also need to change this: pilotid.'.jpg' if you are using another type …
Last reply by mark1million,