Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 7 replies
- 3.7k views
Exist module or way to display list of aircraft locations as follow based on pireps? maybe last 10 flights for each.... for example: Aircraft A date: LZIB-LZKZ date: LZKZ-EDDM ... Aircraft B date: XXXX-YYYY date: YYYY-FFFF Thans for help. Peter
Last reply by shiljo, -
- 1 follower
- 7 replies
- 3.7k views
How would I go about getting each pilot's total miles flown (all time) on the roster? Like they have the flights and hours, how would I add the miles?
Last reply by ercio, -
- 5 replies
- 3.6k views
No charts are displayed for any airports in the schdule briefing, so I modified the code to display charts found in the database. If no charts are found it will display the default link for airnav.com plus the message "No local charts found, try - [airnavlink]". You can see it here: http://www.flybritair.com/index.php/schedules/brief/1 You have to edit schedule_briefing.tpl Replace: <table width="98%" align="center"> <tr style="background-color: #333; color: #FFF;"> <td>Charts for <?php echo $schedule->depicao?></td> <td>Charts for <?php echo $schedule->arricao?></td> </tr> <tr align="center"> &l…
Last reply by tgycgijoes, -
- 1 follower
- 5 replies
- 3.6k views
Hi to all, i have a little question. From my site i call this: http://www.virtualir...eflights?cs=VAR and i see the page with my map Now i need start the function with MainController::Run but don't work I use this code <?php MainController::Run('liveflightsivao', 'index', '?cs=VAR'); ?></center> Any suggestion for the correct string ? Thanks
Last reply by Tato123, -
- 1 follower
- 10 replies
- 3.6k views
Instead of just showing a drop down for Signature banners, I would like to also show a preview of the sig ban. Anyone ever done this?
Last reply by freshJet, -
- 12 replies
- 3.6k views
Hey Guys, The following will place a pullout content box on the left pane of your website that fluidly slides out when hovered over. For example, you may use it as a login box as presented in this release. 1. Paste the following in your style.css or main style file http://pastebin.com/hnw9DcTG 2. Place the following on the next line under your <body> tag http://pastebin.com/WcxfisiM When done correctly, it should function as shown is the following video http://www.youtube.com/watch?v=9u_zusDvrR0 Hope you guys find use for this! Chase Morgan | CEO Hawaiian Virtual Airlines cmorgan@hawaiianva.org
Last reply by shakamonkey88, -
- 1 reply
- 3.5k views
Hello, How to recover some information on the log with the variables For example: 12:35 start engine 2, 12:50 overspeed .... Thanks for your help
Last reply by loganq, -
- 9 replies
- 3.5k views
Hi all I have adapted my code to show country and rank but I have a problem it shows the country fine but not the rank here is my code any help would be great thanks. <div id="box"> <div> <h2>Users Online</h2> <p> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); ?> <h4>Pilots Online</h4> <?php $shown = array(); foreach($usersonline as $pilot) { if(in_array($pilot->pilotid, $shown)) continue; else $shown[] = $pilot->pilotid; echo "<p>"; echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot-&…
Last reply by Stealthbird97, -
- 13 replies
- 3.5k views
i have a question. Is it possible that when I search on airports that when I choose EHAM that only the airports are visible from EHAM and not my Full airport list in arrival? Exmaple: Airliner: British airways Departures EHAM (Amsterdam) Arrival and now only the airports from EHAM. When you do now than have you the full airports list and that is a big list. haha Select aircraft B737-800 I hope that you understand me ïŠ Greets Michael Kraan
Last reply by jacktimo, -
- 11 replies
- 3.5k views
Hello, Would anybody know the code to split up the hubs into airline categories on the registration page like this?. Regards Michael
Last reply by Stealthbird97, -
- 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, -
- 3 replies
- 3.4k views
Nabeel, i have a pilots list currently displayed in the va stats, listed i have all the countries displaying the flag and location in a table (for anyone else this is the code)Page in action <?php echo '<td align="center" width="250px" valign="top">'; echo '<table cellspacing="1" cellpadding="1" border="1">'; echo '<th width="150px"><div align="left">Country Location</div></th>'; echo '<th width="100px"><div align="center">Pilots</div></th>'; $country_info = DB::get_results('SELECT COUNT(pilotid) as total, location FROM '.TABLE_PREFIX.'pilots GROUP BY LOCATION'); foreach($country_info as $country) { echo …
Last reply by Nabeel, -
- 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, -
- 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, -
- 2 replies
- 3.4k views
Is there a code out there that can hide content by rank? For example I only want certain links to show on for pilots above a certain rank. Is this possible? My site is phpVMS 5.5.2
Last reply by flyalaska, -
- 4 replies
- 3.3k views
Hello, if you want to add METAR & TAF IVAO on your homepage, you can add this litlle part of code : <center><b> METAR: </b> <?php echo file_get_contents("http://wx.ivao.aero/metar.php?id=xxxx"); ?> <br>br> <b> TAF: </b> <?php echo file_get_contents("http://wx.ivao.aero/taf.php?id=xxxx"); ?> <br> </b></center> Replace just the xxxx with the ICAO you want to display.
Last reply by TennShadow, -
- 1 reply
- 3.3k views
Hello all, (sorry my english) i’m trying to make the flightMarkers keep moving (with or without click marker) but no success. When i try, from multiple markers only one moves or all blink and jump to new position. Whem the marker moves and arrives to next destination/point and the map refresh, the marker go back and start again. Need to continue to next new position. This is the code i’m trying to adapt with speed: http://jsfiddle.net/HYuRR/2/ Can someone help to implement the code? Thank you This is the original acarsmap.js var flightMarkers = []; var routeMarkers = []; var flightPath = null; var depMarker = …
Last reply by piuozorio, -
- 7 replies
- 3.3k views
Can someone help me with this topic? I finished code to show schedules for aircrafts located on airport based on last pirep. Next step and need help with code, probably in Schedule.php and schedule_results.tpl -> when flight is in bid i need to bided aircraft will be hidden from all schedules to time, when flight is in bid.
Last reply by Yash, -
- 2 replies
- 3.3k views
You need to edit the MainController.class.php. You'll find it here: \core\classes\MainController.class.php In line 96 there's a function called loadModules(). Edit this function to the following: public static function loadModules() { global $NAVBAR; global $HTMLHead; self::$ModuleList = self::getModulesFromPath(CODON_MODULES_PATH); if(empty(self::$ModuleList)) { Debug::showCritical('No modules were found in module path! ('.CODON_MODULES_PATH.')'); return; } self::$listSize = sizeof(self::$ModuleList); self::$keys = array_keys(self::$ModuleList); ksort(self::$ModuleList); foreach (self::$Modul…
Last reply by Karamellwuerfel, -
- 6 replies
- 3.3k views
Just touching up my pilots list page and wanted to be able to click on Vatsim (mainly) or ivao ID on pilot profile to bring up their flight histories on relevant stats page.. <td> <div align="center"> <a href="<?php echo url('https://vatstats.net/flights/?pilot='.$pilot->pilotid, 'VATSIM ID');?>"> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </a></td> This is displaying their vatsim ID correctly as a clickable link, however its bringing up "http://www.susiairvirtual.com/index.php/https://vatstats.net/flights/?pilot=1" rather than the vatstats page, and its also using the pil…
Last reply by flyalaska, -
- 1 follower
- 9 replies
- 3.2k views
I posted this question in a older skinning thread, but the thread appears to be closed or at least does not show up on the "new posts list and no one may have seen my post. There is a great code snippet for adding the GC Maps to the site. thread: http://forum.phpvms.net/topic/8040-adding-map/page__hl__+great%20+circle#entry53587 The above thread lists code that will plot the last 10 flights on the main page and ALSO the last 10 flights by a pilot on the pilot's profile page. I would like to modify so that the last 10 flights by a particular airline are shown. My code snippet question: how to make only the flights from one airline appear? I assume you can use some form…
Last reply by Marmus, -
- 4 replies
- 3.2k views
Hi all. I have a section on the front page of my crew center that gives a snapshot of how many hours are left before the pilot reaches the next rank. The problem... When the pilot maxes out it starts to give a negative number. I would like to add an "if" statement to the following code that says basically, if the hours = < 0, then display "Congratulations<br>You have reached the highest rank." <div class="small-box bg-blue"> <div class="inner"> <h3><?php echo ($nextrank->minhours - $pilot_hours)?> Hours</h3> <p>until promotion to<…
Last reply by djtiger76, -
- 5 replies
- 3.2k views
Anyone know how I can get the Live Flight Status on the homepage which looks like a checker board kind of the old style airport flight status ones ?
Last reply by Txmmy83, -
- 5 replies
- 3.2k views
I love the landing rate (landingstats) feature that SimPilot & Nabeel brought to phpVMS. I have always had a little niggle with it though, and that was the fact that if a pilot didn't use an ACARS program which records the land rate, or they file a PIREP manually, then the output shows 0. This can be confusing for visitors to your site. So with a slight mod to the output php, any PIREPS submitted without the landing rate present will now show "Not Recorded". You could use whatever text you want. Here's how: <?php if($pirep->landingrate == '0') {echo 'Not recorded';} else {echo "{$pirep->landingrate} ft/min"; }?> I just dropped this in a table cell …
Last reply by michael Kraan, -
- 1 reply
- 3.1k views
Hi everyone! Is there any code with which I can display the airline logo automatically depending on the flight number? Somewhere I don't remember, I found this one but it doesn't work: <td align="center"><img src="https://(website)/lib/skins/ocean_blue/images/airlines/<%=flight.flightcode%>.png"></td> Thank you!
Last reply by flyalaska, -
- 2 replies
- 3.1k views
I have searched the forum and might have missed it, but does anyone have a code snippet to add TS3 server status to the front page of the crystal II skin? Thanks in advance
Last reply by simpilot, -
- 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, -
- 5 replies
- 3.1k views
I want to display the pilots Hub in the pilot center but I can't figure it out. I don't even have a clue as to what code to be using. If anyone has done this would you mind to post the code? Thanks in advance. Keith
Last reply by JustinRomaine, -
- 1 follower
- 5 replies
- 3.1k views
anyone know a code/script for a snow falling effect to add to the site?
Last reply by Vangelis, -
- 0 replies
- 3.1k views
I was wondering if anyone would have any idea on how to set different icons for the aircraft type on live map. I'm not great with jquery functions so anyone able to resolve this would be a great help I'm assuming it would be something along the lines of this const getHeadingIcon = (heading) => { if (!(heading in headingIcons)) { headingIcons[heading] = L.icon({ iconUrl: url + "/lib/images/inair/" + aircraft + heading + ".png", iconSize: [35, 35] }); } Many thanks
Last reply by miniarma,