Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 8 replies
- 5.4k views
Hey guys, I have a new project that I want to do. I noticed the boarding pass does this thing where is gets a random gate, how can I make it randomly select the specific gate at an airport? For example, I have 14 gates at Las Vegas, and 11 gates at San Jose. If a pilot views the boarding pass I want it to randomly select one of the gate numbers I put in for Vegas. Then I plan on taking this method and putting it in my flight dispatch for pilots. So, how would I go about doing this? Would if be possible to write something like if $airport = KLAS select gates x - x or something of the sort? I'm not all to great with php..
Last reply by CPC900, -
- 0 replies
- 1.7k views
-- Delete -- thanks
Last reply by Daniel, -
- 0 replies
- 1.8k views
If you are like me and have not got pagination working yet, some pages can get real long. Here is a quick little trick to get you back to the top of the page and save your index finger for later use. At the very top of the tpl file (page you are working on) add <body id="top"> then add your link at the bottom of the page like such <a href="#top">Back To Top</a> Someone sent me a pm some time back and asked me about it and I forgot to post it in the forums. Better late then never.
Last reply by TAV1702, -
- 2 replies
- 3.4k views
Ok I have spent a month now trying to write my own module... I simply want a list of all the airports and its details (name, icao, and chartlink) I have even tried using an existing class (operations data) and I just can't figure it out. I have a book on php code, but it seems to be different from the VMS. I have used this: and get a table with only the aiport name. The module file simply calls the template. My original class (that I gave up on and have now used the Operation Data one was: I was hoping that someone would be able to give me a very simple example of a class, module, and template so that I can reverse engineer it and figure this all out. I wou…
Last reply by kbohme, -
- 2 replies
- 3.4k views
I have searched the forum and might have missed it, but does anyone have a code snippet to add TS3 server status to the front page of the crystal II skin? Thanks in advance
Last reply by simpilot, -
- 15 replies
- 10.8k 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, -
- 11 replies
- 5.9k views
Hey everyone, I was helping another guy out with a problem and my solution worked for him so I will share it here in snippets. If you ever get an error like this Fatal error: Allowed memory size of 33554432 bytes exhausted on your website while trying to do anything, it is a low memory allowed per script on your server. To remedy this situation you can get into your local config file and find ?> after add ini_set("memory_limit","16M") If this does not work, it will if you go to root/.htaccess and add it there instead. If the 16 does not solve your problem you can bump it up some. Please beware that if it is not your server and you are on shared hosti…
Last reply by regexpress, -
- 11 replies
- 7.1k 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, -
Sorting Active/Inactive Pilots [SOLVED]
by Guest lorathon- 11 replies
- 4.6k views
I looked for the original thread for this but could not find it. This fixes the problem where if you attempt to sort the status of pilots by Active/Inactive the entire list of pilots would disappear. To fix you need to make a modification to one file. /admin/templates/pilots_list.tpl Replace the code in the template with this. (Be sure to make a back-up of the original first.) <h3>Pilots List</h3> <table id="grid"></table> <div id="pager"></div> <br /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo fileurl('/lib/js/jqgrid/css/ui.jqgrid.css');?>" /> <script src="<?php echo fileu…
Last reply by Nabeel, -
- 7 replies
- 3.4k views
I was looking for this code as I want to put a link on the frond page saying: there are 5 xacars flights - click hee to view Thanks for all the help, james
Last reply by James142, -
- 0 replies
- 1.8k views
Hey Guys, All my cargo routes have flight numbers starting with 9. Currently www.zonexecutive.com/index.php/routemap shows ALL routes. I want a separate map maybe like www.zonexecutive.com/index.php/routemap/cargo that shows all schedules with a flight number with a first digit being 9. Any Ideas? Nout
Last reply by Nout - Zon Executive, -
- 4 replies
- 4.2k views
Hi, does anyone have a code for a load sheet in the pilot briefing or does anyone know where I can get the auto-generated pax and load for a flight? The system generates automatically Paxnumber and load when clicking on Send Pirep but I'd like to have it before starting a flight in the briefing in order to load the aircraft correctly. Thanks, Chris.
Last reply by stuartpb, -
- 8 replies
- 4.5k views
Hello All, does anybody have the code for this, I need the green table around it as well. it is on Alaska adventures virtual. Thanks
Last reply by Cor, -
- 13 replies
- 7.3k 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, -
- 8 replies
- 4.2k views
Hi How can i change recaptcha theme ? <script type="text/javascript"> var RecaptchaOptions = { theme : 'theme_name' }; </script>
Last reply by joeri, -
- 21 replies
- 11.4k 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, -
Live Fuel Problem work around
by Guest lorathon- 9 replies
- 5.9k views
Since the live fuel server stopped allowing phpVMS users to access the live fuel I have been seeing too many flights with a zero for fuel price. I am assuming this was due to the copy that Nabeel put up for the live lookup. I still wanted to use the live lookup ( I dont like the idea of all of the airports having the same fuel price) so I just looked for a work around. What I wanted was to be able to poll the live fuel server, if there was a price there then use it. If not then use the default. The problem became that sometimes a zero was sent back. The script would then run the fuel calc with zero as the fuel price. So I dug in and worked out a way to accomplish…
Last reply by Ghiby, -
GCMap - Great Circle Mapper 1 2
by Guest lorathon- 42 replies
- 20.4k 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, -
Recent 5 Flights 1 2
by Jeff- 49 replies
- 25.1k views
I'm trying to show a table of the 5 recent flights flown, and keep running into a brick wall here. Can someone please post the code to show the last 5 flight. Flight Number - Departure Airport - Arrival Airport - Flight Time - Pilot - Landing %
Last reply by Jiko, -
- 18 replies
- 8.8k views
Hi all, Sorry if I put this in the wrong place. I wanted to know if it is possible to have a default skin for phpvms to load and then in each users profile section of the site under the profile options heading have a drop down box so they can select a skin and save it so that it becomes their fav skin and loads when ever they log in without affecting the skin other users see. An example of what I am trying to say is they user theme selection many forums use. Any thoughts on the idea would be great Cheers Jonny
Last reply by Nabeel, -
- 6 replies
- 18.3k views
I did this as a favor for someone, but I figured I'd share it with everyone.. you know, spread the wealth. This code simply reads the RSS feed that SMF outputs (of the latest posts) and returns it as a list (with the option to make it linkable). The implementation technique can vary, you could include the file, or just copy and paste it into your page (~100 lines). <?php /** SMF Forum RSS Feed to Latest Posts List Built for phpVMS www.phpvms.net Built by Lorenzo Aiello www.la92.com **/ /********* CONFIGURATION *********/ // Full URL to your SMF installation, WITH trailing slash $board_url = 'http://forum.yourwebsite.com/'; // Want the list to be linkable?…
Last reply by Strider, -
- 25 replies
- 9.1k views
Portuguese: Ola, Tem Como Eu Colocar No Status da Minha Empresa Aerea Virtual, o numero de passageiros transportados? English: Hello, How I Put It On the Status of My Virtual Airline, the number of passengers carried?
Last reply by TAV1702, -
- 10 replies
- 7.3k views
A great site for worldwide notams & weather at specific airports is notams.com I have found this to be the most reliable and widest coverage of the offerings. Especially if your not US based. It can be integrated using the following code in schedule_breifing.tpl <td width="50%" ><?php echo "{$schedule->depname} ($schedule->depicao)"; ?><br /> <a href="http://<?php echo $schedule->depicao?>.notams.com/Weather" target="_blank">Click here to check the Notam's & Aiport Info</a></td> <td width="50%" ><?php echo "{$schedule->arrname} ($schedule->a…
Last reply by CPC900, -
- 4 replies
- 3.2k views
Hi, just a little question, wich is the code to insert into footer.tpl for show flight this month. Thanks and sorry for this kind of questions. Regards
Last reply by Rickisani, -
- 11 replies
- 7.9k 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, -
- 3 replies
- 3.7k views
Nabeel, i have a pilots list currently displayed in the va stats, listed i have all the countries displaying the flag and location in a table (for anyone else this is the code)Page in action <?php echo '<td align="center" width="250px" valign="top">'; echo '<table cellspacing="1" cellpadding="1" border="1">'; echo '<th width="150px"><div align="left">Country Location</div></th>'; echo '<th width="100px"><div align="center">Pilots</div></th>'; $country_info = DB::get_results('SELECT COUNT(pilotid) as total, location FROM '.TABLE_PREFIX.'pilots GROUP BY LOCATION'); foreach($country_info as $country) { echo …
Last reply by Nabeel, -
- 19 replies
- 7.5k views
Hi everyone, I have been looking about to use Pagination for my pilots pirep pages as some are now getting quite long, i have come across a few but does anyone have experience with integrating in to phpvms, your ideas and thoughts would be welcome Cheers.
Last reply by James142, -
- 20 replies
- 10.5k views
Last Location in Badge Tested on phpvms 2.1 (940) IT DOESN'T WILL WORK IF YOU DIDN'T SEND PIREP! core\common\PilotData.class.php 1. After (LINE 956) $pilot = self::getPilotData($pilotid); add this code $last_location = PIREPData::getLastReports($pilotid, 1, PIREP_ACCEPTED); 2. After  (LINE 974) $output[] = 'Total Hours: ' . $totalhours; add this code $output[] = 'Last Location: ' . $last_location->arricao; Download: PilotData.class.php Should look like this: 1.     $pilot = self::getPilotData($pilotid);     $last_location = PIREPData::getLastReports($pilotid, 1, PIREP_ACCEPTED);     $pilotcode = self::getPi…
Last reply by James142, -
- 2 replies
- 2.3k views
I want to change the title to the Russian language, in which file can I change this? I was looking but never found! Schedules - KD Avia Profile - KD Avia Thanks!
Last reply by Artjom, -
Pirep times
by Alex- 4 replies
- 2.9k views
I have been getting complaints in relation to the filing of Pireps and in particular the flight duration box. We know that 5.3 = 5 1/2hrs or 5 hours 30 minutes. however some people have difficulty with this ???? is there a code snippet to include a box "hours" "minutes" in text format so that this issue can be resolved? Any help with coding would be appreciated, even if it's just to get the monkey off my back.
Last reply by Alex,