Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 0 replies
- 1.7k 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.7k 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.9k 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.9k 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
- 3.1k 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
- 2k views
Can anyone share there pilots page that separates by Airline?
Last reply by Strider, -
- 0 replies
- 2.1k 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.8k 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.9k 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.8k 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.8k 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.7k 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.5k 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
- 5.3k 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.4k 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
- 2k 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
- 2k 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, -
- 3 replies
- 1.9k views
Hi all, Is there a module about or a piece of code that would send an email automatically to a pilot if he/she has not completed a flight within the first 10 days of registering. Or within 30 days of a completed flight Thanks in advance Scott
Last reply by flyalaska, -
- 11 replies
- 5.6k 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, -
- 10 replies
- 5k 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, -
- 2 replies
- 1.7k views
Is there a way to sort the pages by name instead of their ID number?
Last reply by t_bergman, -
- 1 follower
- 2 replies
- 2.5k 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, -
- 3 replies
- 2.1k views
Hi Guys, I have a Question about the Standart News System of phpVMS. Is there a way to change the News Layout from TITLE BODY POSTED BY to TITLE | TITLE BODY | BODY POSTED BY | POSTED BY so that in one row are two news items Great Thanks xhubix
Last reply by xhubix, -
- 12 replies
- 4.5k 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, -
- 18 replies
- 5.8k 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, -
- 1 follower
- 3 replies
- 2.2k views
Im mot sure if this is in the right forum so delete if needed. Is there a way to show who is logged into our TeamSpeak3 server on our website? I've seen a few VA's that have this and was wondering if it is some kind of code or program.
Last reply by Arctiq, -
Hi to All !! How is possible have only the join date and not the hours ? If i put <?php echo $userinfo->joindate;?> The result is: 2008-03-25 01:00:00 I need only 2008-03-25 Thanks
Last reply by Tom, -
- 2 replies
- 2.1k views
I have domicile managers that serve three hubs. I would like them to be able to view there three hubs when they are in the admin center. Right now they can only view the hub they are assigned to. Does anyone know how i can get this to work? Thanks Jorge O'Connor
Last reply by jeep865, -
- 4 replies
- 3.2k views
Hi there! As Air Anatolia VA , we're new on phpvms system and currently we are still stylizing. I was planning to change aircraft icons, there was 360 images files for each heading.Rotating,saving...rotating saving...just boring! And i noticed that ystem works like that in acarsmap.js ; It gets the heading data , and takes the image! I have an idea to simply that but i dont know anything about javascript :/ here is my idea; What if there is just one image file for aircraft icon , and javascript turns it by codes as the heading? Is it possible? If its possible and easy , can anyone help me? Thanks a lot!
Last reply by FSX30HD, -
- 2 replies
- 2k views
Hello, I'd like to know some of the codes for outputting the current financial state of the VA. In particular, I'd like to see how to output the sum total of all profit ever! i.e. the current 'cash' held by the company. In viewing finance_balancesheet.tpl I can only see monthly totals. Any other function calls or documentation are also welcome I am considering creating a little module for a bit of financial role-play immersion.
Last reply by GavinZac,