Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 2 replies
- 2.3k views
I have the currently booked flights showing on my main page of my site. I am having a problem trying to show the airline image for the current booked flight. I can get it to show the spot for the Airline in the title, but I cannot get the image to pull from my image folder. Can someone please please assist me with this. I have been up searching on here for hours and trying to make it work: this is my code:\ Thanks to anyone that can help me with this <h3>Currently Booked Flights</h3> <?php if(!$lastbids) { echo '<p align="left">No flights have currently been booked</p>'; return; } ?> <table width="100%" cellpadding="1" cellspacin…
Last reply by smoke2312, -
- 2 replies
- 2.3k views
anyone know the code to put there PID in the welcome email?
Last reply by Ahmad, -
- 5 replies
- 2.3k 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, -
- 5 replies
- 2.3k views
Hi, we have multiple HUBs but we require our pilots to start out at CYYC (our training HUB). How can i make it to where that is the only HUB they can choose upon registration?
Last reply by Taran, -
- 5 replies
- 2.3k views
Hello, I'm trying to make it so that random ID's are assigned to pilots, and not in sequential order. Is there a possibility to this? I've done it for other CMS's but I don't know if the MySQL wont like the randomness. Thanks for your help Dave
Last reply by Talisman57, -
- 4 replies
- 2.3k views
Need a new twitter feed in light of the new API (yes, it's been some time now). It's useless how the new one requires OAuth etc, whereas with the old one it was a case of a few lines of PHP or Javascript. Any suggestions?
Last reply by freshJet, -
- 1 reply
- 2.3k views
Hello, I'm trying to create a code that alter the condition of the aircraft when a pirep is been submitted. it looks to the landing rate, so when the landing rate is below 200 than 0.5% off the condition. when a landing rate is higher than 200 than 2% of condition. when a landing rate is higher than 500 than 50% off condition. so far i have: $pos = find_in_fsacars_log('TouchDown:Rate', $log); $landingrate = str_replace('TouchDown:Rate', '', $log[$pos]); $count = preg_match('/([0-9]*:[0-9]*).*([-+]\d*).*/i', $landingrate, $matches); if($count > 0) { PIREPData::editPIREPFields($report->pirepid, array('landingrate' => $matches[2])); } PIREPData…
Last reply by Jakes, -
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, -
- 1 follower
- 3 replies
- 2.2k views
Is it possible? So that you can have the latest route from vRoute in the schedules for all flights?
Last reply by druptown, -
- 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, -
- 3 replies
- 2.2k views
Hello, Could someone please provide me with a bit of code that echo's out the id of the current signed in pilot. I can already make it go VIRXXXX but I just need it to show the XXXX part, without the "VIR" infront? If that makes sense, Thanks for help in advanced, Regards, Daniel
Last reply by Sava, -
- 5 replies
- 2.2k 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, -
- 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, -
- 4 replies
- 2.2k 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, -
- 5 replies
- 2.2k views
I'm stuck and need some help from the gurus on this board. I am trying to insert phpvms content within another cms without relying on an iframe. I want to be able to use modules within phpvms but use the cms framework to build pages etc with another system. Right now my folder structure is \root\ where the cms is and \root\phpvms\ where phpvms is installed. I've got this code so far but I don't know if I am missing elements? Thanks,
Last reply by Tom, -
- 1 reply
- 2.2k views
Hi, we have multiple Airline in our system but we require our pilots to start out at DLH . How can i make it to where that is the only DLH they can choose upon registration? Best Regards
Last reply by Steve Bartlett, -
- 0 replies
- 2.2k views
Does anyone have the HTML of the last flights of the "Pilot" and the flights booked?
Last reply by Rafael, -
- 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, -
- 3 replies
- 2.1k views
Hey all, I just tried this and it works a treat. It basically uses Great Circle Mapper instead of Google Maps to display the flight on the flight details page. I'm using it because I'm having problems regarding Google Maps. I'll be surprised if anyone uses it. <img src="http://www.gcmap.com/map?P=<?php echo $schedule->depicao ?>-<?php echo $schedule->arricao ?>&MS=wls&MR=15&MX=720x360&PM=*" /> Obviously, you can change the size by editing the '720x360' part. Hope this helped.
Last reply by mark1million, -
- 4 replies
- 2.1k views
I have tried <?php echo $price;?> and it didn't giveme error codes but it didn't show it ether is here something im missing? like the guy had code it it put it like this <td><?php echo util::FormatDration($route->flighttime) ; >--></td>
Last reply by jusromaine, -
- 1 follower
- 2 replies
- 2.1k 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, -
- 5 replies
- 2.1k views
Hey, I think,if have a way to get routes direct from other sites,because if you have a lot of a routes do add, is very tiring and time consuming to add with admin panel. Waiting. Thanx
Last reply by Gabriel Fernandez, -
Hello guys, Is there a way to show a route that is generated from a website like this: http://www.vataware....om=LEMD&to=GCTS directly into a flightplan? So that it will show in this example the following route: "CCS UN975 BIRBA UN873 SOTEX UZ223 BEXAL UN866 KONBA ` Regards, Martijn
Last reply by tgycgijoes, -
- 1 reply
- 2.1k views
I've got an arrivals board with latest flights but I want it to display whether it's early, on time or delayed. Here's my code: $actualtime = $pirep->flighttime; $schedtime = $schedule->flighttime; if($actualtime < $schedtime){ echo '<td>Early</td>'; } elseif($actualtime > $schedtime){ echo '<td>Delayed</td>'; } else { echo '<td>On Time</td>'; } It only shows it as delayed at the moment though. Anyone help? http://www.freshjetvirtual.com/
Last reply by Txmmy83, -
- 4 replies
- 2.1k 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 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, -
- 5 replies
- 2.1k views
vFleetTracker I try to make so that page (indeks.tpl) shows the status of each aircraft. - This plane is not booked - This plane is booked - The aircraft in flight - You do not have access to this aircraft. If the aircraft is free - it is possible to click and see which flight you can do it in view of what he's airport. <?php $data = OperationsData::getAllAircraft(); $online = ACARSData::GetACARSData(); $lastbid = ACARSData::GetACARSData(); $airports = array(); foreach(OperationsData::getAllAirports() as $aircraft) $airports[$aircraft->icao] = $aircraft; foreach($data as $aircraft){ if($aircraft->charter == 0) { if($aircraft->icao != 'SU95') conti…
Last reply by bass, -
- 2 replies
- 2.1k views
I want to change the title to the Russian language, in which file can I change this? I was looking but never found! Schedules - KD Avia Profile - KD Avia Thanks!
Last reply by Artjom, -
- 1 follower
- 3 replies
- 2.1k views
Im mot sure if this is in the right forum so delete if needed. Is there a way to show who is logged into our TeamSpeak3 server on our website? I've seen a few VA's that have this and was wondering if it is some kind of code or program.
Last reply by Arctiq, -
- 1 reply
- 2.1k views
Does anyone know the code to get stats based upon airlines in the system rather than HUBs?
Last reply by MaciejO,