Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 1 follower
- 0 replies
- 2.1k views
<?php $fieldvalue = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); if($fieldvalue != '') { echo '<a href="http://vatstats.net/pilots/details/'.$fieldvalue.'" target="_blank"><img src="'.SITE_URL.'/lib/skins/SKIN_NAME/images/vatsim.gif" alt="Vatsim ID" border="0" /></a>'; } ?> Place the above code in the pilots_list.tpl file, and create the image. place it in your skin folder images folder. Note: It won't get everyone's info, as they have to fly online for it to get their details. But once they do, it will show the details.
Last reply by Strider, -
- 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, -
- 0 replies
- 1.5k views
Hi, Would anybody please have a snippet of code that I can add to my pending PIREPs page, which has a drop down of the airports stored in my phpvms_airports database? When selecting an airport, it will filter the PIREPs to show only those with a departure/arrival airport of the one selected? I hope that makes sense, Thank you in advanced. Daniel
Last reply by danielp1997, -
- 0 replies
- 1.4k views
I'm sure you've noticed that when you click on an aircraft on the ACARS map the dialog box will disappear when a position update occurs, is there a way to prevent this and simply update the data shown on the box instead?
Last reply by freshJet, -
- 0 replies
- 2.2k views
As I look throughout more and more virtual airlines, I notice the URL to contain a somewhat confusing string 'index.php' for some users. For example, one can access a module by typing out virtualairline.com/index.php/schedules. This small script removes the index.php and allows you to directly access that part of the website by typing in virtualairline.com/schedules instead. Open up file manager, and be sure to checkmark the box 'Show hidden files' on the root selector that pops up in cpanel. Browse to your Virtual airline root folder(Where phpvms is installed) Open up the .htaccess file Copy/Paste the following code RewriteEngine on RewriteCond %{REQUEST_FILE…
Last reply by magicflyer, -
- 0 replies
- 2k views
Hello help me? I'm having trouble because my phpvms not this show the information in pafina / index / profile I already tried the tutotial (Getting variables in templates) more will not Tutorial:(http://forum.phpvms.net/page/index.html/_/skinning-and-customization-guides/getting-variables-in-templates-r34) <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link href="<?php echo SITE_URL?>/lib/skins/flytam/style.css" rel="stylesheet" media="all" /> <?php /*Any custom Javascript should be placed below this line, after t…
Last reply by pedrobrandine, -
- 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, -
- 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, -
- 0 replies
- 1.5k 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, -
- 0 replies
- 2.4k 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, -
- 0 replies
- 1.9k 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, -
- 0 replies
- 1.2k views
Tell me how to show on main page table (such as admin) Top 10 Routes Routes?
Last reply by bass, -
- 0 replies
- 1.3k 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, -
- 0 replies
- 1.1k 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, -
- 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, -
Flight Board
by sev- 0 replies
- 1.4k views
Hi im looking for the code to apply a acars map and flight board on a landing page before going into crew centre...Thanks Karl Alden
Last reply by sev, -
Hi i have loded it all up and all ok but when you click the generate button i get this error in the console.. https://imgur.com/3MJL04T
Last reply by sev, -
- 0 replies
- 1.4k views
Closed
Last reply by PedroBoreio, -
- 0 replies
- 1.3k views
Hello I was digging around in phpvms today and came across the functions for url, actionurl, adminurl etc. So I started thinking, it'd be really handy to have something similar for the skin url. So instead of href="<?php echo SITE_URL?>/lib/skins/crystal/styles.css" you would go href="<?php echo url('styles.css'); ?>" that's much shorter, and also if for some reason you'd want to change the folder of your skin you don't need to recode everything. so I wrote that little function, here it is: function skinurl($path="") { if($path[0] != '/') $path='/'.$path; return SITE_URL.'/lib/skins/'.CURRENT_SKIN.$path; } all you n…
Last reply by mischka, -
- 0 replies
- 1.6k views
Hey guys, I'm not sure about you but I got a lot of fake BS messages through my contact form, and I got really tired of it so I looked for a solution. The fix was fairly simple, and with the same technology you can also stop fake registrations! Since this forum is visible to everyone, and therefore also to those who might be behind these messages, I decided to not share it here directly. You can only view the solution on my blog: http://www.virtualairlines.eu/index.php/Blog when you are logged in!
Last reply by mischka, -
- 0 replies
- 1.4k views
hello, im use this module, but between to 50 files i want pagination.... <div class="table-responsive"> <table class="table table-hover"> <thead > <tr align="center"> <th>Tipo de Aeronave</th> <th>Matricula</th> <th>Rango</th> <th>Aerolinea</th> <th>Pasajeros</th> <th>Carga Maxima</th> <th>Detalles</th> </tr> </thead> …
Last reply by OWA001, -
- 0 replies
- 3k views
Hello I want to delete expired bids per Crone Job. Is here a way to check if a pilot is inflight with the current bid? i Want so set the expired time to 2 or 3 hours but when the bid will be deleted, the flight is avaible for other pilots even if currently the pilot is still flying. I have tried to check the acarsdata table, but here is no unique id that has a reference to the bid. phpvms version is 5.5. Best regards, Jan Grimm
Last reply by Sovereign, -
- 0 replies
- 3k views
Hello folks! I thought about to edit categories in the default download module and changed it to my needs. After you deactivate a download category, it wont show up in your list. Important information: BEFORE do this tutorial, backup the database tables and files you'll edit. lib/skins/pandaair_theme/downloads_list.php admin/modules/Downloads/Downloads.php admin/templates/downloads_categoryform.php core/common/DownloadData.class.php database table phpvms_downloads 1. Open your database and run the following command. It will add a column to your downloads table. Be sure to add the …
Last reply by Karamellwuerfel, -
- 1 follower
- 0 replies
- 2.8k views
Hello guys, This is a little security snippet you can use for your website. The user needs to answer the multiplication question before proceeding: PHP: $rand1 = rand(1, 9); $rand2 = rand(1, 9); HTML: <div> <label><?php echo $rand1;?> x <?php echo $rand2;?> = </label> <input type="text" class="form-control" name="sum" id="ques" placeholder="<-- Your Answer" required> <input id="sendbtn" type="submit" name="submit" value='Send' disabled> </div> Jquery to check user's answer. If the answer is correct, as soon as the user move the mouse out of the field, the "Send" button is enabled othe…
Last reply by Parkho, -
- 0 replies
- 3k views
I was wondering if anyone would have any idea on how to set different icons for the aircraft type on live map. I'm not great with jquery functions so anyone able to resolve this would be a great help I'm assuming it would be something along the lines of this const getHeadingIcon = (heading) => { if (!(heading in headingIcons)) { headingIcons[heading] = L.icon({ iconUrl: url + "/lib/images/inair/" + aircraft + heading + ".png", iconSize: [35, 35] }); } Many thanks
Last reply by miniarma, -
- 0 replies
- 2.7k views
Hey, Hope somebody can help? Is there a way to show the offblock/onblock times, start and finish, also takeoff and landing times? Need help to source a code? TIA
Last reply by Mickey, -
- 0 replies
- 1.9k views
Something i have been working on with a friend lately is creating a flight path line from the flown route on v5.5.2 This is still the early stages but everything is already there thats needed. when i do the corrections and other fun stuff to the code i will put it out. check it out for yourself. This is without the addons that cost $$$ and made with everything already given to you (but with leaflet) leaflet will be required to run this as im not paying $$$ for a google maps API So lets Continue on First thing is first, we have to make a db from your mysql CREATE TABLE [name of your table] ( i…
Last reply by swaluver480,