Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 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, -
- 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, -
Browser Icon
by Jeff- 2 replies
- 1.9k views
Here's another code for you who are having trouble adding an icon to your web browser. First, create your .ico using whichever program or online generator you wish, and upload it to: public_html Next add this code to your layout.tpl just after <head> <link rel="icon" type="image/png" href="http://www.yoursite.com/site.png"> <link rel="icon" href="http://www.yoursite.com/favicon.ico" type="image/x-icon"> Rename the favicon.ico to the name of your .ico image and change both address to your website (do not include /index.php). Leave the site.png and type="image/x-icon" as they are, and it should show. This method is tested, and works on both IE9 and…
Last reply by mark1million, -
All pilots
by angle- 5 replies
- 2.8k 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, -
Shadow Text
by Jeff- 0 replies
- 1.5k views
I found this little code that will give you a shadow under your text. You can change the font color, type, size, and more. <span style='font-family:monotype corsiva;font-size:40px;color:#aaaaaa;'>Text goes here</span><span style='display:block;position: relative;left: -4px;top: -22px;font-family:monotype corsiva;font-size:40px;color:#048DC6;'>Text goes here</span>
Last reply by Jeff, -
- 3 replies
- 3k 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, -
- 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, -
- 0 replies
- 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, -
- 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, -
- 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, -
- 5 replies
- 3.1k views
I want to display the pilots Hub in the pilot center but I can't figure it out. I don't even have a clue as to what code to be using. If anyone has done this would you mind to post the code? Thanks in advance. Keith
Last reply by JustinRomaine, -
- 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, -
- 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, -
- 2 replies
- 2.3k views
anyone know the code to put there PID in the welcome email?
Last reply by Ahmad, -
- 1 reply
- 1.6k 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
-
- 0 replies
- 1.3k 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, -
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, -
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, -
- 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, -
- 4 replies
- 2.4k 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
- 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, -
- 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, -
- 7 replies
- 4.1k 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, -
- 1 reply
- 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, -
- 4 replies
- 2.5k 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, -
- 4 replies
- 2.9k views
Hi, just a little question, wich is the code to insert into footer.tpl for show flight this month. Thanks and sorry for this kind of questions. Regards
Last reply by Rickisani, -
- 12 replies
- 5.7k views
Hey, If you would like an awards table if your site, use this code. The table is totally plain, but fully customisable using your standard table css/html. profile_mail.tpl <p> <strong>My Awards</strong><br /> <?php if(!$allawards) { echo 'No awards yet'; } else { /* To show the image: <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /> */ ?> <ul> <table width="790" border="0" cellspacing="5" cellpadding="5"> <?php foreach($allawards as $award){ ?> <tr> <td width="25%"><center><img src="<?php echo $…
Last reply by Jeff, -
- 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, -
- 22 replies
- 7.9k 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, -
- 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,