Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 2 followers
- 39 replies
- 11.9k 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, -
- 5 replies
- 3.8k views
Is possible in phpvms prevent to receive pireps for flights who are non booked? One of my pilots manualy fill acars and after flight complete send and system receive flight which is not in va system.
Last reply by Ephendi, -
- 0 replies
- 3k views
Unless google comes out with a quick fix, here is a fix for an error you are, not a matter of if but when, going to see it. PLEASE RESEARCH THIS FIRST!!!!! DO NOT USE UNLESS YOU ARE SURE! I WILL NOT BE RESPONSIBLE FOR YOUR SECURITY OR WEBSITE. I am not a pro. I just read this on stackoverflow and it worked. line 42 reads: function ReCaptcha It needs to be : public function __construct to fix this: Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ReCaptcha has a deprecated constructor in C:\wamp\www\phpvms\core\lib\recaptcha\recaptchalib.php on line 42 That error is a result of running phpvms on php 7 and m…
Last reply by TAV1702, -
- 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
-
- 1 follower
- 8 replies
- 2.9k views
I've finished a little code snippet for everyone, I was prompted to create this in regards to a particular individual that posted someone else's PHPVMS Skin. Well, the only way this person got this, was either through Fire Fox FireBug plugin, or just plain hacked it. ( the code source that is.) Easy to do now a days, so here, this is for Everyone, and is really simple, short and to the point. This will Protect against a right click to view the page source, if you put this into the ---> layout.php page, and/or the , frontpage_main.php "Anywhere", and of course this can be used anywhere you want. And it IS HTML compliant !! Period. php,htm, html, xml, and xhtml. B…
Last reply by Vangelis, -
- 1 follower
- 3 replies
- 1.7k views
Anyone know where the list of queries are kept for returning data to a page on your site ?
Last reply by shaun105, -
- 2 replies
- 1.8k views
Hello, I'd like to know some of the codes for outputting the current financial state of the VA. In particular, I'd like to see how to output the sum total of all profit ever! i.e. the current 'cash' held by the company. In viewing finance_balancesheet.tpl I can only see monthly totals. Any other function calls or documentation are also welcome I am considering creating a little module for a bit of financial role-play immersion.
Last reply by GavinZac, -
- 0 replies
- 1.4k views
Closed
Last reply by PedroBoreio, -
- 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, -
- 0 replies
- 1.7k views
Place the following on your site to randomly display a quote on page load. I recommend putting it in something like a bootstrap alert as done here http://redwoodva.net. Cheers! http://pastebin.com/KZasTXy6 Note: Everything between the quote that is written in blue, is the text that should be modified. Feel free to add as many quotes to the array as you wish.
Last reply by StartVM, -
- 9 replies
- 3k views
Hey guys! I have a problem when coding this: <li class="list-group-item"> <b>Rank Progress</b> <div style="width: 80%;display: inline;" class="progress-group"> <span class="progress-number">XX%</span> <div class="progress sm"> <div class="progress-bar progress-bar-blue-light" style="width: XX%"></div> </div> </div> </li> I want to add code to display precentage to next rank and progress bar with it. Does someone have an idea? I would appreciate any help! Thanks, Relja
Last reply by CarlosEduardo2409, -
- 8 replies
- 3.9k views
Hi How can i change recaptcha theme ? <script type="text/javascript"> var RecaptchaOptions = { theme : 'theme_name' }; </script>
Last reply by joeri, -
Recent 5 Flights 1 2
by Jeff- 49 replies
- 23.3k views
I'm trying to show a table of the 5 recent flights flown, and keep running into a brick wall here. Can someone please post the code to show the last 5 flight. Flight Number - Departure Airport - Arrival Airport - Flight Time - Pilot - Landing %
Last reply by Jiko, -
- 2 replies
- 1.5k views
Hi, is there a code snippet available for the following, a pilot joins and receives BBB002 then leaves another pilot joins, they are given BBB003 by the system, instead of the lowest available number. thanks in advance
Last reply by shaun105, -
- 18 replies
- 5.6k views
Is your Human Resources department tired of sending out welcome emails with their demographic information and general airline info? Here is a template I have constructed to solve the issue. It uses PHP Tags to pull registration info from the database such as pilot name, pilot ID, chosen hub, etc. Now you can spend less time sending emails and more time flying! Simply replace your email_registrationaccepted.tpl file with this code http://pastebin.com/Q2v4VuUR Cheers!
Last reply by simpilot, -
- 2 followers
- 2 replies
- 2.6k views
Wondering if any of the folks out there know code i can use for my registration to take all the airline options away but one? There is a dropdown on the registration form where pilots can choose an airline and i want to get rid of that and make to where, when they all join its under the same airline identifier. Thanks for any help Tyson
Last reply by tdohrer, -
- 2 replies
- 1.9k views
Hi guys, Sorry for my persistance, But i'd like to request some codes... I want to change money to points system... Exemple every flight do by pilot, he make 1 point per 10 minutes. Is possible? And implement a pilot efficiency system... Exemple 90% average pilot efficiency... And Restrict some routes to pilots without required rank and award to fly for exemple LPMA. And is possible restrict some pages in profile_main.tpl and only show exam center for pilots with 'Student' rank? And how I do to when the pilot chooses the HUB in registration proccess, exemple if he choose LPPT for his HUB, his location is automatically LPPT (HUB chosen) and automatically just ha…
Last reply by Parkho, -
- 2 replies
- 1.9k views
I have noticed quite a few virtual airlines that struggle to secure their website during development and beta testing. As you all know, without the correct protections, it is easy to view the website by appending /index.php to the URL. In order to combat this and restrict access to your entire phpVMS website by IP address, simply replace your index.php file in your root phpVMS directory with this attachment. The original code has been unaltered, I added about 16 lines of code to the top of it for the ip handling. The code is commented and quite self explanatory on how to work it. Cheers! index.php
Last reply by StartVM, -
- 6 replies
- 3k views
full article on my blog: http://code.voemercosul.com/ CODES: http://pastebin.com/jXJFrLL1 http://pastebin.com/TAguaNYb PS.: This is not the best programming method for phpVMS, soon I will post an update of the traditional form code, this is a more inciante method. DEMO: http://voemercosul.com/v2/index.php/Dataroutes aeroportos_tw.sql.zip
Last reply by LuisMoraes132, -
- 0 replies
- 1.6k 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, -
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, -
- 5 replies
- 2.9k views
Hey guys, Just wondering if anyone have some code so that on the sidebar menu it will have "My Bookings" and underneath it will say "you havent booked a flight yet<br />Click Here to to get a flight. And when you have Bid for a flight it will shouw the departure and destination??? Thanks for the help (See ya in the skies) Kieran
Last reply by HighFlyerPL185, -
- 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, -
- 23 replies
- 8.2k views
staff would like to know if someone has a script that creates the company badge with the picture, id pilot, hub and everything else! Thank you! Exemple:
Last reply by warpennys, -
- 1 reply
- 1.8k views
Hi, i hope that anyone can help me. i search for a code that pilots can schedules on time. example: Select An Airline Select your departure airport: Select your arrival airport: Select aircraft: and than: schedule time: i hope that anyone can help greets michael kraan
Last reply by Tato123, -
- 3 replies
- 2.1k views
Hello, I'm trying to do a search for bands of time using the form Frontschedules. In the airport search.tpl I entered this search option: <tr> <td>Orario</td> <td> <select class="search" name="deptime"> <option value="">All</option> <option value="00:01|08:00">00.01/08.00</option> <option value="08:01|16:00">08.01/16.00</option> <option value="16:01|24:00">16.01/24.00</option> </select> </td> </tr> In the FrontSchedules.php: public function findflight() { $arricao = DB::escape($this->post->arricao); $…
Last reply by ln-asm, -
- 0 replies
- 1.3k views
How can i make it that the search schedules on the site .../pireps/routesmap on several undersides are indicated. Any help would be great... Regards from Germany
Last reply by AEUfly, -
- 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, -
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, -
- 5 replies
- 5.8k views
No charts are displayed for any airports in the schdule briefing, so I modified the code to display charts found in the database. If no charts are found it will display the default link for airnav.com plus the message "No local charts found, try - [airnavlink]". You can see it here: http://www.flybritair.com/index.php/schedules/brief/1 You have to edit schedule_briefing.tpl Replace: <table width="98%" align="center"> <tr style="background-color: #333; color: #FFF;"> <td>Charts for <?php echo $schedule->depicao?></td> <td>Charts for <?php echo $schedule->arricao?></td> </tr> <tr align="center"> &l…
Last reply by tgycgijoes,