Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 20 replies
- 4.4k views
Hello, I am looking for the aircraft registration, the flight number without the IATA Code, the departure hour, departure minute, arrival hour, arrival minute and the route on the briefing page. Does someone have this codes? Greetings Julius
Last reply by alpsJet, -
- 3 replies
- 2.1k views
Hello, I'm trying to do a search for bands of time using the form Frontschedules. In the airport search.tpl I entered this search option: <tr> <td>Orario</td> <td> <select class="search" name="deptime"> <option value="">All</option> <option value="00:01|08:00">00.01/08.00</option> <option value="08:01|16:00">08.01/16.00</option> <option value="16:01|24:00">16.01/24.00</option> </select> </td> </tr> In the FrontSchedules.php: public function findflight() { $arricao = DB::escape($this->post->arricao); $…
Last reply by ln-asm, -
- 1 follower
- 0 replies
- 2.1k views
<?php $fieldvalue = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); if($fieldvalue != '') { echo '<a href="http://vatstats.net/pilots/details/'.$fieldvalue.'" target="_blank"><img src="'.SITE_URL.'/lib/skins/SKIN_NAME/images/vatsim.gif" alt="Vatsim ID" border="0" /></a>'; } ?> Place the above code in the pilots_list.tpl file, and create the image. place it in your skin folder images folder. Note: It won't get everyone's info, as they have to fly online for it to get their details. But once they do, it will show the details.
Last reply by Strider, -
- 1 reply
- 2.2k views
Hi, we have multiple Airline in our system but we require our pilots to start out at DLH . How can i make it to where that is the only DLH they can choose upon registration? Best Regards
Last reply by Steve Bartlett, -
- 0 replies
- 1.9k views
Hey guys! We don't use ACARS for my VA but I was wondering if there is a way of taking waypoints from the route assigned to that particular flight and then displaying them on the route map on the PIREP page rather than on the ACARS map as I've already seen. Please reply if you can help! Thanks, Theo.
Last reply by TB1, -
- 2 followers
- 55 replies
- 26.3k views
EDITED ON 20/03/14 - FORGOT ABOUT 3RD FILE AMEND AND ADDED SOME OPTIONAL TWEAKS. If like me, you want to have the route for each live flight shown on the ACARS map, you can make the amendments to three files in order to do so. I've tested this on a custom KACARS install. This will work for scheduled and charter flights as long as a route is entered either in the schedule, or entered into the ACARS program. If a route doesn't exist in the schedule, or one isn't entered in the ACARS program, a straight point to point line will be shown. Files to edit: ​​Make backups of these two files before you proceed!! /core/modules/ACARS/ACARS.php /common/NavData.class.php …
Last reply by Lebitek, -
- 18 replies
- 5.6k views
Is your Human Resources department tired of sending out welcome emails with their demographic information and general airline info? Here is a template I have constructed to solve the issue. It uses PHP Tags to pull registration info from the database such as pilot name, pilot ID, chosen hub, etc. Now you can spend less time sending emails and more time flying! Simply replace your email_registrationaccepted.tpl file with this code http://pastebin.com/Q2v4VuUR Cheers!
Last reply by simpilot, -
- 0 replies
- 1.7k views
Want to make your images a bit more interactive? You can now with the following image style. Just hover over the image and it will bounce. Instructions ------------------------------ 1. Place the following CSS in your main style or css file http://pastebin.com/Z7hguc1j 2. Place the following HTML where you want the image(s) to appear. http://pastebin.com/cufq8En2 Enjoy! Video Demo http://www.youtube.com/watch?v=8pNvzUbkdu4
Last reply by StartVM, -
- 1 follower
- 21 replies
- 9k views
Hello guys, I just wanted to share with you some code I have running on our logging site. For this to work you need Zumeweb's Pacific skin, stuartpb's Airport Information Addon and Vansers VFleetTracker added. This bit of code will display flights that have been bidded on on a table form with some cool links to the modules listed above. When there is a flight that has been bidded on something like this will appear: If no flights have been bidded on then this will appear: (not the latest flights table, the thing below that). Here is the code: <?php $lastbid = SchedulesData::GetAllBids(); if (count($lastbid) > 0) { ?> <div class="row-fluid"> &l…
Last reply by Heritage1, -
- 0 replies
- 2.1k views
<img src="<?php echo SITE_URL?>/lib/images/acars/<%=flight.phasedetail%>.png" alt="<%=flight.phasedetail%>"/> Place the above code in your acarsmap.tpl file, in your lib/images folder create a folder called acars. and use your acars map to create the images and name the images exactly how it looks on your acars map. You should have something that looks like: http://malaysiava.org/index.php/acars
Last reply by Strider, -
- 1 follower
- 6 replies
- 3k views
This was originally a cry for help, but here's a nifty piece of code for you all to use. It shows the top five most frequent flights flown bu the airline. public function topRoutes(){ $query = "SELECT depicao, arricao, COUNT(*) AS count FROM phpvms_pireps GROUP BY depicao, arricao ORDER BY count DESC LIMIT 5"; $results = DB::get_results($query); return $results; } You can then return the depicao, arricao and count.
Last reply by simpilot, -
- 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, -
- 0 replies
- 1.5k views
Hey guys. I just wanted to share with you a small bit of code that I am using. This will format your total earnings in your pilot's signatures as a monetary amount. An example of this is in my forum signature. Should you wish to use it, the code needs to be placed in line 977 of the PilotData.class.php file. Overwrite anything that's already there but I would advise you make a backup. Hope someone finds this useful! if(Config::Get('SIGNATURE_SHOW_EARNINGS') == true) { $output[] = 'Total Earnings: ' . FinanceData::FormatMoney($pilot->totalpay); }
Last reply by TB1, -
- 5 replies
- 2.3k views
Hi, we have multiple HUBs but we require our pilots to start out at CYYC (our training HUB). How can i make it to where that is the only HUB they can choose upon registration?
Last reply by Taran, -
- 1 follower
- 2 replies
- 2.9k views
Hi guys, This is my code for a live flight board on my frontpage. Can anyone suggest an addition to the code which would mean that when a pilot bids on a flight, it will appear on the flight board as 'In Flight'. Thanks! <div class="row-fluid"> <div class="span12"> <div class="box"> <table width="100%" border="0" bordercolor="#FFFFFF"> <h3><center>Latest Flights</h3> </div> <?php $count = 5; $pireps = PIREPData::getRecentReportsByCount($count); ?> <style type="text/css"> table th { text-align: center; color:black; font-weight:bold;} table td { text-align: center; } </style> <thead> <tr> …
Last reply by TB1, -
- 0 replies
- 1.4k 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, -
- 3 replies
- 2.5k views
Hi. What do I need to do to activate the landing rate on the pireps? Thank you, Kenny.
Last reply by Strider, -
- 2 replies
- 1.7k 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.1k 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.5k 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, -
- 4 replies
- 2.3k 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, -
- 0 replies
- 2.2k 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, -
- 5 replies
- 5k 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
- 1 reply
- 4.4k 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, -
- 2 followers
- 17 replies
- 12.2k views
Hi guys, These days our team changed our acars map using some codes below. acarsmap.tpl <head> <script language="javascript" type="text/javascript"> // function to calculate local time // in a different city // given the city's UTC offset function calcTime() { var index = document.getElementById('DropDownTimezone').selectedIndex; var offset = document.getElementById('DropDownTimezone').value; var timeZone = document.getElementById('DropDownTimezone').options[index].text; // create Date object for current location d = new Date(); // convert to msec // add local time zone offset // get UTC time in msec utc = d.getTime() + (d.getTimezoneOffset() * 60000)…
Last reply by LH154, -
- 4 replies
- 2.3k views
Need a new twitter feed in light of the new API (yes, it's been some time now). It's useless how the new one requires OAuth etc, whereas with the old one it was a case of a few lines of PHP or Javascript. Any suggestions?
Last reply by freshJet, -
- 1 follower
- 10 replies
- 2.8k 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, -
- 2 followers
- 16 replies
- 10.1k views
G'day Guys, I've been fidding around with METAR information, and have managed to get a working script of the VATSIM metar information. Best part about it is that there is NO iframes! Here is a quick shot to show you what it looks like For Departure Airport: <?php $metar = $_POST['metar']; $url = 'http://metar.vatsim.net/'.$schedule->depicao.''; $page = file_get_contents($url); echo $page; ?> For Arrival Airport: <?php $metar = $_POST['metar']; $url = 'http://metar.vatsim.net/'.$schedule->arricao.''; $page = file_get_contents($url); echo $page; ?> Hopefully you guys find this valuable
Last reply by Nabeel, -
- 0 replies
- 1.8k 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
- 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,