Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 3 replies
- 1.8k 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.2k 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
- 4.6k 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.6k 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.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, -
- 3 replies
- 1.9k 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.1k 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.5k 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.1k 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
- 1.9k 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
- 3k 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
- 1.8k 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, -
- 0 replies
- 1.5k views
Similar to my simpleSlideshow plugin, only for an image gallery instead. Released under the MIT licence, free for personal or commercial use provided that the copyright header remains intact. Note: Due to file size restrictions on the forum, I was forced to delete a few of the demo images. simpleGallery.zip
Last reply by freshJet, -
- 5 replies
- 2.2k views
I'm stuck and need some help from the gurus on this board. I am trying to insert phpvms content within another cms without relying on an iframe. I want to be able to use modules within phpvms but use the cms framework to build pages etc with another system. Right now my folder structure is \root\ where the cms is and \root\phpvms\ where phpvms is installed. I've got this code so far but I don't know if I am missing elements? Thanks,
Last reply by Tom, -
- 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, -
- 2 replies
- 1.6k views
Hello I have set up a module in my phpvms and when I link my button in the nav bar it show to everybody as normal but what I would like to do is only show the button to people in a group I have made up in the admin panel. I have found this but it doesn't work just returns and error on the line with the link on. <?php if(Auth::UserInGroup('GroupName')) { echo '<li>Your link here</li>'; } ?> Any ideas how to fix this? Thanks
Last reply by lancaster123, -
- 5 replies
- 2.2k views
Hello, I was wondering, if there was a code that could be made public for a pop up login, so that when the login button is clicked, it slides open for the user to input there details. Regards, Myles
Last reply by StartVM, -
- 1 follower
- 5 replies
- 3.1k views
anyone know a code/script for a snow falling effect to add to the site?
Last reply by Vangelis, -
- 4 replies
- 1.9k views
Anyone know of a script for falling fall leaves or pumpkins? or something for the Fall season? Like the snow effect for xmas?
Last reply by Taran, -
- 2 replies
- 1.8k views
I have noticed quite a few virtual airlines that struggle to secure their website during development and beta testing. As you all know, without the correct protections, it is easy to view the website by appending /index.php to the URL. In order to combat this and restrict access to your entire phpVMS website by IP address, simply replace your index.php file in your root phpVMS directory with this attachment. The original code has been unaltered, I added about 16 lines of code to the top of it for the ip handling. The code is commented and quite self explanatory on how to work it. Cheers! index.php
Last reply by StartVM, -
- 4 replies
- 2.1k views
I have tried <?php echo $price;?> and it didn't giveme error codes but it didn't show it ether is here something im missing? like the guy had code it it put it like this <td><?php echo util::FormatDration($route->flighttime) ; >--></td>
Last reply by jusromaine, -
- 1 reply
- 2.2k views
Hi, we have multiple Airline in our system but we require our pilots to start out at DLH . How can i make it to where that is the only DLH they can choose upon registration? Best Regards
Last reply by Steve Bartlett, -
- 0 replies
- 1.6k views
Place the following on your site to randomly display a quote on page load. I recommend putting it in something like a bootstrap alert as done here http://redwoodva.net. Cheers! http://pastebin.com/KZasTXy6 Note: Everything between the quote that is written in blue, is the text that should be modified. Feel free to add as many quotes to the array as you wish.
Last reply by StartVM, -
- 13 replies
- 4.4k 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, -
- 1 follower
- 4 replies
- 4.9k views
Hi there. I'm the technical support staff from royal jordanian airlines which we are working on. I want to make an online box like this: http://rj-va.uphero.com/box.png. now i used this code <html> <head> <title>...</title> <style type="text/css"> .bg { width:300px; background:#333; border:1px solid #999; border-radius:10px; margin-left:auto; margin-right:auto; } </style> </head> <body> <?php $lng['trafficingb'] = 'Pilots'; $lng['notrafficingb'] = 'There is no traffic in the Jordanian Airspace.'; $weekdays = array( 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 =>…
Last reply by Tameem, -
- 2 followers
- 13 replies
- 5.3k 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, -
- 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, -
- 1 reply
- 1.7k views
Many people have commented that their pilot list items get out of alignment as items go on. Add the following line in each <th> tag as so Example: <th align= "center" width="200px">Crew ID</th> It will make a once misaligned table: http://i.gyazo.com/6df264d06a0e144c5da2548ce0e920e5.png Look Aligned: http://gyazo.com/935e4c5e7015075368ff381217c59b2e Cheers!
Last reply by in2tech, -
- 1 follower
- 5 replies
- 3.6k views
Hi to all, i have a little question. From my site i call this: http://www.virtualir...eflights?cs=VAR and i see the page with my map Now i need start the function with MainController::Run but don't work I use this code <?php MainController::Run('liveflightsivao', 'index', '?cs=VAR'); ?></center> Any suggestion for the correct string ? Thanks
Last reply by Tato123,