Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 0 replies
- 1.5k views
I'm sure you've noticed that when you click on an aircraft on the ACARS map the dialog box will disappear when a position update occurs, is there a way to prevent this and simply update the data shown on the box instead?
Last reply by freshJet, -
- 6 replies
- 4k 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, -
- 2 replies
- 1.9k views
Hello guys, I would like to ask if you can display your IP on a page of the site. Every driver, when you plug should see your ip. Can anyone help me?
Last reply by Tato123, -
- 1 reply
- 2.2k views
Does anyone know the code to get stats based upon airlines in the system rather than HUBs?
Last reply by MaciejO, -
- 0 replies
- 1.6k views
Hi, Would anybody please have a snippet of code that I can add to my pending PIREPs page, which has a drop down of the airports stored in my phpvms_airports database? When selecting an airport, it will filter the PIREPs to show only those with a departure/arrival airport of the one selected? I hope that makes sense, Thank you in advanced. Daniel
Last reply by danielp1997, -
- 1 follower
- 14 replies
- 6.5k 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, -
- 13 replies
- 7.2k views
Hello All, Does anybody have the code for this? I cannot remember which VA it was on but it shows a list of all pilot's online Thanks!
Last reply by warpennys, -
- 4 replies
- 2.5k views
Hello Is their some existing module or if some one could create a module which allows admin to reject a member but also allows the admin to keep the reason of rejection internally? Regards
Last reply by BaRBeR, -
- 1 follower
- 4 replies
- 3.2k views
Here is a small code that you can use in pilot center or public profile. It shows total flights in a particular airline that pilot has flown. Note: If your database table prefix is not phpvms, change this part "phpvms_pireps" to yours in the code. Enjoy <table class="balancesheet" width="50%"> <tr class="balancesheet_header"> <td colspan="2">Airline Flight Count For a Pilot</td> </tr> <tr> <td align="center"><strong>Airline Name</strong></td> <td align="center"><strong>Flight Count</strong></td> </tr> <?php $airlines = OperationsData::getAllAirlines(); foreach($airlines as …
Last reply by michael Kraan, -
- 0 replies
- 2.4k views
As I look throughout more and more virtual airlines, I notice the URL to contain a somewhat confusing string 'index.php' for some users. For example, one can access a module by typing out virtualairline.com/index.php/schedules. This small script removes the index.php and allows you to directly access that part of the website by typing in virtualairline.com/schedules instead. Open up file manager, and be sure to checkmark the box 'Show hidden files' on the root selector that pops up in cpanel. Browse to your Virtual airline root folder(Where phpvms is installed) Open up the .htaccess file Copy/Paste the following code RewriteEngine on RewriteCond %{REQUEST_FILE…
Last reply by magicflyer, -
- 18 replies
- 12.5k 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, -
- 1 follower
- 1 reply
- 4.6k views
To anybody that uses bootstrap on their site: You will notice that on a site running bootstrap, any use of google maps will screw up. This is due to conflicting css statements in the bootstrap.css. If you look in your acars.js, find the following line: var map = new google.maps.Map(document.getElementById(acarsmap"), options); Notice the word "acarsmap" and this is important. In bootstrap.css find this (or similar): #map_canvas img { max-width: none; } and change it to look like this: #acarsmap img { max-width: none; } And, it should be perfect now. It may still conflict with the maps on flight briefings, and this may involve add another few li…
Last reply by Strider, -
- 5 replies
- 5.3k views
Hi guys, Our IVAO division want to see our PIREPS list with IVAO ID of each pilot. We have a custom field (phpvms_customfield) called IVAO. I did the code below. Its working (http://truewings.com.br/all_pireps_tws.php), but i can't see the pilot ivao id of the pirep sent. This part of the code is note ready. anybordy can help me? How canget this data from phpvms_customfield? <?php $servidor = ""; /*maquina a qual o banco de dados está*/ $usuario = ""; /*usuario do banco de dados MySql*/ $senha = ""; /*senha do banco de dados MySql*/ $banco = ""; /*seleciona o banco a ser usado*/ $conexao = mysql_connect($servidor,$usuario,$senha); /*Conecta no bando de dados…
Last reply by Ademar Andrade, -
- 1 follower
- 10 replies
- 3.1k views
Does anyone have a code snippet to access database fields. I am trying to grab the total flights by a pilot, I can't seem to get this even after looking into the API. Thanks,
Last reply by Tom, -
- 0 replies
- 2k views
Hello everyone, I have a French VA and I would like to know how to get the same theme one in English and one in French? Someone there can you help me please? Regards Fred. http://phpvms.p3d-simulation.fr session_start(); if(isset($_GET['template']) && $_GET['template'] != ''){ $_SESSION['template'] = $_GET['template']; define('CURRENT_SKIN',$_GET['template']); } if(isset($_SESSION['template']) && $_SESSION['template'] != '') { define('CURRENT_SKIN',$_SESSION['template']); } ?template=fr or ?template=uk Solution HERE Thanks to monkeypaw201
Last reply by FSX30HD, -
- 2 followers
- 4 replies
- 2.2k views
Going back to this after a few months, still no avail: public function totalPax($pilotid){ $query = "SELECT SUM(load) AS totalpax FROM phpvms_pireps WHERE pilotid = '".$pilotid."'"; $result = DB::get_row($query); return $result->totalpax; } I am completely stumped. The only thing that comes to mind is that the field name is wrong, but I checked and right enough it is called 'load'.
Last reply by freshJet, -
- 6 replies
- 3.2k 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, -
- 4 replies
- 4.8k 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.7k 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
- 3.2k 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.7k 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.8k 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.6k 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.6k 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
- 4.1k 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.7k 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.6k 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.4k 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
- 4k 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.8k 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,