Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 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, -
- 5 replies
- 6.2k views
Hi all, Anybody knows how to do it? http://aviancavirtual.net/br/operations/route-network It's making me crazy trying to do it to my VA. Any help? Regards,
Last reply by Fabiodm, -
- 6 replies
- 3.8k views
Hi there, I dont know if this is the rigth site to post this message. Im making a progress tours table, the previous versión work (http://sparkadsl.0lx...progresodetours) But, i cant make a condition with ten values (ten routes) because not work. Actually I did that when a pilot complete the last route (the numer ten) the data base send the answer "pilotid" and "accepted", so are two values. mysql_select_db($database_byethost, $byethost); $query_Tablafinaltours = "SELECT `phpvms_pireps`.`pilotid` , `phpvms_pireps`.`accepted` FROM phpvms_pireps WHERE ( ( `phpvms_pireps`.`flightnum` ='GB10' ) AND ( `phpvms_pireps`.`accepted` =1 ) ) ORDER BY `phpvms_pireps`.`pilotid`…
Last reply by ARV187, -
- 1 follower
- 4 replies
- 7.3k views
Hello Im using chatroll chat in iframe tags and it works as well. Chatroll also has php application but i cant figure out howto make it work in my website. The code of Php Application <?php // Chatroll Single Sign-On (SSO) Parameters $uid = 1; // Current user id $uname = 'test'; // Current user name $ulink = 'http://example.com/profile/test'; // Current user profile URL (leave blank for none) $upic = ''; // Current user profile picture URL (leave blank for none) $ismod = 0; // Is current user a moderator? $sig = md5($uid . $uname . $ismod . 'dwcbbkhmrlldo28m'); $ssoParams = '&uid=' . $uid . "&uname=" . urlencode($uname) . "&ulink="…
Last reply by gio1961, -
- 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, -
- 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, -
- 1 follower
- 14 replies
- 6k views
Hi everyone, I was wondering if anyone would be able to help me. On my site I have the normal pilots online,guests online. I would like to be able to show staff members online. has anyone any ideas. I have simpilots staff module so maybe i could use it in some way All help appreciated . Thanks in advance
Last reply by warpennys, -
- 2 replies
- 1.5k views
I need to know how I could have on passenger flights, cargo transport
Last reply by AlessandroCuba, -
- 6 replies
- 4.4k views
Here is the code for the IVAO status image in the roster: $feildvalue = PilotData::GetFieldValue($pilot->pilotid, 'IVAO ID'); if($feildvalue != '') { echo '<img src="http://status.ivao.aero/R/'.$feildvalue.'.png">'; } Place it in your pilots_list.tpl, and save it to your skin folder. Change the IVAO ID to what ever it is in your database. You can use the correct spelling for feildvalue to what you want, you can even change it to another name if you like.
Last reply by buraktiftikci, -
- 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.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, -
- 18 replies
- 11.9k views
Add the following to lib/js/acarsmap.js var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT }); weatherLayer.setMap(map); var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map);
Last reply by simonecatalano, -
- 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, -
- 6 replies
- 3k views
Heres a snippet I use to get the last 5 posts from phpBB to display in my side bar <?php require_once('/path/to/forum/config.php'); $link = mysql_connect($dbhost,$dbuser,$dbpasswd); mysql_select_db($dbname, $link); $result = mysql_query("SELECT * FROM `phpbb_posts` ORDER BY `post_id` DESC LIMIT 5", $link); while($r = mysql_fetch_array($result)) { echo "<a href=\"http://www.domain.tld/forum/viewtopic.php?p=" . $r['post_id'] . "\">" . $r['post_subject'] . "</a><br />"; } ?>
Last reply by joeholden, -
- 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, -
- 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, -
- 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, -
- 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, -
- 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, -
- 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, -
- 2 followers
- 13 replies
- 5.3k views
Hey Guys! So we were doing some development at woava.net tonight and came up with this little puppy. Thought you guys would like it. It checks weather the selected user is in a flight or not, if the user is in a flight it displays the current status of a flight, (parked, pushing back, taking off, etc...), Their departure to arrival in the format of DEPICAO -> ARRICO, (ex, kdfw -> klax), and the precentage currently based on distance from the flight. You can also base it on time using the variables <?php $acars->deptime; $acars->timeremaining; //and $acars->arrtime; ?> Anyways, enjoy! <?php /** ==================VVVV Checking Current lo…
Last reply by Taran, -
- 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, -
- 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, -
- 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, -
- 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,