Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 18 replies
- 6.3k 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, -
- 2 followers
- 17 replies
- 12.8k 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, -
- 16 replies
- 5k views
Hey Guys, Well this is a record, I aint asked for help for a bit of time! Ok, So is there a way to do something like this... (UK FLAG) Total Pilots: 100 (US FLAG) Total Pilots: 100 (DE FLAG) Total Pilots: 100 etc... Thomas.
Last reply by mark1million, -
- 16 replies
- 5.7k views
Does anyone know the code for this? I have seen one before, however it was for the public profile. I've got it working too, but I want it now on the Pilot Centre, so when the pilot views the pilot centre, it says how long it's been since their last flight, for example: Your last flight was 3 days ago. That way, they know whether they are in danger of being marked inactive or not. I remember Virtual Norwegian had it when I flew for them...
Last reply by tutmeister, -
- 2 followers
- 16 replies
- 11.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, -
- 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, -
- 14 replies
- 9.7k views
Good day, I'm trying to display current bids, in table format, in the main body of the front page without much luck. The problem is that no data is displayed even though there are bids, there are also no error messages displayed. Any help would be greatly appreciated. Many thanks Mark
Last reply by Harryh, -
staff online
by VAEA- 1 follower
- 14 replies
- 6.7k 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
- 10.2k views
This may have been covered before but is there a way to Put the ADD BID link on the Pilot Brief page. This would help my pilots so that instead of hitting the back button on their browser they could just add the bid to their schedules from the Pilot brief page. When you use the back tab it bring up all the current schedules. Any ideas? I tried to put the add bid code in from the schedule_results.tpl on to the schedule_briefing.tpl page and all I got was the word ADD BID but it had no action to it. Thanks for any help in this,
Last reply by AUZ, -
- 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, -
- 13 replies
- 3.8k 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, -
- 13 replies
- 5.2k views
Hi Guys, I'm trying to code a form that enables pilots to enter in a nickname of their choice and click connect and then it logs them into the server with that nickname but i already have this working.The bit I would like to do is that once the pilot is logged in to phpVMS. When he uses the form to login to the TeamSpeak server his username is already there in the nickname box in a defined pattern. I would like the value box on the form to be able to pull the firstname lastname and pilot id, For example Michael Atherton JCA001. I have tried this code <center>Pilot Name - Pilot ID<br> <input type="text" name="NICKNAME" value="<?php echo PilotData::get…
Last reply by kkoseoglu, -
- 2 followers
- 13 replies
- 5.8k 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, -
- 12 replies
- 6.1k views
Hey, If you would like an awards table if your site, use this code. The table is totally plain, but fully customisable using your standard table css/html. profile_mail.tpl <p> <strong>My Awards</strong><br /> <?php if(!$allawards) { echo 'No awards yet'; } else { /* To show the image: <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /> */ ?> <ul> <table width="790" border="0" cellspacing="5" cellpadding="5"> <?php foreach($allawards as $award){ ?> <tr> <td width="25%"><center><img src="<?php echo $…
Last reply by Jeff, -
- 12 replies
- 52.6k views
Hi all, Does anyone have the code for displaying phpbb3 latest forum posts on the frontpage? also is there a auto register code for phpbb? thanks in advance Scott
Last reply by TAV1702, -
There is no field for this so if I want the booking date I presume I would just find the phpvms_bids table and add a date field to for a timestamp? And if so is that all or is there more to it?
Last reply by Txmmy83, -
- 1 follower
- 12 replies
- 6.6k views
Hello. I'm designing a system for automatic approval of pireps this system when the forwards pilot send your PIREP, the system reads the file PIREP "Log Check" Files for downloads http://www.crocko.co...Pirepsystem.rar File "LOGCHECK.TPL" Archive for approval of aircraft Log.tpl Can someone tell me if I'm going the right way? is my first system
Last reply by eliezerazevedo, -
- 12 replies
- 4.8k views
Hi guys, I'm trying to populate the the route_detais in phpvms_acarsdata table. Now im using a custom KACARS by Jeff. But, at this moment, he can't get any new order. Thanks for any help,
Last reply by Ademar Andrade, -
- 12 replies
- 4.2k 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, -
- 11 replies
- 5.6k views
1_Edit the "frontpage_main.tpl" in /core/templates or /lib/Skins/. 2_ Place this code: <h3>Users Online<br /> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); ?> </h3> <h4 class="style6">Pilots Online </h4> <?php foreach($usersonline as $pilot) { echo "<p>"; echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />'; echo " {$pilot->firstname} {$pilot->lastname}<br />"; echo "</p>"; } ?> <br /> Have <?php ech…
Last reply by Thomas, -
- 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, -
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, -
- 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, -
- 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
- 5k views
If you would like to use phpfree chat, here goes. Visit their page for docs, their info is really helpful. Upload phpfree chat to your website . Place this at the beginning of your chat page. <?php require_once dirname(__FILE__)."/phpfreechat-1.5/src/phpfreechat.class.php"; //this is the location of your chat directory $params = array(); $params["admins"] = array('your-admin-name' => 'your-password');//this is the admin name and password - you can have more than one admin $params["title"] = "Pilot's Lounge"; //name of the chat room $params['firstisadmin'] = false; //do not change this $params["theme"] = "blune"; //this is where you change the theme $params['…
Last reply by RogerB, -
- 11 replies
- 3.9k views
Hello, Would anybody know the code to split up the hubs into airline categories on the registration page like this?. Regards Michael
Last reply by Stealthbird97, -
- 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, -
- 1 follower
- 10 replies
- 3.9k 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, -
- 1 follower
- 10 replies
- 3.3k 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, -
- 10 replies
- 5.3k views
Decided to post this here as it's now lying around doing nothing. It's a jQuery slideshow plugin I created a few months ago, with the intention of publishing it elsewhere commercially. Instead, I'm posting it here for free. jQuery image sliders/slideshows are popular on VA websites. A lot of the times the ones available are quite complex. I remember when I first started making them I felt they were too complex for my needs. It's being released under the MIT licence, so you can use it as you wish, even commercially, provided you keep the copyright header in the code. Enjoy! simpleSlideshow.zip
Last reply by freshJet,