Code Snippets
Pieces of code you can use around your site
314 topics in this forum
-
- 2 replies
- 3.4k 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
-
- 0 replies
- 1.4k 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.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.6k 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.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.3k 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.2k 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
- 2.1k 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.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, -
- 4 replies
- 3.1k 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
- 6k 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
- 7.2k 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
- 8.3k 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.3k views
Does anyone have the HTML of the last flights of the "Pilot" and the flights booked?
Last reply by Rafael, -
- 2 replies
- 2.7k 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, -
- 0 replies
- 1.7k views
-- Delete -- thanks
Last reply by Daniel, -
- 0 replies
- 1.7k views
If you are like me and have not got pagination working yet, some pages can get real long. Here is a quick little trick to get you back to the top of the page and save your index finger for later use. At the very top of the tpl file (page you are working on) add <body id="top"> then add your link at the bottom of the page like such <a href="#top">Back To Top</a> Someone sent me a pm some time back and asked me about it and I forgot to post it in the forums. Better late then never.
Last reply by TAV1702, -
- 2 replies
- 3.3k views
Ok I have spent a month now trying to write my own module... I simply want a list of all the airports and its details (name, icao, and chartlink) I have even tried using an existing class (operations data) and I just can't figure it out. I have a book on php code, but it seems to be different from the VMS. I have used this: and get a table with only the aiport name. The module file simply calls the template. My original class (that I gave up on and have now used the Operation Data one was: I was hoping that someone would be able to give me a very simple example of a class, module, and template so that I can reverse engineer it and figure this all out. I wou…
Last reply by kbohme, -
- 2 replies
- 3.3k views
I have searched the forum and might have missed it, but does anyone have a code snippet to add TS3 server status to the front page of the crystal II skin? Thanks in advance
Last reply by simpilot, -
- 25 replies
- 8.9k views
Portuguese: Ola, Tem Como Eu Colocar No Status da Minha Empresa Aerea Virtual, o numero de passageiros transportados? English: Hello, How I Put It On the Status of My Virtual Airline, the number of passengers carried?
Last reply by TAV1702, -
- 18 replies
- 8.5k views
Hi all, Sorry if I put this in the wrong place. I wanted to know if it is possible to have a default skin for phpvms to load and then in each users profile section of the site under the profile options heading have a drop down box so they can select a skin and save it so that it becomes their fav skin and loads when ever they log in without affecting the skin other users see. An example of what I am trying to say is they user theme selection many forums use. Any thoughts on the idea would be great Cheers Jonny
Last reply by Nabeel, -
- 7 replies
- 3.2k views
I was looking for this code as I want to put a link on the frond page saying: there are 5 xacars flights - click hee to view Thanks for all the help, james
Last reply by James142, -
Sorting Active/Inactive Pilots [SOLVED]
by Guest lorathon- 11 replies
- 4.4k views
I looked for the original thread for this but could not find it. This fixes the problem where if you attempt to sort the status of pilots by Active/Inactive the entire list of pilots would disappear. To fix you need to make a modification to one file. /admin/templates/pilots_list.tpl Replace the code in the template with this. (Be sure to make a back-up of the original first.) <h3>Pilots List</h3> <table id="grid"></table> <div id="pager"></div> <br /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo fileurl('/lib/js/jqgrid/css/ui.jqgrid.css');?>" /> <script src="<?php echo fileu…
Last reply by Nabeel, -
- 0 replies
- 1.8k views
Hey Guys, All my cargo routes have flight numbers starting with 9. Currently www.zonexecutive.com/index.php/routemap shows ALL routes. I want a separate map maybe like www.zonexecutive.com/index.php/routemap/cargo that shows all schedules with a flight number with a first digit being 9. Any Ideas? Nout
Last reply by Nout - Zon Executive, -
- 20 replies
- 10.2k 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, -
- 8 replies
- 4.3k views
Hello All, does anybody have the code for this, I need the green table around it as well. it is on Alaska adventures virtual. Thanks
Last reply by Cor, -
- 8 replies
- 4.1k views
Hi How can i change recaptcha theme ? <script type="text/javascript"> var RecaptchaOptions = { theme : 'theme_name' }; </script>
Last reply by joeri,