Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 1 follower
- 2 replies
- 2.3k views
Hello everybody. There is free use of the site on which the script has useful addons for us. Help adapt some scripts under phpvms. Dispatch. I found this site on the hosting, it has become a bit errors, but it does not matter. The main thing is to understand that there can be useful to him. I recorded a short video on how to create a briefing on this site. Can we pull this script and adapt it to our system? Script Download http://www.avsim.su/f/raznoe-24/skript-bukinga-54006.html?action=download&hl=
Last reply by bass, -
- 1 follower
- 3 replies
- 1.8k views
Hello all , i am trying to add the Airport Metar in frontpage_main can anyone help how to do it ? i am trying with several ways but dose not work . also NOTAMS if possible Thank and Regrade.
Last reply by alyousafi, -
- 15 replies
- 10.1k views
Hi All, Just thought this would come in handy basically the user enters the ICAO then the metar will display in an iframe, Preview: When no ICAO entered: When an ICAO code has been entered (EGKK) <form action="weather" method="post"> Get METAR For: <input type="text" name="icao" /> <input type="submit" /> </form> Latest METAR: <iframe src="http://www.vatsim.net/data/metar.php?id=<?php echo $_POST["icao"]; ?>" class="metar" width="200" height="75" frameborder="0" scrolling="no">></iframe> Kind Regards, Jon
Last reply by alyousafi, -
- 0 replies
- 1.9k views
I have recently re-vamped the default Modules with some neat Embedded links, pop-up windows that are "Live" and full of cool Features for everyone. it took a little while, but if using this, PAY ATTENTION to it !! I have included a live Metar...Live Map section that is embedded if paying attention to each Arr/Dep... you will see brackets that will throw you into an instant PDF downloadable file. There are a TON of embedded features in this Pilot Brief section, below is the code, the file name is ; schedule_briefing.php Backup your original by just re-naming it, pretty simple. there is also a IFR link directly to flightaware for the Live route. All I can say is this, m…
Last reply by Heritage1, -
- 4 replies
- 2.2k views
Can someone please help? I have 2 active airlines on my VA and need a code to show what airline does the route. Airline: AUR Flight No: AUR002 Departure: LFLS - 14:30 Arrival: EGJB - 15:20 Equipment: ATR72-500 (G-VZON) Distance: 404.633nm Days Flown: S Route: DANBO UT133 AMORO UT140 PIBAT UM976 OKRIX UH10 AMODO UM729 RESMI UN491 PIGOP UN160 CAN By Airline i have the Airlines code but want it to display its name if possible.
Last reply by web541, -
- 5 replies
- 2.1k views
vFleetTracker I try to make so that page (indeks.tpl) shows the status of each aircraft. - This plane is not booked - This plane is booked - The aircraft in flight - You do not have access to this aircraft. If the aircraft is free - it is possible to click and see which flight you can do it in view of what he's airport. <?php $data = OperationsData::getAllAircraft(); $online = ACARSData::GetACARSData(); $lastbid = ACARSData::GetACARSData(); $airports = array(); foreach(OperationsData::getAllAirports() as $aircraft) $airports[$aircraft->icao] = $aircraft; foreach($data as $aircraft){ if($aircraft->charter == 0) { if($aircraft->icao != 'SU95') conti…
Last reply by bass, -
- 1 reply
- 1.5k views
Help to complete the code. This code should reflect the flight status. - Flight free - No aircraft at the airport - Book as can be seen from the code below, now there is no warning that the aircraft is out of this airport. How do I add ??? at the moment I am using the following code: <?php if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0) { ?> <?php $search1 = (array( 'a.registration' => $route->registration, 's.bidid != 0' )); $schedules = SchedulesData::findSchedules($search1); $disabled = $schedules[0]->registration;if($route->registration==$disabled) { continue; } ?> <div class="btn…
Last reply by bass, -
- 2 replies
- 2k views
Hi folks, If anyone could lend help with this, I would appreciate it. Per this post, I was able to modify the download_list.php file get the image added. What I am trying to figure out now is how to make a link out of the IMG tag so that if a person clicks on the reduced size picture (reduced due to the width attribute), they would be able to see the original full size picture (in a separate window of course). <li style="overflow:hidden;"> <a href="<?php echo url('/downloads/dl/'.$download->id);?>"> <?php echo $download->name?></a><br /> <img src="<?php echo $download->image?>" style="width:150px; vertical-alig…
Last reply by natcret, -
- 0 replies
- 2.3k views
Hello, someone has put to your website this flight map? https://github.com/R-Tur/Vatsim-Flight-Map I have now is a map from another website (Iframe). I would not depend on anybody and put his flight map. Now there is an error associated with the key. Maybe I'm wrong, can someone help make flying the card to work?
Last reply by bass, -
- 1 reply
- 1.6k views
A little snipet that will help you add links for pilots over an amount of logged hours Example i let people over 80 hours to access charter flights so when they go over 80 hours a link comes up in their profile Change number 10 to less or more hours accordingly <?php $url = "http://www.websiteurl.net/index.php/charter"; $site_title = "Charter Flights"; if((Auth::$userinfo->totalhours + Auth::$userinfo->transferhours)<10) { //Dont show anything if hours are less than needed } else { Echo "<a href=$url>$site_title</a>" ; } ?>
Last reply by servetas, -
- 0 replies
- 1.4k views
Hello everyone ... it is possible to access a page (eg: liveries) only pilots who have completed certain routes for download of a premium (special livery)? thanks to a possible reply.
Last reply by gio1961, -
- 4 replies
- 5.7k views
is there a code that allows you to put the pilots hub next to their name in the pilot roster without sorting the roster by hubs?
Last reply by web541, -
- 0 replies
- 1.7k views
I did widget page "EVENTS" and trying to do so that the informer was deduced on the personal page of pilots ... can someone tell me how to do it? <!-- START .main-contents --> <div class="main-contents"> <div class="container"> <div class="row"> <div class="col-md-3"> <div class="ft-item"> <span class="ft-image"> <img src="<?php echo $event->image; ?>" alt="Event Image" /> </span> <div class="ft-data"> <p><a href="#" class="ft-plane text-upper"><?php echo $event->arr; ?>-<?php echo $event->arr; ?></a></p> <p>Sch/Num: <?php echo $event-…
Last reply by bass, -
- 0 replies
- 1.6k views
Hi all, I am sure this has been asked and answered more than once but I am struggling to find the correct way to display if a Pilot is flying on Vatsim. I would like to display it on the live flights board. Any help would be great Thanks in advance Scott
Last reply by Angel Air, -
- 5 replies
- 4.5k views
Hey Guys, Just wanted to give everyone the opportunity to use this great Javascript snow script. To use it for phpVMS just simply follow the directions below. Open layout.tpl and find the </body> tag. Create a line above it and copy and paste the code below. <SCRIPT type="text/javascript"> // 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 Array("Times","Arial","Times","Verdana") // Set the lett…
Last reply by Taran, -
- 1 follower
- 7 replies
- 3.6k 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, -
- 21 replies
- 10.6k views
Hi guys, I would like to add our rank (serious-airlines.com) to my phpvms website for our members to quickly see the rank that we are at that specific moment. is this possible? Regards, Lucas
Last reply by simpilot, -
- 1 follower
- 6 replies
- 2.9k views
Good morning to all , How are you ? I am trying to do something for pilots who has less than 10 flights in our Virtual to prevent download the files from Downloads page in our Virtual how can i do that ?? i have this code but i am not sure if it work and where can i put it $userid = $_SESSION["userid"]; $result = mysql_query("SELECT count(*) from `topics` where `userid` = '$userid') or die(mysql_error()); $topicCount = mysql_result($result,0); if($topicCount < 10){ echo "You have $topicCount topics so far. You need a minimum of 10 to get access to downloads."; } download just for pilot who has more than 10 flights otherways pilot cannot download the fi…
Last reply by servetas, -
- 2 replies
- 1.9k views
Can anyone share there pilots page that separates by Airline?
Last reply by Strider, -
- 0 replies
- 1.9k views
Hello help me? I'm having trouble because my phpvms not this show the information in pafina / index / profile I already tried the tutotial (Getting variables in templates) more will not Tutorial:(http://forum.phpvms.net/page/index.html/_/skinning-and-customization-guides/getting-variables-in-templates-r34) <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link href="<?php echo SITE_URL?>/lib/skins/flytam/style.css" rel="stylesheet" media="all" /> <?php /*Any custom Javascript should be placed below this line, after t…
Last reply by pedrobrandine, -
- 35 replies
- 14.2k views
That code I posted in SimPilot's FrontSchedule search thread, for the "your location" to appear in the departure select field proved problematic, as it was setting everyone's location the same as mine. Not sure why, but it was.Anyway, I've managed to sort it out now. I've posted here because I've modified two files: The airport_search.tpl file from the FrontSchedule Addon (located in your core/templates folder when you have installed the addon.) The default schedule_results.tpl that is shipped with phpVMS First up, replace the code shown below from Simpilot's airport_search.tpl with the code underneath that. airport_search.tpl - Original code: <td>Select…
Last reply by Denver, -
- 9 replies
- 2.7k views
I have top 5 pilots on home page, however the callsign and total hours show like this ... callsign is EIN1234 and the hours are 67 there isnt a space. Could you tell me how to do this. I have added the code below. Thanks in advance. EN123467 <?php $year = date("Y"); $month = date("m")-1; if($month == 0) { //If it's january, previous month is december. $month = 12; $year -= 1; } $pilot = TopPilotData::top_pilot_hours($month, $year, 5); echo '<table>'; foreach ($pilot as $top) { $pilot = PilotData::GetPilotData($top->pilot_id); echo '<tr>'; echo '<td>'.$pilot->firstname.' '.$pilot->lastname…
Last reply by shaun105, -
- 11 replies
- 6.6k views
Good Day everyone ! I have create a small piece of code to use at your pilots_list.tpl to add an icon (Active/Inactive) to the pilot list.(taking data from the pilots active/inactive in admin panel) Demo here: Demo Pilot List The steps you need to follow are: 1. Add this code to add a column at the table: <th>Status</th> 2. Add this code under the column to create a row with the code you need:(replace the "yourskin" with your skin folder name) <td><?php if($pilot->retired == '1') {echo '<img src="'.SITE_URL.'/lib/skins/yourskin/images/no.png" alt="warning" /> - Retired';} else …
Last reply by hurkulez, -
- 2 followers
- 2 replies
- 2.6k views
Wondering if any of the folks out there know code i can use for my registration to take all the airline options away but one? There is a dropdown on the registration form where pilots can choose an airline and i want to get rid of that and make to where, when they all join its under the same airline identifier. Thanks for any help Tyson
Last reply by tdohrer, -
- 1 follower
- 3 replies
- 1.6k views
Anyone know where the list of queries are kept for returning data to a page on your site ?
Last reply by shaun105, -
- 1 follower
- 4 replies
- 2.3k views
In pirep_viewreports.tpl, it tells you the actual flight time, I want to display the expected flight time as set in schedules>flighttime. I came up with: <li><strong>Expected Time: </strong><?php echo $schedule->flighttime; ?></li> But I'm thinking that this doesn't work because it doesn't know what flight to look at? Any help gratefully received
Last reply by Vangelis, -
- 1 follower
- 3 replies
- 5k views
Hello, i'm trying to use google flight search api but dont know how to "decode" the result. The search is ok, i'm using this code with (solutions => "1") i put 1 just for tests, but want more <?php $data = array ( "request" => array( "passengers" => array( adultCount => 1 ), "slice" => array( array( origin => "LIS", destination => "OPO", date => "2015-05-09"), ), solutions => "1" ), ); $data_string = json_encode($data);$ch = curl_init('https://www.googleap...ch?key=MyAPIKey'); curl_setopt($ch, CURLOPT…
Last reply by aliatwa, -
- 0 replies
- 1.3k views
Hello, with the release 5.5 the ranks are calculated with the totalhours is possible calculate the ranks by totalhours + transferhours? If i put on Dbase the number of totalhours + transferhours when recalculate the ranks the system put only the totalhours Thanks
Last reply by Tato123, -
- 4 replies
- 1.9k views
hey all i wanted to create sertain pages but only visible for a select user group in my dropdown. i tried it with a modified version i found here on the forum but no luck annybody care to help me out here. thanks
Last reply by Sava, -
- 1 reply
- 1.9k views
Hey all, Does anyone have a snippet that will display a pilot his past flights on a google map? I am planning on putting it under the pilot center. Thanks!
Last reply by atulumello,