Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
Live Fuel Problem work around
by Guest lorathon- 9 replies
- 5.5k views
Since the live fuel server stopped allowing phpVMS users to access the live fuel I have been seeing too many flights with a zero for fuel price. I am assuming this was due to the copy that Nabeel put up for the live lookup. I still wanted to use the live lookup ( I dont like the idea of all of the airports having the same fuel price) so I just looked for a work around. What I wanted was to be able to poll the live fuel server, if there was a price there then use it. If not then use the default. The problem became that sometimes a zero was sent back. The script would then run the fuel calc with zero as the fuel price. So I dug in and worked out a way to accomplish…
Last reply by Ghiby, -
- 4 replies
- 3.9k views
Hi, does anyone have a code for a load sheet in the pilot briefing or does anyone know where I can get the auto-generated pax and load for a flight? The system generates automatically Paxnumber and load when clicking on Send Pirep but I'd like to have it before starting a flight in the briefing in order to load the aircraft correctly. Thanks, Chris.
Last reply by stuartpb, -
- 5 replies
- 2.2k 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 reply
- 2.1k views
Hi, Just thought this would be really useful to a lot of people wanting to integrate phpVMS with other software. This is a code snippet that will allow you to logout of phpvms regardless of where the script is or where it's called from. Just make sure the directory to you codon file is correct and everything should work fine . Here is the code below (basically the logout function of the auth class but written out instead of referenced to avoid execute problems): <?php require("../../phpvms/core/codon.config.php"); #self::remove_sessions(SessionManager::GetValue('userinfo', 'pilotid')); # Mark them as guest Auth::update_session(Auth::$session_id, 0); # "Ghost" e…
Last reply by Jeff, -
- 1 follower
- 2 replies
- 2.4k views
Hello dears, i would like to redirect users after logout to specific website caue the pilot center is in subdomaine also the phpvms i would like to redirect members to specific pages for ex: phpvms.domain.com to domain.com thanks in advance
Last reply by FlyingMachine, -
- 0 replies
- 1.4k views
Hey, I'm searching for an addon that let me see all the aircraft and their current location on a map (airport)... not like the Live map thanks
Last reply by Moritus, -
- 1 follower
- 5 replies
- 3.6k 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, -
- 18 replies
- 3.9k views
I am trying to create another aircraft list but with registrations and type only, for the maintenance module. I've got this: <?php foreach $aircraft as $aircraft( ?> <html> <table border="1"> <tr> <td width="200"><?php echo $aircraft->registration ?></td> <td width="200">Last Check</td> <td width="200">Next Due</td> </tr> </table> </html> <?php ) ?> But get: Warning: Invalid argument supplied for foreach() in /home/freshje1/public_html/testskin/core/templates/fleet_maintenance.tpl on line 1
Last reply by stuartpb, -
- 1 reply
- 1.3k 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, -
Mass Email Validation Form
by Guest lorathon- 1 reply
- 1.5k views
Replace the admin/templates/mailer_form.tpl with the one located in the ZIP file. It uses a validate script to stop you from submitting the email form without a subject. Minimally tested mailer_form.zip
Last reply by freshJet, -
- 1 reply
- 2k views
If any are interested in adding an image for each member on your site on the pilots list page, here you go. Add the table header that will hold the image headline: <th>Image</th> Next add the table data that will call for the image: <td align= "center"><img src="<?php echo fileurl('/images/members/'.$pilot->pilotid.'.jpg'); ?>" width="50px" height="75px" alt="<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?>" /> You will need to change this: ('/images/members/' if your images are located in another directory. You will also need to change this: pilotid.'.jpg' if you are using another type …
Last reply by mark1million, -
- 4 replies
- 2.4k views
Hello Is their some existing module or if some one could create a module which allows admin to reject a member but also allows the admin to keep the reason of rejection internally? Regards
Last reply by BaRBeR, -
- 11 replies
- 5.2k views
Hey everyone, I was helping another guy out with a problem and my solution worked for him so I will share it here in snippets. If you ever get an error like this Fatal error: Allowed memory size of 33554432 bytes exhausted on your website while trying to do anything, it is a low memory allowed per script on your server. To remedy this situation you can get into your local config file and find ?> after add ini_set("memory_limit","16M") If this does not work, it will if you go to root/.htaccess and add it there instead. If the 16 does not solve your problem you can bump it up some. Please beware that if it is not your server and you are on shared hosti…
Last reply by regexpress, -
- 4 replies
- 3.4k 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, -
- 0 replies
- 1.7k views
Small code showing the VATSIM weather in the template, random <div id="metar"> <?php $sql = "SELECT ".TABLE_PREFIX."airports.id, ".TABLE_PREFIX."airports.icao as icao, ".TABLE_PREFIX."airports.name, ".TABLE_PREFIX."airports.country as country FROM ".TABLE_PREFIX."airports ORDER BY RAND() LIMIT 1"; $result = mysql_query( $sql ); while ($row = mysql_fetch_row($result)) { echo"<h3>METAR (ICAO: ".$row[1].")</h3>"; echo "Aeropuerto: <font color='#ff6600'>".$row[2]."</font><br />"; $adresse = 'http://metar.vatsim.net/metar.php?id='; $homepage = file_get_contents($adresse.''.$row[1]); echo "<font color='#2997ba'>".$homep…
Last reply by AlessandroCuba, -
- 1 follower
- 7 replies
- 3.7k views
How would I go about getting each pilot's total miles flown (all time) on the roster? Like they have the flights and hours, how would I add the miles?
Last reply by ercio, -
- 35 replies
- 14.3k views
That code I posted in SimPilot's FrontSchedule search thread, for the "your location" to appear in the departure select field proved problematic, as it was setting everyone's location the same as mine. Not sure why, but it was.Anyway, I've managed to sort it out now. I've posted here because I've modified two files: The airport_search.tpl file from the FrontSchedule Addon (located in your core/templates folder when you have installed the addon.) The default schedule_results.tpl that is shipped with phpVMS First up, replace the code shown below from Simpilot's airport_search.tpl with the code underneath that. airport_search.tpl - Original code: <td>Select…
Last reply by Denver, -
- 1 reply
- 1.6k views
Please help me, i want to limit access to specific module. Probably via .htaccess and password. Please help if you know how ... P.
Last reply by simpilot, -
- 2 replies
- 1.3k 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 reply
- 3.3k views
Hello all, (sorry my english) i’m trying to make the flightMarkers keep moving (with or without click marker) but no success. When i try, from multiple markers only one moves or all blink and jump to new position. Whem the marker moves and arrives to next destination/point and the map refresh, the marker go back and start again. Need to continue to next new position. This is the code i’m trying to adapt with speed: http://jsfiddle.net/HYuRR/2/ Can someone help to implement the code? Thank you This is the original acarsmap.js var flightMarkers = []; var routeMarkers = []; var flightPath = null; var depMarker = …
Last reply by piuozorio, -
- 0 replies
- 2k views
This topic has been moved to Releases. [iurl]http://forum.phpvms.net/index.php?topic=2091.0[/iurl]
Last reply by Nabeel, -
- 1 follower
- 1 reply
- 1.7k views
Hey, I use the .csv file to upload schedules and some flights have the same FlightID I know there used to be a code allowing you to upload same flight numbers. Does anybody know it? Regards, Daniel Cormack Website : www.corporateva.co.uk Email : ceo@corporateva.co.uk
Last reply by crnjola, -
need help with free Pirep code
by Guest- 8 replies
- 2.5k views
this is HTML code for Free Pirep and i want use this code in my site can any one help me to change this code and how can i use it in my site <!doctype html public "-//w3c//dtd html 4.01 transitional//en"><HTML> <!-- saved from url=(0031)http://xxxxx/pirep.asp --> <!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Language" content="en-us"> <!-- Validated at 10/27/2011 10:10:38 PM --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin templat…
-
My intent is to be able to click on the "File a new PIREP" link....have it take me to a page with only two buttons....."File a FSX Flight" and "File a DCS Flight." Each a link to a different PIREP form. I utilized David Clarke's great content module tutorial to create two new pages (tutorial: http://david-clark.n...content-module/). It appears that I used the tutorial correctly...my links are working, but the data stream seems to have been broken somewhere. Explanation: New pages are called "pirep_fsx.tpl" and "pirep_dcs.tpl" I created the new module, as directed in the tutorial....but I do not think it is the problem (I could be wrong) I replaced the data in the def…
Last reply by Parkho, -
- 3 replies
- 2k views
Hi Guys, I have a Question about the Standart News System of phpVMS. Is there a way to change the News Layout from TITLE BODY POSTED BY to TITLE | TITLE BODY | BODY POSTED BY | POSTED BY so that in one row are two news items Great Thanks xhubix
Last reply by xhubix, -
- 27 replies
- 9.7k views
Hello all, For those of you who know, Google has released a new version of the reCaptcha that doesn't have a Captcha: noCaptcha reCaptcha. Some more information can be found at http://www.google.co...ntro/index.html. Now, I've figured out (kind of) on how to implement it (very easy change), so I'm hoping it's backwards compatible. If anyone is willing to give it a try, please try my code snippet. My development copy of phpVMS isn't working as I want it to due to the skin, and I'm too lazy to go into the admin panel to change the skin to crystal. recaptchalib.php is attached, to install, go to (phpVMS isntall directory)\core\lib\recaptcha. Make sure to backup your old o…
Last reply by OWA001, -
- 19 replies
- 6.8k views
Hi everyone, I have been looking about to use Pagination for my pilots pirep pages as some are now getting quite long, i have come across a few but does anyone have experience with integrating in to phpvms, your ideas and thoughts would be welcome Cheers.
Last reply by James142, -
- 2 replies
- 1.6k views
I need to know how I could have on passenger flights, cargo transport
Last reply by AlessandroCuba, -
- 0 replies
- 1.5k 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, -
- 25 replies
- 8.5k views
Portuguese: Ola, Tem Como Eu Colocar No Status da Minha Empresa Aerea Virtual, o numero de passageiros transportados? English: Hello, How I Put It On the Status of My Virtual Airline, the number of passengers carried?
Last reply by TAV1702,