Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 3 replies
- 3.2k views
I have tried 2 different banner rotators and neither have worked. I am sick and tired of looking and testing and ultimately failing. Anyone got a code? I know lots of you have banner rotators at the top of your pages...
Last reply by freshJet, -
- 0 replies
- 2.2k views
Hello community, I have a question again. is it possible to Statistics, pilots, user load and install Flights Online ad on this page: Nightfly Test site If so link with what I can do this? So everything that is seen on the picture! would be observed then there are the new website is not in the Directory phpvms and there should not lie and has so far held in html and will remain so.
Last reply by Passion, -
- 4 replies
- 2.6k 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.9k 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, -
All pilots
by angle- 5 replies
- 3.1k views
Were can i get the all pilots module from so you can see all pilots and there last pireps and if they have filed there first flight?? any help would be great
Last reply by TennShadow, -
- 18 replies
- 4.5k 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, -
- 2 replies
- 3.5k views
anyone know the code to put there PID in the welcome email?
Last reply by Ahmad, -
- 1 reply
- 1.7k views
Every time one of my flights prices should show something like 151.70 it always removes the 0 on it and it shows up like 151.7 Is there a change I need to make for it to show up as 151.70? If the number is even (ex: 151.00) is comes up like 151
-
% complete flight 1 2 3
by fsx- 1 follower
- 74 replies
- 36k views
how can I get this?
Last reply by Angel Air, -
- 0 replies
- 1.5k views
OK, so I posted a thing about a Login PopUp a while ago, but now I'm stuck. I found this: http://docs.jquery.com/UI/Dialog What the hell do I do? I want it to show after the user has logged in and is being redirected to the profile_main.tpl. What parts of the code on the jQuery tutorial do I need, and where do I put them? Also, I only want this to show once.
Last reply by freshJet, -
- 7 replies
- 3.2k views
I DO NOT TAKE ANY CREDIT FROM SIMPILOT'S SCREENSHOT MODULE! This is a new function to delete the screenshot.
Last reply by TAV1702, -
- 1 follower
- 30 replies
- 9.9k 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, -
- 16 replies
- 5.7k 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, -
- 35 replies
- 15.4k 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, -
- 5 replies
- 3.4k 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, -
- 0 replies
- 1.7k 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, -
- 4 replies
- 2.7k views
NOTE: I apologise for the amount of topics I'm posting, it'll stop once my issues are resolved I was scanning through core/templates for an 'email_removed.tpl' or something, but noticed there is no notification for removing a pilot. So, as I'm about to remove some, does anyone know how I could create one? I could do the email bit fine (creating the tpl and editing etc), but what triggers the emails to be sent? I'd need the code for that, and where it goes... Thanks, Iain.
Last reply by Ahmad, -
- 3 replies
- 2.4k 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, -
- 3 replies
- 2.2k views
I am trying to make my Schedule Details page look more realistic, as if it was a real airline website. For example, if you were to view flight details, you wouldn't be provided with a METAR, so I was thinking of changing this to a general weather thing. So, maybe have a picture of the sun and temperature if that's what the weather was at the destination. Another thing is to add the aircraft type to the details at the top, what would be the code for this?
Last reply by Jeff, -
- 1 follower
- 39 replies
- 13.4k views
This code prevents known spammers (checked against the stopforumspam.com email database) from registering. I've used it in core/modules/Registration/Registration.php within the ProcessRegistration function, as so: // Check email for known spammer $url = 'http://www.stopforumspam.com/api?email='.$data['email']; $file = new CodonWebService(); $contents = $file->get($url); $response = simplexml_load_string($contents); if($response->appears == 'yes'){ $spammer = true; } else { $spammer = false; } if($spammer){ $this->set('message', 'Your email appears on our spam database, we therefore assume you are a spammer and are rejecting your registration request. If …
Last reply by Cor, -
- 1 reply
- 2.2k views
Hey, This is my first release for PHPVMS (and I forgot to spell and grammer check the instructions) so this is BETA 0.9 as it is almost complete. If you would like to add a tell a friend link to your site, this code should do exactly what you want :-) available as a popup, link, or embed. You can even create Skinned PHPVMS Pages to use with this Module/Code. The fields can be changed easily having on basic knowledge of HTML. If you experience any problems Use the forums because everyone may benefit form your question. Instructions are included. Enjoy tellafriend.zip
Last reply by VIP AIR Virtual, -
Im trying to get the Percentage of something but its not working. This is what I have dont so far: <?php $flown = 20; $total = 100; $final_percentage = $total * ( 1 - $flown/100); echo "Final Percentage: ".$final_percentage; ?>% But it ends up with 80% when it should be 20% (20/100). Does anyone know where I went wrong? Thanks, James
Last reply by James142, -
- 4 replies
- 2.7k views
How to add here, "http://www.power-team-radio.com/freedomair/index.php/pireps/view/28" where Route Map is purely the map. who can help
Last reply by TAV1702, -
- 7 replies
- 4.3k views
Hey, Does anyone know how to make a popup box appear on login? For example, a survey, or a status telling the pilot how many messages they have, their bids, etc. So: Pilot Logs in > PopUp displays > Pilot can then click on one of the links or click 'Close'.
Last reply by freshJet, -
- 25 replies
- 11k views
-
Last reply by AidasP, -
- 1 follower
- 22 replies
- 14.7k 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
- 2.3k views
Does anyone have the HTML of the last flights of the "Pilot" and the flights booked?
Last reply by Rafael, -
- 22 replies
- 8.6k views
Hello, I was wondering if there was a code to say if a pilot is online or offline on the website in the badge/signature? I have being looking around the forums but found nothing.. Thanks, James
Last reply by mark1million, -
- 2 replies
- 2.8k 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, -
In the downloads section index.php/Downloads is there a way to split the categories so all categories don't show. Have a link for each cat?
Last reply by Tylor Eddy,