Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 4 replies
- 4.6k views
I have created awards for our va and have no problem adding them to the pilots and they display just fine when you click the pilot id. What I would like to have and don't know how to code this so please help if you can, what do I need to add where to get the awards to appear in a horizontal row under each pilot when anyone guest or not clicks the Pilots tab on the main page of the phpvms of our va site.
Last reply by Steve Bartlett, -
- 13 replies
- 3.4k 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, -
- 1 follower
- 4 replies
- 3k views
I'm sure some will have discovered Charts.aero, they're a relatively new charts site. Love the site now because it's clean and easy to use, charts are synchronised at least hourly, but best of all, there's an API available. Problem is, I can't handle APIs. The API can be found here. There are three ways to retrieve charts; by search string, by IATA and by ICAO. I'll do it through all I think, but just use ICAO for now. This is the PHP for the ICAO retrieval: $response = Unirest::post( "https://charts.p.mashape.com/retrieve/icao", array( "X-Mashape-Authorization" => "******************************" ), array( "icao" => "", )); You'll notice the Unirest clas…
Last reply by freshJet, -
- 11 replies
- 7.3k views
Hello i m looking for help ! I like to make an auto accept pirep system, if someone got a code to this please sheare the code with me. Thank you!
Last reply by Txmmy83, -
- 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, -
- 23 replies
- 8.2k views
staff would like to know if someone has a script that creates the company badge with the picture, id pilot, hub and everything else! Thank you! Exemple:
Last reply by warpennys, -
- 8 replies
- 4.3k views
The rule n° 17 for a va on ivao say: §17: 17. If the VA is active also on other networks and/or allows pilots to fly off-line, thence not necessarily registered on the IVAO network, the pilot roster page on the website should clearly emphasize those registered on the IVAO network. The pilot roster could be divided in 2 or more sections (IVAO pilots, other network pilots, pilots flying off-line etc.) or show, close to each pilot name or callsign, the logo of the network the pilot belongs to with his Vid. for this I modified the code of my phpvms ... anyone is interested?
Last reply by Tato123, -
- 6 replies
- 3.9k views
Below is a function which will take any givin pilot and find the appropriate avatar for him and re-associate the avatar with the pilot after said pilot has been moved to another airline, or had their ID changed. ​it also deletes any unnecessary avatars. public static function fixAvatar($pilotid){ // Get the pilots Information. $pilotid = (int)$pilotid; $sql = "SELECT * FROM `".TABLE_PREFIX."pilots` WHERE `pilotid`=$pilotid"; $pilot = DB::get_row($sql); unset($pilotid); $err = DB::errno(); if($err != 0){ return false; } // Setting up the check (with regex) for an avatar with the pilots current ID. $pilotcode = PilotData::getPilotCode($pilot->code, $p…
Last reply by Ademar Andrade, -
- 8 replies
- 2.4k views
Hi all, I'm trying to determinate witch flights have been done on time. The logic is: if the flight time is bigger than the estimated, the result is Delayed, else On time. So i simple code: <?php if ($pirep->flighttime > $schedules->flighttime) { echo "Delayed"; } else { echo "On time"; } ?> On results, all flights are "Delayed", and it's not truth. Help guys, what is wrong with my code? Thanks for attention!
Last reply by mseiwald, -
- 0 replies
- 1.4k views
Hello all, is possible to compress phpvms with something like this? if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); I have tried but allways get errors and css problems. My homepage(root) isn't phpvms and is compressed, the foruns phpbb3(root/phpbb3) is compressed too. The phpvms is in root/folder/phpvms but can´t compress. To do the tests i used this website http://www.gidnetwor...s/gzip-test.php Anyone ever tried? Thank you
Last reply by piuozorio, -
- 5 replies
- 3.1k 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, -
- 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
- 1 reply
- 1.7k views
Hey, I use the .csv file to upload schedules and some flights have the same FlightID I know there used to be a code allowing you to upload same flight numbers. Does anybody know it? Regards, Daniel Cormack Website : www.corporateva.co.uk Email : ceo@corporateva.co.uk
Last reply by crnjola, -
- 2 replies
- 1.5k views
I need to know how I could have on passenger flights, cargo transport
Last reply by AlessandroCuba, -
- 1 follower
- 3 replies
- 2.2k views
Is it possible? So that you can have the latest route from vRoute in the schedules for all flights?
Last reply by druptown, -
- 2 replies
- 1.7k views
Hello, Is there any code I can use to display how many airlines we have? Regards. Daniel Cormack Website : http://www.corporateva.co.uk/index.php Email : ceo@corporateva.co.uk
Last reply by CorporateVirtual, -
- 3 replies
- 1.5k views
I've noticed the ACARS map only leaves the popup bubble open for around 5 seconds, how can this be changed so that it stays until the user closes it or clicks on another plane? I'm assuming it's in Javascript...
Last reply by edmundk, -
- 2 replies
- 1.7k views
For the ones who have a Wordpress and would like to have your recent post on your phpvms site. Here is how I do it. http://feed2js.org/index.php?s=build Than you will need to know your RSS feed url. http://example.com/?feed=rss http://example.com/?feed=rss2 http://example.com/?feed=rdf http://example.com/?feed=atom If you are using custom permalinks, you should be able to reach them through this usage: http://example.com/feed/ http://example.com/feed/rss/ http://example.com/feed/rss2/ http://example.com/feed/rdf/ http://example.com/feed/atom/ I am using /?feed=rss2. Make sure that you preview it first. Place the code where you want to display the post.
Last reply by flyalaska, -
- 1 reply
- 3.8k views
how would i set my site up so it says welcome guest when ur not logged in but ur name when u are logged in?
Last reply by flyalaska, -
- 1 reply
- 1.8k views
Hey guys so I installed the Pilot Shop Add-on nothing appears in it and it tells me PilotHome No products have been bought! that's in the pilot home page. Then via the admin center when I try to add some products it saids " An Error Was Encountered The module "SHOPADMIN" doesn't exist!" Anyone know how to fix it?
Last reply by TAV1702, -
- 0 replies
- 1.7k views
Small code showing the VATSIM weather in the template, random <div id="metar"> <?php $sql = "SELECT ".TABLE_PREFIX."airports.id, ".TABLE_PREFIX."airports.icao as icao, ".TABLE_PREFIX."airports.name, ".TABLE_PREFIX."airports.country as country FROM ".TABLE_PREFIX."airports ORDER BY RAND() LIMIT 1"; $result = mysql_query( $sql ); while ($row = mysql_fetch_row($result)) { echo"<h3>METAR (ICAO: ".$row[1].")</h3>"; echo "Aeropuerto: <font color='#ff6600'>".$row[2]."</font><br />"; $adresse = 'http://metar.vatsim.net/metar.php?id='; $homepage = file_get_contents($adresse.''.$row[1]); echo "<font color='#2997ba'>".$homep…
Last reply by AlessandroCuba, -
- 0 replies
- 1.8k views
Does anyone know of a code or something else that I can use to allow the pilots to pic one language before signing up? For example they would press on the registration link but it would take them to some where that would let them pic either English or French. Also does anyone know how I can make a separate different language pilot application.
Last reply by Dominican Airways, -
- 1 reply
- 1.6k views
Hi! This is my first post here =) I've been working on a module where the central idea is to dynamically update airports visited and divided by country and continent. Just follow the template module. If anyone wants to help me, any help is welcome....pm me. teste.zip
Last reply by nabpp, -
- 3 replies
- 1.4k views
Just looking to see if anyone wants to recommend some codes to make a site look better. Anything you find cool comment it here.
Last reply by Sava, -
- 9 replies
- 2.7k views
Hello, Could Some one provide me the code to echo the password for the signed in pilot, for creation of kAcars config file. pilot id was: <?php echo $pilotcode?> is there some same code but, for the password? greetz, Jacques
Last reply by Oxymoron290, -
- 1 follower
- 9 replies
- 3.1k 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, -
- 0 replies
- 2.5k views
It's that time of year again so I thought I would share a script I found last year. Really easy to use. <!--Simply copy and paste into <BODY> Just above the </BODY> tag. --> <script type="text/javascript"> /* Snow Fall 1 - no images - Java Script Visit http://rainbow.arch.scriptmania.com/scripts/ for this script and many more */ // Set the number of snowflakes (more than 30 - 40 not recommended) var snowmax=35 // Set the colors for the snow. Add as many colors as you like var snowcolor=new Array("#aaaacc","#ddddff","#ccccdd","#f3f3f3","#f0ffff") // Set the fonts, that create the snowflakes. Add as many fonts as you like var snowtype=new Ar…
Last reply by RogerB, -
GCMap - Great Circle Mapper 1 2
by Guest lorathon- 42 replies
- 18.8k views
This will display the last 10 flights in a GCMap Great Circle Mapper Visit this site to customize the display of the map. <?php $flights = PIREPData::getRecentReportsByCount(10); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=650x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /><br /> Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl …
Last reply by Marmus, -
- 3 replies
- 1.9k views
Is there anything out there that let's the pilots spend the money they earn in VA on virtual things?
Last reply by nabpp, -
- 2 replies
- 1.8k views
How can I add Notam's to the pilot center for that the pilots can see?
Last reply by souljony,