Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 0 replies
- 1.6k 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.3k 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.7k 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.7k 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.3k 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.2k views
anyone know a code/script for a snow falling effect to add to the site?
Last reply by Vangelis, -
- 4 replies
- 2k 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
- 2k 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.3k 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.3k 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.8k 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.8k 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
- 5.1k 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.6k 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.7k 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.8k 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.8k 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, -
- 3 replies
- 2.2k views
Hello, I'm trying to do a search for bands of time using the form Frontschedules. In the airport search.tpl I entered this search option: <tr> <td>Orario</td> <td> <select class="search" name="deptime"> <option value="">All</option> <option value="00:01|08:00">00.01/08.00</option> <option value="08:01|16:00">08.01/16.00</option> <option value="16:01|24:00">16.01/24.00</option> </select> </td> </tr> In the FrontSchedules.php: public function findflight() { $arricao = DB::escape($this->post->arricao); $…
Last reply by ln-asm, -
- 20 replies
- 4.7k views
Hello, I am looking for the aircraft registration, the flight number without the IATA Code, the departure hour, departure minute, arrival hour, arrival minute and the route on the briefing page. Does someone have this codes? Greetings Julius
Last reply by alpsJet, -
- 1 follower
- 0 replies
- 2.3k views
<?php $fieldvalue = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); if($fieldvalue != '') { echo '<a href="http://vatstats.net/pilots/details/'.$fieldvalue.'" target="_blank"><img src="'.SITE_URL.'/lib/skins/SKIN_NAME/images/vatsim.gif" alt="Vatsim ID" border="0" /></a>'; } ?> Place the above code in the pilots_list.tpl file, and create the image. place it in your skin folder images folder. Note: It won't get everyone's info, as they have to fly online for it to get their details. But once they do, it will show the details.
Last reply by Strider, -
- 1 reply
- 1.9k views
Hi, i hope that anyone can help me. i search for a code that pilots can schedules on time. example: Select An Airline Select your departure airport: Select your arrival airport: Select aircraft: and than: schedule time: i hope that anyone can help greets michael kraan
Last reply by Tato123, -
- 0 replies
- 2k views
Hey guys! We don't use ACARS for my VA but I was wondering if there is a way of taking waypoints from the route assigned to that particular flight and then displaying them on the route map on the PIREP page rather than on the ACARS map as I've already seen. Please reply if you can help! Thanks, Theo.
Last reply by TB1, -
- 0 replies
- 1.8k views
Want to make your images a bit more interactive? You can now with the following image style. Just hover over the image and it will bounce. Instructions ------------------------------ 1. Place the following CSS in your main style or css file http://pastebin.com/Z7hguc1j 2. Place the following HTML where you want the image(s) to appear. http://pastebin.com/cufq8En2 Enjoy! Video Demo http://www.youtube.com/watch?v=8pNvzUbkdu4
Last reply by StartVM, -
- 0 replies
- 2.2k views
<img src="<?php echo SITE_URL?>/lib/images/acars/<%=flight.phasedetail%>.png" alt="<%=flight.phasedetail%>"/> Place the above code in your acarsmap.tpl file, in your lib/images folder create a folder called acars. and use your acars map to create the images and name the images exactly how it looks on your acars map. You should have something that looks like: http://malaysiava.org/index.php/acars
Last reply by Strider, -
- 1 follower
- 6 replies
- 3.2k views
This was originally a cry for help, but here's a nifty piece of code for you all to use. It shows the top five most frequent flights flown bu the airline. public function topRoutes(){ $query = "SELECT depicao, arricao, COUNT(*) AS count FROM phpvms_pireps GROUP BY depicao, arricao ORDER BY count DESC LIMIT 5"; $results = DB::get_results($query); return $results; } You can then return the depicao, arricao and count.
Last reply by simpilot, -
- 3 replies
- 2.6k 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
Need a new twitter feed in light of the new API (yes, it's been some time now). It's useless how the new one requires OAuth etc, whereas with the old one it was a case of a few lines of PHP or Javascript. Any suggestions?
Last reply by freshJet, -
- 2 replies
- 3k views
Hi guys, This is my code for a live flight board on my frontpage. Can anyone suggest an addition to the code which would mean that when a pilot bids on a flight, it will appear on the flight board as 'In Flight'. Thanks! <div class="row-fluid"> <div class="span12"> <div class="box"> <table width="100%" border="0" bordercolor="#FFFFFF"> <h3><center>Latest Flights</h3> </div> <?php $count = 5; $pireps = PIREPData::getRecentReportsByCount($count); ?> <style type="text/css"> table th { text-align: center; color:black; font-weight:bold;} table td { text-align: center; } </style> <thead> <tr> …
Last reply by TB1, -
- 0 replies
- 1.6k views
Hey guys. I just wanted to share with you a small bit of code that I am using. This will format your total earnings in your pilot's signatures as a monetary amount. An example of this is in my forum signature. Should you wish to use it, the code needs to be placed in line 977 of the PilotData.class.php file. Overwrite anything that's already there but I would advise you make a backup. Hope someone finds this useful! if(Config::Get('SIGNATURE_SHOW_EARNINGS') == true) { $output[] = 'Total Earnings: ' . FinanceData::FormatMoney($pilot->totalpay); }
Last reply by TB1, -
- 5 replies
- 2.4k views
Hi, we have multiple HUBs but we require our pilots to start out at CYYC (our training HUB). How can i make it to where that is the only HUB they can choose upon registration?
Last reply by Taran,