Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 0 replies
- 1.2k 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.4k 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, -
- 2 followers
- 17 replies
- 12.6k views
Hi guys, These days our team changed our acars map using some codes below. acarsmap.tpl <head> <script language="javascript" type="text/javascript"> // function to calculate local time // in a different city // given the city's UTC offset function calcTime() { var index = document.getElementById('DropDownTimezone').selectedIndex; var offset = document.getElementById('DropDownTimezone').value; var timeZone = document.getElementById('DropDownTimezone').options[index].text; // create Date object for current location d = new Date(); // convert to msec // add local time zone offset // get UTC time in msec utc = d.getTime() + (d.getTimezoneOffset() * 60000)…
Last reply by LH154, -
- 2 followers
- 32 replies
- 10.4k views
First off add a column into your phpvms_pilots in your DB as "bonus" the type must be "float" and set default az "0". Then open the following: Admin/modules/PIREPadmin/PIREPAdmin.php go down to line 298 and find the function called : approve_pirep_post(). Now go to the end of it and add the following: After this: # Call the event CodonEvent::Dispatch('pirep_accepted', 'PIREPAdmin', $pirep_details); Add this: # Give Bonus to good pilots $pilotbonus = "500"; $userinfo = PilotData::getPilotData($pirep_details->pilotid); if($pirep_details->landingrate > -50 OR $pirep_details->flighttime > 8) { $totalpay = $pilotbonus + $userinfo->totalpay ; $…
Last reply by Parkho, -
- 1 reply
- 1.9k 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.4k 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.2k 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, -
- 1 follower
- 8 replies
- 3.1k 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, -
- 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, -
- 6 replies
- 3.5k views
Can someone help me with this topic? I finished code to show schedules for aircrafts located on airport based on last pirep. Next step and need help with code, probably in Schedule.php and schedule_results.tpl -> when flight is in bid i need to bided aircraft will be hidden from all schedules to time, when flight is in bid.
Last reply by Yash, -
- 4 replies
- 2k 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, -
- 12 replies
- 52.1k views
Hi all, Does anyone have the code for displaying phpbb3 latest forum posts on the frontpage? also is there a auto register code for phpbb? thanks in advance Scott
Last reply by TAV1702, -
- 4 replies
- 3.7k 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 follower
- 12 replies
- 6.4k views
Hello. I'm designing a system for automatic approval of pireps this system when the forwards pilot send your PIREP, the system reads the file PIREP "Log Check" Files for downloads http://www.crocko.co...Pirepsystem.rar File "LOGCHECK.TPL" Archive for approval of aircraft Log.tpl Can someone tell me if I'm going the right way? is my first system
Last reply by eliezerazevedo, -
- 6 replies
- 4.7k views
Here is the code for the IVAO status image in the roster: $feildvalue = PilotData::GetFieldValue($pilot->pilotid, 'IVAO ID'); if($feildvalue != '') { echo '<img src="http://status.ivao.aero/R/'.$feildvalue.'.png">'; } Place it in your pilots_list.tpl, and save it to your skin folder. Change the IVAO ID to what ever it is in your database. You can use the correct spelling for feildvalue to what you want, you can even change it to another name if you like.
Last reply by buraktiftikci, -
- 4 replies
- 2.3k 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, -
- 1 follower
- 22 replies
- 14.4k views
Ok, Since people is trying to find stats, so I'll post all of the stats here....... # Of Pilots <?php echo StatsData::PilotCount(); ?> Total Hours <?php echo StatsData::TotalHours(); ?> Total Flights <?php echo StatsData::TotalFlights(); ?> Total Distance <?php echo StatsData::TotalMilesFlown(); ?> Total Schedules <?php echo StatsData::TotalSchedules (); ?> Total News Posted <?php echo StatsData::TotalNewsItems (); ?> Total Passengers <?php echo StatsData::TotalPaxCarried (); ?> Total Fuel Burned <?php echo StatsData::TotalFuelBurned () ; ?> Total Aircraft <?php echo Sta…
Last reply by orobouros, -
- 12 replies
- 4k views
Hey Guys, The following will place a pullout content box on the left pane of your website that fluidly slides out when hovered over. For example, you may use it as a login box as presented in this release. 1. Paste the following in your style.css or main style file http://pastebin.com/hnw9DcTG 2. Place the following on the next line under your <body> tag http://pastebin.com/WcxfisiM When done correctly, it should function as shown is the following video http://www.youtube.com/watch?v=9u_zusDvrR0 Hope you guys find use for this! Chase Morgan | CEO Hawaiian Virtual Airlines cmorgan@hawaiianva.org
Last reply by shakamonkey88, -
- 1 reply
- 2k 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.1k 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.3k 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.2k 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
- 3 replies
- 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, -
- 15 replies
- 10.6k views
Hi All, Just thought this would come in handy basically the user enters the ICAO then the metar will display in an iframe, Preview: When no ICAO entered: When an ICAO code has been entered (EGKK) <form action="weather" method="post"> Get METAR For: <input type="text" name="icao" /> <input type="submit" /> </form> Latest METAR: <iframe src="http://www.vatsim.net/data/metar.php?id=<?php echo $_POST["icao"]; ?>" class="metar" width="200" height="75" frameborder="0" scrolling="no">></iframe> Kind Regards, Jon
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, -
- 4 replies
- 2.4k views
Can someone please help? I have 2 active airlines on my VA and need a code to show what airline does the route. Airline: AUR Flight No: AUR002 Departure: LFLS - 14:30 Arrival: EGJB - 15:20 Equipment: ATR72-500 (G-VZON) Distance: 404.633nm Days Flown: S Route: DANBO UT133 AMORO UT140 PIBAT UM976 OKRIX UH10 AMODO UM729 RESMI UN491 PIGOP UN160 CAN By Airline i have the Airlines code but want it to display its name if possible.
Last reply by web541, -
- 2 replies
- 2.2k views
Hi folks, If anyone could lend help with this, I would appreciate it. Per this post, I was able to modify the download_list.php file get the image added. What I am trying to figure out now is how to make a link out of the IMG tag so that if a person clicks on the reduced size picture (reduced due to the width attribute), they would be able to see the original full size picture (in a separate window of course). <li style="overflow:hidden;"> <a href="<?php echo url('/downloads/dl/'.$download->id);?>"> <?php echo $download->name?></a><br /> <img src="<?php echo $download->image?>" style="width:150px; vertical-alig…
Last reply by natcret, -
- 1 reply
- 1.8k views
A little snipet that will help you add links for pilots over an amount of logged hours Example i let people over 80 hours to access charter flights so when they go over 80 hours a link comes up in their profile Change number 10 to less or more hours accordingly <?php $url = "http://www.websiteurl.net/index.php/charter"; $site_title = "Charter Flights"; if((Auth::$userinfo->totalhours + Auth::$userinfo->transferhours)<10) { //Dont show anything if hours are less than needed } else { Echo "<a href=$url>$site_title</a>" ; } ?>
Last reply by servetas, -
- 0 replies
- 1.6k views
Hello everyone ... it is possible to access a page (eg: liveries) only pilots who have completed certain routes for download of a premium (special livery)? thanks to a possible reply.
Last reply by gio1961, -
- 4 replies
- 5.9k views
is there a code that allows you to put the pilots hub next to their name in the pilot roster without sorting the roster by hubs?
Last reply by web541,