Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 0 replies
- 2.8k views
Instead of selecting 'More Than' or 'Less Than' and then typing the value, is there a way to make it so that it displays a jQuery slider to choose the distance filter, changing the results as you slide it? I'm sure most of you know what a jQuery slider is anyway, but here is an example: http://jqueryui.com/demos/slider/
Last reply by freshJet, -
- 4 replies
- 2.7k views
The latest pilots to join thing on the index is nice and dandy if you keep consecutive Pilot IDs. If you change the Pilot IDs on registration (say, for hub purposes) there is an unfortunate problem where it only shows the highest Pilot ID, which may not necessarily be the newest pilot. I whipped up a work-around that should benefit airlines that do this. This simple change can be condensed even more, but I figured I would create a new Method just to keep things clean (and give me something to fall back on later). Open core/common/PilotData.class.php Add this snippet somewhere (perhaps after the getLatestPilots method, Line ~227) public static function getLatestPilot…
Last reply by Vidofnir, -
- 1 follower
- 8 replies
- 2.7k views
Hi made a little Snippet in /core/templates/schedule_results.tpl It shows like this : Here is the code (Line 14-78 in my code) <tbody> <?php foreach($schedule_list as $schedule) { ?> <tr> <td> <a href="<?php echo url('/schedules/details/'.$schedule->id);?>"><?php echo $schedule->code . $schedule->flightnum?> <?php echo '('.$schedule->depicao.' - '.$schedule->arricao.')'?> </a> <br /> <strong>Departure: </strong><?php echo $schedule->deptime;?> <strong>Arrival: </strong><?php echo $schedule->arrtime;?><br /> <strong>Equipm…
Last reply by tutmeister, -
- 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, -
- 5 replies
- 2.7k views
How can I get the total hours a CID has logged under a specific airline ICAO? I've searched the VATSIM API but so far only find info on how to return their ratings or online status.
Last reply by Jetwave, -
- 9 replies
- 2.7k views
Hello, Could Some one provide me the code to echo the password for the signed in pilot, for creation of kAcars config file. pilot id was: <?php echo $pilotcode?> is there some same code but, for the password? greetz, Jacques
Last reply by Oxymoron290, -
Pirep times
by Alex- 4 replies
- 2.7k 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, -
- 0 replies
- 2.7k views
Hey, Hope somebody can help? Is there a way to show the offblock/onblock times, start and finish, also takeoff and landing times? Need help to source a code? TIA
Last reply by Mickey, -
- 1 follower
- 8 replies
- 2.7k views
Hi all. Help create a module. I added the database table RUNWAYS and try to infer information at the page airport_info.tpl But displays information only from one line. For example: Airport UUDD Moscow has 3 runways, but the screen displays only one((( <?php $db = mysql_connect("localhost","xxxx","xxxxx"); mysql_select_db("xxxxx",$db); ?> <?php $resultat = mysql_query("SELECT * FROM runways WHERE airport_ident='$name->icao'",$db); //Выберем вÑе Ð¿Ð¾Ð»Ñ Ð¸Ð· таблицы Runways, где Икао аÑропорта равно к примеру UUDD $array = mysql_fetch_array($resultat); echo "Длина полоÑÑ‹: ".$array['length_ft']."FT<…
Last reply by bass, -
- 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, -
- 2 replies
- 2.5k views
Add under routes section on schedule_briefing.tpl Will display top route flown from vataware I admit not the most graceful code....but what the hay...it works <?php $url = 'http://vataware.com/citypair/'.$schedule->depicao.'-'.$schedule->arricao.''; $page = file_get_contents($url); $start_char = '/flight/'; $end_char = '</a></td>'; $start_pos = strpos($page, $start_char); $end_pos = strpos($page, $end_char); $start_pos += strlen($start_char); $end_pos += strlen($end_char); $string = substr($page, $start_pos, ($end_pos - $start_pos)); $start_char = '>'; $start_pos = strpos($string, $start_char) + 1; $string = substr($string, $start_pos); echo …
Last reply by airhaul, -
need help with free Pirep code
by Guest- 8 replies
- 2.5k views
this is HTML code for Free Pirep and i want use this code in my site can any one help me to change this code and how can i use it in my site <!doctype html public "-//w3c//dtd html 4.01 transitional//en"><HTML> <!-- saved from url=(0031)http://xxxxx/pirep.asp --> <!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Language" content="en-us"> <!-- Validated at 10/27/2011 10:10:38 PM --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin templat…
-
- 2 replies
- 2.5k views
Hello, I was wondering if it was possable to put the latest news from your phpvms website into a channel discription on a teamspeak 3 server? Thanks, James
Last reply by James142, -
- 1 follower
- 3 replies
- 2.5k views
Hi Guys, On our site, when in the registration process, the pilot has to enter their VATSIM CiD. Once registered, that data gets passed to the back-end for the pilot to get accepted/rejected, and the CiD they entered is displayed, my question is, is there a piece of code or API out there that will display the pilots name from VATSIM on the back-end VMS so we can check the name they entered in our system corresponds with that of the VATSIM account. Thanks, Joe
Last reply by joeholden, -
- 4 replies
- 2.5k views
Does anyone know how do I add like to a fleet page how many planes we have on order something that can change automatically
Last reply by Dominican Airways, -
- 4 replies
- 2.5k views
How to add here, "http://www.power-team-radio.com/freedomair/index.php/pireps/view/28" where Route Map is purely the map. who can help
Last reply by TAV1702, -
- 5 replies
- 2.5k views
I would like to set something up on Pilots Profile where only people in Groups can see the content, this has failed. I wondered whether anyone knew a code that would work were only Certain groups can see the content.
Last reply by TAV1702, -
- 2 replies
- 2.5k views
Hey guys, Im trying to have some kind of a document center in my pilot center, So I created a category in the downloads called Documents, Now I want to display only that Category in the Profile_main.tpl I used <?php MainController::Run('Downloads', 'index'); ?> and it displays all the downloads. How would I accomplish this could I use an IF statement? Thanks, Chad C.
Last reply by piper338, -
- 0 replies
- 2.5k views
It's that time of year again so I thought I would share a script I found last year. Really easy to use. <!--Simply copy and paste into <BODY> Just above the </BODY> tag. --> <script type="text/javascript"> /* Snow Fall 1 - no images - Java Script Visit http://rainbow.arch.scriptmania.com/scripts/ for this script and many more */ // 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 Ar…
Last reply by RogerB, -
- 3 replies
- 2.4k views
Hi. What do I need to do to activate the landing rate on the pireps? Thank you, Kenny.
Last reply by Strider, -
- 4 replies
- 2.4k views
NOTE: I apologise for the amount of topics I'm posting, it'll stop once my issues are resolved I was scanning through core/templates for an 'email_removed.tpl' or something, but noticed there is no notification for removing a pilot. So, as I'm about to remove some, does anyone know how I could create one? I could do the email bit fine (creating the tpl and editing etc), but what triggers the emails to be sent? I'd need the code for that, and where it goes... Thanks, Iain.
Last reply by Ahmad, -
- 8 replies
- 2.4k 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, -
- 1 follower
- 2 replies
- 2.4k views
Hello dears, i would like to redirect users after logout to specific website caue the pilot center is in subdomaine also the phpvms i would like to redirect members to specific pages for ex: phpvms.domain.com to domain.com thanks in advance
Last reply by FlyingMachine, -
- 4 replies
- 2.4k views
How can I get the Great Circle Mapper Code only show the Pilots flights. <?php $flights = PIREPData::getRecentReportsByCount(5); $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=790x400&PM=permr:diamond7:green%2b%22%25I%22:white&PC=%fffff" /><br /> Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> It should only show the logged in pilots flights on the map. Thanks in Advance.
Last reply by Stealthbird97, -
- 4 replies
- 2.4k views
I know this has come up before but my search is coming up blank. I may be a bit tired today. I am wondering if there is a code snippet or a release out there that will auto prune users who have registered and have not filed a flight within X amount of days. I know we can auto retire pilots, but this is different. If someone has time to register, why not the time to fly a flight within a week? If they don't have time for at least one flight in a week, they should get pruned. Easy task manually for small dead airlines, but what about busy airlines? Anyone got anything like this?
Last reply by TAV1702, -
- 4 replies
- 2.3k views
I want to add a link on my website so pilots can download or view a word document. Problem is, I don't know where I can post the document so I can link to it. I tried googledocs but it only stores files, you can't link to the file. I tried uploading them via my cpanel, but the link is not recognized. I'm assuming that is because you need to log in to view that page. Any ideas where I could upload these files to?
Last reply by rpalmer800, -
- 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 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, -
- 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, -
- 2 replies
- 2.3k views
I have the currently booked flights showing on my main page of my site. I am having a problem trying to show the airline image for the current booked flight. I can get it to show the spot for the Airline in the title, but I cannot get the image to pull from my image folder. Can someone please please assist me with this. I have been up searching on here for hours and trying to make it work: this is my code:\ Thanks to anyone that can help me with this <h3>Currently Booked Flights</h3> <?php if(!$lastbids) { echo '<p align="left">No flights have currently been booked</p>'; return; } ?> <table width="100%" cellpadding="1" cellspacin…
Last reply by smoke2312,