Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 6 replies
- 3.8k views
Hi there, I dont know if this is the rigth site to post this message. Im making a progress tours table, the previous versión work (http://sparkadsl.0lx...progresodetours) But, i cant make a condition with ten values (ten routes) because not work. Actually I did that when a pilot complete the last route (the numer ten) the data base send the answer "pilotid" and "accepted", so are two values. mysql_select_db($database_byethost, $byethost); $query_Tablafinaltours = "SELECT `phpvms_pireps`.`pilotid` , `phpvms_pireps`.`accepted` FROM phpvms_pireps WHERE ( ( `phpvms_pireps`.`flightnum` ='GB10' ) AND ( `phpvms_pireps`.`accepted` =1 ) ) ORDER BY `phpvms_pireps`.`pilotid`…
Last reply by ARV187, -
- 4 replies
- 2.2k 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, -
- 1 follower
- 21 replies
- 8.9k views
Hello guys, I just wanted to share with you some code I have running on our logging site. For this to work you need Zumeweb's Pacific skin, stuartpb's Airport Information Addon and Vansers VFleetTracker added. This bit of code will display flights that have been bidded on on a table form with some cool links to the modules listed above. When there is a flight that has been bidded on something like this will appear: If no flights have been bidded on then this will appear: (not the latest flights table, the thing below that). Here is the code: <?php $lastbid = SchedulesData::GetAllBids(); if (count($lastbid) > 0) { ?> <div class="row-fluid"> &l…
Last reply by Heritage1, -
- 18 replies
- 7.9k views
Hi all, Sorry if I put this in the wrong place. I wanted to know if it is possible to have a default skin for phpvms to load and then in each users profile section of the site under the profile options heading have a drop down box so they can select a skin and save it so that it becomes their fav skin and loads when ever they log in without affecting the skin other users see. An example of what I am trying to say is they user theme selection many forums use. Any thoughts on the idea would be great Cheers Jonny
Last reply by Nabeel, -
- 9 replies
- 3.4k views
Hi all I have adapted my code to show country and rank but I have a problem it shows the country fine but not the rank here is my code any help would be great thanks. <div id="box"> <div> <h2>Users Online</h2> <p> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); ?> <h4>Pilots Online</h4> <?php $shown = array(); foreach($usersonline as $pilot) { if(in_array($pilot->pilotid, $shown)) continue; else $shown[] = $pilot->pilotid; echo "<p>"; echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot-&…
Last reply by Stealthbird97, -
- 2 replies
- 1.9k views
Hello! I'm hoping someone can help! I'm looking to use a search text box instead of a dropdown menu on our Schedule Search page (http://flyhighva.net/index.php/schedules) I'm smart enough to realize that the file I want to play around with is schedule_searchform.php I am NOT smart enough, however, to mess around too much without breaking something. I'm good at editing and building off of someone else's start - but I for the life of me can't start something new (if that makes any sense, lol) The area of code I'm looking at changing to allow a pilot to enter a ICAO code instead of searching the never-ending dropdown menu is lines 16 thru 45: …
Last reply by Dyl1103, -
- 21 replies
- 10.6k 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, -
- 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, -
- 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, -
- 5 replies
- 3.8k views
Can somebody please explain to me how to get the vatsim ID on the pilot roster. If it is already here, i just cant find it... sorry, Thanks!
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, -
- 2 followers
- 16 replies
- 10k 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, -
- 0 replies
- 1.6k 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, -
- 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, -
- 5 replies
- 2.2k views
a small code that displays information on the VATSIM pilotin order to work the script I made in the database phpvms_pilots column "CID" and put in his ID number vatsim pilots. <div class="col col_5_of_12"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-wifi" aria-hidden="true"></i> Vatsim Pilot </h3> </div> <div class="panel-body"> <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://api.vateud.net/members/id/$userinfo->cid.json"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); $response = cu…
Last reply by Jetwave, -
- 0 replies
- 1.9k 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, -
- 19 replies
- 6.2k views
Hey guys, i made a template to use this great weather map with phpvms. Its just a iframe but its doing his job! The map is very accurate!!.. i tested it yesterday with AS16 (P3D) https://www.ventusky.com/ put this in core/modules/ACARS/ACARS.php public function viewmapwxr() { $this->render('wxrmap.php'); } create a file called "wxrmap.php" inyour /lib/skins/YOURSKIN/wxrmap.php <style> .embed-container { position: relative; padding-bottom: 56.25%; /* ratio 16x9 */ height: 0; overflow: hidden; width: 100%; height: auto; } .embed-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /* ratio 4x3 *…
Last reply by Lausitzaircargo, -
- 1 reply
- 1.4k views
Anyone have the code or know how I can add like something showing our Team Speak Server?
Last reply by servetas, -
- 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, -
- 2 replies
- 2.3k views
anyone know the code to put there PID in the welcome email?
Last reply by Ahmad, -
- 1 reply
- 3.8k views
how would i set my site up so it says welcome guest when ur not logged in but ur name when u are logged in?
Last reply by flyalaska, -
- 8 replies
- 4k views
Hello All, does anybody have the code for this, I need the green table around it as well. it is on Alaska adventures virtual. Thanks
Last reply by Cor, -
- 7 replies
- 4.8k views
need help with code to put up stats from a whazzup.txt file. I have this info...and am not sure what to do with it.... <? $whazzuptxt = "whazzup.txt"; //get file $file = file_get_contents('whazzup.txt'); //get clients preg_match('/!CLIENTS(.*?)!SERVERS/ms', $file, $results); $content = trim($results[1]); //get out \r\n so on $lines = preg_split('/(\015\012)|(\015)|(\012)/', $content); //filter for pilot and atc clients function filter ($value) { if (strpos($value, 'PILOT') !== false){ return true; }elseif(strpos($value, 'ATC') !== false){ return true; }else{ return false; } } $lines = array_filter($lines, 'filter'); $br = "<br>"; /g…
Last reply by Jeff, -
- 0 replies
- 1.3k views
OK, so I posted a thing about a Login PopUp a while ago, but now I'm stuck. I found this: http://docs.jquery.com/UI/Dialog What the hell do I do? I want it to show after the user has logged in and is being redirected to the profile_main.tpl. What parts of the code on the jQuery tutorial do I need, and where do I put them? Also, I only want this to show once.
Last reply by freshJet, -
- 0 replies
- 1.7k views
I did widget page "EVENTS" and trying to do so that the informer was deduced on the personal page of pilots ... can someone tell me how to do it? <!-- START .main-contents --> <div class="main-contents"> <div class="container"> <div class="row"> <div class="col-md-3"> <div class="ft-item"> <span class="ft-image"> <img src="<?php echo $event->image; ?>" alt="Event Image" /> </span> <div class="ft-data"> <p><a href="#" class="ft-plane text-upper"><?php echo $event->arr; ?>-<?php echo $event->arr; ?></a></p> <p>Sch/Num: <?php echo $event-…
Last reply by bass, -
- 1 reply
- 1.6k views
Hi! This is my first post here =) I've been working on a module where the central idea is to dynamically update airports visited and divided by country and continent. Just follow the template module. If anyone wants to help me, any help is welcome....pm me. teste.zip
Last reply by nabpp, -
- 10 replies
- 6.9k 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,