Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 3 replies
- 1.9k views
Hi all, hope all is well with everyone. Anyways, I've been trying for few days on how to change the length size of the slider images on my new VA website, I have no clue! can someone please help me. Please visit the site at http://lifeflightvirtual.us/index.php/ Thanks, Tac
Last reply by Karamellwuerfel, -
- 3 replies
- 2.2k views
Hi, I'm not the best at coding but I would like to know if anyone knows a function that will count all live flight from the acars db and put it in a number. For example if the acars map shows 6 flight I would like the function to show 6 Thanks
Last reply by tim260, -
- 1 reply
- 2k views
I am trying to make a way for pilots to search any meter they want. I have done this so far, and it doesn't work, can someone please help? <div> ICAO Code: <input type="text" name="icao"> <input type="submit"> <?php $metar = $_POST['metar']; $url = 'http://metar.vatsim.net/'.'icao'.''; $page = file_get_contents($url); echo $page; ?> …
Last reply by ProSkyDesign, -
- 4 replies
- 2.1k views
Hello php coders, I wanted to create a module for my airline such that an admin can assign a particular flight for the pilot. How do I create it? Can anyone give me a start for this as I tend to create more modules. Thanks!
Last reply by ProSkyDesign, -
- 2 replies
- 1.5k views
Hey folks, This is the code for showing the money on your PROFILE page: <?php echo FinanceData::FormatMoney($userinfo->totalpay) ?> I was wondering what is the code for the MAIN PAGE... It is not the same code!
Last reply by Royzzzz, -
- 1 follower
- 1 reply
- 1.7k views
Hello, Am wondering if anyone would be ever so kind to tell or send me some code. I have seen on various websites airport delays NOTAMS, I would like to implement this into my home page. Thanks
Last reply by Vangelis, -
- 4 replies
- 3.1k 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, -
- 2 replies
- 1.8k views
Hi, is there a code snippet available for the following, a pilot joins and receives BBB002 then leaves another pilot joins, they are given BBB003 by the system, instead of the lowest available number. thanks in advance
Last reply by shaun105, -
- 7 replies
- 6.5k views
Hi all I am trying to show the below code on the profile_main.php but can't get any of the data to show. Here is the code, I have taken this from pirep_viewreport.php <b>Departure Airport</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->depname?> (<?php echo $pirep->depicao; ?>)</p> </li> <li class="list-group-item"> <b>Arrival Airport</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->arrname?> (<?php echo $pirep->arricao; ?>)</p>…
Last reply by sayedzaafir, -
- 0 replies
- 1.7k views
Hi, I wanna share my code that I'm using to the briefing to my pilots. This code display the pax and cargo that they will use to their flight. It incluides Cargo and Passengers flight. <div class="col-md-4"> <table style="width: 100%"> <tr> <td class="auto-style12"><span class="auto-style26"><strong> <?php if($schedule->flighttype == "P") { echo "Pasajeros:"; } else if($schedule->flighttype == "C") { echo "Carga (KG):"; } ?></strong></span> <span class="auto-style26"><?php $allaircraft = OperationsData::GetAllAircraft(true)…
Last reply by ProSkyDesign, -
- 5 replies
- 2.7k views
Hey everyone, Does anyone know how to go about implementing something like the picture I have attached? Just trying to think of ways of "modernizing" the stats shown on our VA.
Last reply by flyalaska, -
- 2 replies
- 1.9k views
Hi guys, wondering if there is any tweaks out there to change fleet page. Is it posssible to seperate all fleet by airline?
Last reply by ProSkyDesign, -
- 0 replies
- 1.3k views
is it possible to show the vaCentrlal Live Map instead the acars map? i cannot find any code for the vacentral llive map...
Last reply by Melli, -
- 1 reply
- 1.5k views
Hello, if i have the function: <?php echo date(DATE_FORMAT.' ', strtotime($data->date)); ?> How is possible show only the Day and not the complete date? Thanks
Last reply by servetas, -
- 4 replies
- 2.3k views
Dear friends, please help me with the site. I want to not registered polzavateli vidili here it is: and authorized vidili here it is: How is it possible to implement?
Last reply by sev, -
- 1 reply
- 2k views
Hey! This code snippet shows the METAR of the current location airport of the pilot. You can put it anywhere (I use it on my frontpage_main) <?php $last_location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED); if(!$last_location) { echo ''; } else { ?> <br><br>Your current airport METAR: <i><?php echo file_get_contents("http://wx.ivao.aero/metar.php?id=$last_location->arricao"); ?></i> <?php } ?> This code snippet uses the IVAO-METAR.
Last reply by servetas, -
- 1 reply
- 1.5k views
Hello, I want to manual submit pilot ranks So I have changed off the rank_auto_calculate to off. No I am wondering if there is a script that will warn all admins when a pilot is reaching the hours needed for promotion. Any help would be appreciated. Rick
Last reply by Heritage1, -
- 0 replies
- 3.3k views
Unless google comes out with a quick fix, here is a fix for an error you are, not a matter of if but when, going to see it. PLEASE RESEARCH THIS FIRST!!!!! DO NOT USE UNLESS YOU ARE SURE! I WILL NOT BE RESPONSIBLE FOR YOUR SECURITY OR WEBSITE. I am not a pro. I just read this on stackoverflow and it worked. line 42 reads: function ReCaptcha It needs to be : public function __construct to fix this: Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ReCaptcha has a deprecated constructor in C:\wamp\www\phpvms\core\lib\recaptcha\recaptchalib.php on line 42 That error is a result of running phpvms on php 7 and m…
Last reply by TAV1702, -
- 0 replies
- 1.5k views
I've come up with this little script code for calling outside pages, and/or scripts. There is no Need to fill up the Admin pages section in phpvms anymore. You can create any html page, php, or even a graphic with this little script. Its very simple, fast an doesn't bog down the layout.php page what so ever. I use it hardcore for calling my own custom html or php files within my sites. For those who are even just a little advanced, there is NO limit to what you can create, I use a sub-directory "pages", and/or whatever you decide to call your custom files. As long as the directory is within the folder where your phpvms lives, then again, there is no limit. You do not ha…
Last reply by Heritage1, -
- 19 replies
- 7.3k 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, -
- 4 replies
- 2.1k views
Just a quick query, I know we have the nav database we can add. Question is, has anyone ever bombed their database with thousands of airports and then exported the table?
Last reply by TAV1702, -
- 4 replies
- 2.4k views
By default, the custom profile fields in phpVMS can't be set as required and most of us have issues when it comes to IVAO or VATSIM ids etc. Today, I decided to implement that feature. The changes can be found here. Let me list them here too: 1) On your database, go to your "TABLE_PREFIX"_customfields table and add a new column with the following details: `required` smallint(6) NOT NULL DEFAULT '0' 2) On your core/templates/registration_customfields.php (or the custom one if you are using a custom template) find this: <dt><?php echo $field->title; ?></dt> and replace with this: <dt><?php echo $field->title; ?><?php if(…
Last reply by servetas, -
- 4 replies
- 3.9k views
Hello, if you want to add METAR & TAF IVAO on your homepage, you can add this litlle part of code : <center><b> METAR: </b> <?php echo file_get_contents("http://wx.ivao.aero/metar.php?id=xxxx"); ?> <br>br> <b> TAF: </b> <?php echo file_get_contents("http://wx.ivao.aero/taf.php?id=xxxx"); ?> <br> </b></center> Replace just the xxxx with the ICAO you want to display.
Last reply by TennShadow, -
- 1 reply
- 2.1k views
I have been playing around with some simple little scrolling News Boxes, and came up with this for everyone. You can have a peek at ; PhPvMs Site= http://heritage-va.net/hva or http://heritage-va.net (Main Site) Look to the right on theses sites, on the home pages. Below are some code snippets for above, and I have added some page scrolling scripts that Work great with PHPVMS also. Hope ya all can use these. Jimbo "Jungle" Heritage VA , CEO <!--Heritage VA 2016 , Demo; http://heritage-va.net/hva--> <!-- Scrolling News or what ever you'd like to scroll in your site The below script must be after the head tag, or the body tag.--> <!-- NOTE: this …
Last reply by shakamonkey88, -
- 1 reply
- 2.2k views
Hi Guys, What im trying to do is when a manual PIREP is submitted on my website I need the arricao to go into a custom field in my aircraft table called location. I have tried changing this section in PIREPData.class.php but it don't work: $sql = "INSERT INTO ".TABLE_PREFIX."pireps( `pilotid`, `code`, `flightnum`, `depicao`, `arricao`, `location`, `route`, `route_details`, `distance`, `aircraft`, `flighttime`, `flighttime_stamp`, `landingrate`, `submitdate`, `accepted`, `log`, `load`, `fuelused`, `expenselist`, `source`, `pob`, `exported`, `rawdata`) VALUES ( {$pirepdata['pilotid']}, '{$pirepdata['code']}', '{$pirepdata['flightnum']}', '{$pi…
Last reply by simpilot, -
- 1 follower
- 2 replies
- 2.4k views
Hello, A few months ago I found a script on this forum to show all the awards next to each other instead of in a row below each other. I cant find it anymore on the site. So can anyone tell me how to create the profile in a way that all the awards will be shown with 4 in a horizontal row, then the fifth is starting on a new row? Kindly regards, Rick Winkelman
Last reply by ncd200, -
- 6 replies
- 3.3k views
full article on my blog: http://code.voemercosul.com/ CODES: http://pastebin.com/jXJFrLL1 http://pastebin.com/TAguaNYb PS.: This is not the best programming method for phpVMS, soon I will post an update of the traditional form code, this is a more inciante method. DEMO: http://voemercosul.com/v2/index.php/Dataroutes aeroportos_tw.sql.zip
Last reply by LuisMoraes132, -
- 1 follower
- 8 replies
- 3.3k views
I've finished a little code snippet for everyone, I was prompted to create this in regards to a particular individual that posted someone else's PHPVMS Skin. Well, the only way this person got this, was either through Fire Fox FireBug plugin, or just plain hacked it. ( the code source that is.) Easy to do now a days, so here, this is for Everyone, and is really simple, short and to the point. This will Protect against a right click to view the page source, if you put this into the ---> layout.php page, and/or the , frontpage_main.php "Anywhere", and of course this can be used anywhere you want. And it IS HTML compliant !! Period. php,htm, html, xml, and xhtml. B…
Last reply by Vangelis, -
- 1 follower
- 3 replies
- 2.2k views
Hello all , i am trying to add the Airport Metar in frontpage_main can anyone help how to do it ? i am trying with several ways but dose not work . also NOTAMS if possible Thank and Regrade.
Last reply by alyousafi, -
- 0 replies
- 2.1k views
I have recently re-vamped the default Modules with some neat Embedded links, pop-up windows that are "Live" and full of cool Features for everyone. it took a little while, but if using this, PAY ATTENTION to it !! I have included a live Metar...Live Map section that is embedded if paying attention to each Arr/Dep... you will see brackets that will throw you into an instant PDF downloadable file. There are a TON of embedded features in this Pilot Brief section, below is the code, the file name is ; schedule_briefing.php Backup your original by just re-naming it, pretty simple. there is also a IFR link directly to flightaware for the Live route. All I can say is this, m…
Last reply by Heritage1,