Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 2 replies
- 1.6k 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, -
- 0 replies
- 1.6k 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.3k 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, -
- 2 replies
- 1.7k 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.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.3k 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, -
- 1 follower
- 8 replies
- 2.9k views
Hi all. Help create a module. I added the database table RUNWAYS and try to infer information at the page airport_info.tpl But displays information only from one line. For example: Airport UUDD Moscow has 3 runways, but the screen displays only one((( <?php $db = mysql_connect("localhost","xxxx","xxxxx"); mysql_select_db("xxxxx",$db); ?> <?php $resultat = mysql_query("SELECT * FROM runways WHERE airport_ident='$name->icao'",$db); //Выберем вÑе Ð¿Ð¾Ð»Ñ Ð¸Ð· таблицы Runways, где Икао аÑропорта равно к примеру UUDD $array = mysql_fetch_array($resultat); echo "Длина полоÑÑ‹: ".$array['length_ft']."FT<…
Last reply by bass, -
- 2 followers
- 17 replies
- 12.4k 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
- 33 replies
- 10.1k 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.8k 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.1k 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
- 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, -
- 0 replies
- 1.4k 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, -
- 7 replies
- 3.4k 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
- 1.9k 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
- 51.7k 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.6k 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.2k 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.6k 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, -
- 1 follower
- 8 replies
- 2.1k views
I have code in which I list the flights. Help write the code, so if flight is not found, displays a message that NO schedules! <table class="table table-bordered" width="40%" border="0" cellspacing="0" cellpadding="0"> <tr class="active"> <th colspan="7"><center> СпиÑок рейÑов из ÐÑропорта </center></th> </tr> <tr class="active"> <th>Ðомер рейÑа <i class="soap-icon-status"></i></th> <th>ÐÑропорт вылета <i class="soap-icon-securevault"></i></th> <th>ÐÑропорт Ð¿Ñ€Ð¸Ð±Ñ‹Ñ‚Ð¸Ñ <i class="soap-icon-securevault"&…
Last reply by Vangelis, -
- 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.1k 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, -
- 0 replies
- 1.3k views
Tell me how to show on main page table (such as admin) Top 10 Routes Routes?
Last reply by bass, -
- 12 replies
- 3.8k 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
- 1.9k 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
- 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
- 4 replies
- 2k views
Prompt how to report (pirep_viewreport.tpl) on the flight of the log page to display a pitch angle of (...) deg.?
Last reply by bass, -
- 1 follower
- 2 replies
- 2.2k 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.1k 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,