Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 4 replies
- 2.4k views
I know this has come up before but my search is coming up blank. I may be a bit tired today. I am wondering if there is a code snippet or a release out there that will auto prune users who have registered and have not filed a flight within X amount of days. I know we can auto retire pilots, but this is different. If someone has time to register, why not the time to fly a flight within a week? If they don't have time for at least one flight in a week, they should get pruned. Easy task manually for small dead airlines, but what about busy airlines? Anyone got anything like this?
Last reply by TAV1702, -
- 1 reply
- 3.5k views
Hello, How to recover some information on the log with the variables For example: 12:35 start engine 2, 12:50 overspeed .... Thanks for your help
Last reply by loganq, -
- 1 follower
- 8 replies
- 2.7k 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, -
- 0 replies
- 1.7k views
Want to make your images a bit more interactive? You can now with the following image style. Just hover over the image and it will bounce. Instructions ------------------------------ 1. Place the following CSS in your main style or css file http://pastebin.com/Z7hguc1j 2. Place the following HTML where you want the image(s) to appear. http://pastebin.com/cufq8En2 Enjoy! Video Demo http://www.youtube.com/watch?v=8pNvzUbkdu4
Last reply by StartVM, -
- 1 reply
- 3.7k views
Hello This is my first release.Everyone specially who is using the IP Board forum must be looking on how to display recent forum posts on your PHPVMS Home Page. Well here is how to do that. YOU NEED TO HAVE IP CONTENT INORDER TO USE THIS. STEP 1: Login to your admin cp. STEP 2: Create a block through the IP Content. STEP 3: Follow what to do in these screenshots which i am attaching. STEP 4: After creating the block near the block where all the blocks are displayed there must be a small sign and wgeb u will put your mouse on it it will say "Get code for widget" copy that code and paste it where ever u want to display RECENT FORUM POSTS. Enjoy! IP BOARD SCREENSHOT…
Last reply by fsxsimulation, -
- 0 replies
- 1.5k views
Recently I have been working on a VA for a client and I noticed im using quite a bit of jquery. Maintaining this code can be a bit of a headache so ive decided to create a boilerplate to maintain ALL my jQuery in one place. Before I began I done a quick search and was unable to find exactly what I wanted, there was a similar method used by studioforty9.com, however it relied on a body class produced by in their case magento e-commerce. This would not work in phpvms's case as it does not apply a class to the body for each page(controller) so here is my work-around for a global scope. The method: init Loads any code used cross domain initSiteSection Loads the correct …
Last reply by pkav, -
- 8 replies
- 4.3k views
The rule n° 17 for a va on ivao say: §17: 17. If the VA is active also on other networks and/or allows pilots to fly off-line, thence not necessarily registered on the IVAO network, the pilot roster page on the website should clearly emphasize those registered on the IVAO network. The pilot roster could be divided in 2 or more sections (IVAO pilots, other network pilots, pilots flying off-line etc.) or show, close to each pilot name or callsign, the logo of the network the pilot belongs to with his Vid. for this I modified the code of my phpvms ... anyone is interested?
Last reply by Tato123, -
- 1 follower
- 4 replies
- 4.9k views
Hi there. I'm the technical support staff from royal jordanian airlines which we are working on. I want to make an online box like this: http://rj-va.uphero.com/box.png. now i used this code <html> <head> <title>...</title> <style type="text/css"> .bg { width:300px; background:#333; border:1px solid #999; border-radius:10px; margin-left:auto; margin-right:auto; } </style> </head> <body> <?php $lng['trafficingb'] = 'Pilots'; $lng['notrafficingb'] = 'There is no traffic in the Jordanian Airspace.'; $weekdays = array( 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 =>…
Last reply by Tameem, -
- 5 replies
- 4.5k views
Hey Guys, Just wanted to give everyone the opportunity to use this great Javascript snow script. To use it for phpVMS just simply follow the directions below. Open layout.tpl and find the </body> tag. Create a line above it and copy and paste the code below. <SCRIPT type="text/javascript"> // Set the number of snowflakes (more than 30 - 40 not recommended) var snowmax=35 // Set the colors for the snow. Add as many colors as you like var snowcolor=new Array("#aaaacc","#ddddff","#ccccdd","#f3f3f3","#f0ffff") // Set the fonts, that create the snowflakes. Add as many fonts as you like var snowtype=new Array("Times","Arial","Times","Verdana") // Set the lett…
Last reply by Taran, -
Hi to All !! How is possible have only the join date and not the hours ? If i put <?php echo $userinfo->joindate;?> The result is: 2008-03-25 01:00:00 I need only 2008-03-25 Thanks
Last reply by Tom, -
- 0 replies
- 2.8k views
Instead of selecting 'More Than' or 'Less Than' and then typing the value, is there a way to make it so that it displays a jQuery slider to choose the distance filter, changing the results as you slide it? I'm sure most of you know what a jQuery slider is anyway, but here is an example: http://jqueryui.com/demos/slider/
Last reply by freshJet, -
- 3 replies
- 1.5k views
I've noticed the ACARS map only leaves the popup bubble open for around 5 seconds, how can this be changed so that it stays until the user closes it or clicks on another plane? I'm assuming it's in Javascript...
Last reply by edmundk, -
- 3 replies
- 2.4k views
Hi. What do I need to do to activate the landing rate on the pireps? Thank you, Kenny.
Last reply by Strider, -
- 5 replies
- 3.2k views
I love the landing rate (landingstats) feature that SimPilot & Nabeel brought to phpVMS. I have always had a little niggle with it though, and that was the fact that if a pilot didn't use an ACARS program which records the land rate, or they file a PIREP manually, then the output shows 0. This can be confusing for visitors to your site. So with a slight mod to the output php, any PIREPS submitted without the landing rate present will now show "Not Recorded". You could use whatever text you want. Here's how: <?php if($pirep->landingrate == '0') {echo 'Not recorded';} else {echo "{$pirep->landingrate} ft/min"; }?> I just dropped this in a table cell …
Last reply by michael Kraan, -
- 2 replies
- 1.8k views
This is half and half a code snippet post and also skinning however putting it here. Im using SimPilot's screen shot module, and was just wondering if there was a way of using the screen shot as a random image on the main page? I have an image that is 819 X 311 on the main page, and while I have the random image call working, I cant seem to make the image any larger. <?php Screenshots::show_random_screenshot(); ?> The actual code im using is : <center><?php $allpics = new Screenshots (); $allpics->show_random_screenshot();?></center> Adding any height= or width= seems to throw an error. Of course, in the past, ive made…
Last reply by topher2880, -
- 1 follower
- 8 replies
- 4.2k views
Hello guys is there code for showing last recent flight details can anyone help me to get these information for last flight Callsign: Departure Airport: Arrival Airport: Aircraft: flight time: Date of Flight status of the pirep: thank you
Last reply by LeonardIGO4036, -
- 6 replies
- 3.8k views
Hello Apologies if this is elsewhere, I have been searching the forums and I couldn't find the information. I want to add to my pilot badge a line with "last flight" info, in the following format: Last Flight: KLAX-KBOS A320-232 CS-TYB Which is basically route, aicraft name/type and registration. Could someone please help me with this, in terms of code and which file to edit? Many thanks Cheers
Last reply by mark1million, -
- 4 replies
- 2.8k views
Hello users I will make a Last Flight and Date in pilot center and pilot public center! This code works in "Pilot Center" <li><strong>Last Flight: </strong><?php echo $report->code . $report->flightnum; ?>(<?php echo $report->submitdate; ?>)</li> And I will Last Flight and Date works in Pilot Public Profile How can I create this? please help. Best regards.
-
- 16 replies
- 5.2k views
Does anyone know the code for this? I have seen one before, however it was for the public profile. I've got it working too, but I want it now on the Pilot Centre, so when the pilot views the pilot centre, it says how long it's been since their last flight, for example: Your last flight was 3 days ago. That way, they know whether they are in danger of being marked inactive or not. I remember Virtual Norwegian had it when I flew for them...
Last reply by tutmeister, -
- 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, -
- 20 replies
- 9.8k views
Last Location in Badge Tested on phpvms 2.1 (940) IT DOESN'T WILL WORK IF YOU DIDN'T SEND PIREP! core\common\PilotData.class.php 1. After (LINE 956) $pilot = self::getPilotData($pilotid); add this code $last_location = PIREPData::getLastReports($pilotid, 1, PIREP_ACCEPTED); 2. After  (LINE 974) $output[] = 'Total Hours: ' . $totalhours; add this code $output[] = 'Last Location: ' . $last_location->arricao; Download: PilotData.class.php Should look like this: 1.     $pilot = self::getPilotData($pilotid);     $last_location = PIREPData::getLastReports($pilotid, 1, PIREP_ACCEPTED);     $pilotcode = self::getPi…
Last reply by James142, -
- 6 replies
- 3k views
Heres a snippet I use to get the last 5 posts from phpBB to display in my side bar <?php require_once('/path/to/forum/config.php'); $link = mysql_connect($dbhost,$dbuser,$dbpasswd); mysql_select_db($dbname, $link); $result = mysql_query("SELECT * FROM `phpbb_posts` ORDER BY `post_id` DESC LIMIT 5", $link); while($r = mysql_fetch_array($result)) { echo "<a href=\"http://www.domain.tld/forum/viewtopic.php?p=" . $r['post_id'] . "\">" . $r['post_subject'] . "</a><br />"; } ?>
Last reply by joeholden, -
- 2 replies
- 2.5k views
Hello, I was wondering if it was possable to put the latest news from your phpvms website into a channel discription on a teamspeak 3 server? Thanks, James
Last reply by James142, -
- 2 replies
- 1.7k views
For the ones who have a Wordpress and would like to have your recent post on your phpvms site. Here is how I do it. http://feed2js.org/index.php?s=build Than you will need to know your RSS feed url. http://example.com/?feed=rss http://example.com/?feed=rss2 http://example.com/?feed=rdf http://example.com/?feed=atom If you are using custom permalinks, you should be able to reach them through this usage: http://example.com/feed/ http://example.com/feed/rss/ http://example.com/feed/rss2/ http://example.com/feed/rdf/ http://example.com/feed/atom/ I am using /?feed=rss2. Make sure that you preview it first. Place the code where you want to display the post.
Last reply by flyalaska, -
- 1 follower
- 30 replies
- 8.8k views
---This might be better as a module--- I have been working all night on a code that will do the following: - Display the pilot's name and ID - Ask the pilot for a start date - Ask the pilot for an end date - Ask for a reason - Send an email with the details to my address upon clicking submit Also, I was wondering id fit could be added in the Admin panel to display who is on leave and how long it is until they return, as well as displaying the same info on the pilot's profile. May be a bit complex I know... So:
Last reply by James142, -
- 4 replies
- 2.4k views
I want to add a link on my website so pilots can download or view a word document. Problem is, I don't know where I can post the document so I can link to it. I tried googledocs but it only stores files, you can't link to the file. I tried uploading them via my cpanel, but the link is not recognized. I'm assuming that is because you need to log in to view that page. Any ideas where I could upload these files to?
Last reply by rpalmer800, -
- 13 replies
- 6.8k views
Hello All, Does anybody have the code for this? I cannot remember which VA it was on but it shows a list of all pilot's online Thanks!
Last reply by warpennys, -
- 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, -
- 3 replies
- 1.9k views
Hi, I'm not the best at coding but I would like to know if anyone knows a function that will count all live flight from the acars db and put it in a number. For example if the acars map shows 6 flight I would like the function to show 6 Thanks
Last reply by tim260, -
- 5 replies
- 3.2k views
Anyone know how I can get the Live Flight Status on the homepage which looks like a checker board kind of the old style airport flight status ones ?
Last reply by Txmmy83,