Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
- 4 replies
- 2.4k views
How can I get the Great Circle Mapper Code only show the Pilots flights. <?php $flights = PIREPData::getRecentReportsByCount(5); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=790x400&PM=permr:diamond7:green%2b%22%25I%22:white&PC=%fffff" /><br /> Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> It should only show the logged in pilots flights on the map. Thanks in Advance.
Last reply by Stealthbird97, -
- 11 replies
- 3.4k views
Hello, Would anybody know the code to split up the hubs into airline categories on the registration page like this?. Regards Michael
Last reply by Stealthbird97, -
My intent is to be able to click on the "File a new PIREP" link....have it take me to a page with only two buttons....."File a FSX Flight" and "File a DCS Flight." Each a link to a different PIREP form. I utilized David Clarke's great content module tutorial to create two new pages (tutorial: http://david-clark.n...content-module/). It appears that I used the tutorial correctly...my links are working, but the data stream seems to have been broken somewhere. Explanation: New pages are called "pirep_fsx.tpl" and "pirep_dcs.tpl" I created the new module, as directed in the tutorial....but I do not think it is the problem (I could be wrong) I replaced the data in the def…
Last reply by Parkho, -
- 9 replies
- 3.5k views
Hi all I have adapted my code to show country and rank but I have a problem it shows the country fine but not the rank here is my code any help would be great thanks. <div id="box"> <div> <h2>Users Online</h2> <p> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); ?> <h4>Pilots Online</h4> <?php $shown = array(); foreach($usersonline as $pilot) { if(in_array($pilot->pilotid, $shown)) continue; else $shown[] = $pilot->pilotid; echo "<p>"; echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot-&…
Last reply by Stealthbird97, -
- 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, -
- 7 replies
- 2.9k 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, -
- 4 replies
- 2.5k views
Does anyone know how do I add like to a fleet page how many planes we have on order something that can change automatically
Last reply by Dominican Airways, -
- 28 replies
- 9.5k views
$last_location = PIREPData::getLastReports([PILOT_ID], 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; Of course, replacing the [PILOT ID] with the variable holding the pilot's ID
Last reply by Marmus, -
% complete flight 1 2 3
by fsx- 2 followers
- 74 replies
- 29k views
how can I get this?
Last reply by Angel Air, -
- 1 reply
- 1.4k views
Does anyone know the code or what I have to do to be able to add notes to the pilot center for the pilots to see?
Last reply by Parkho, -
- 1 reply
- 1.4k views
Anyone have the code or know how I can add like something showing our Team Speak Server?
Last reply by servetas, -
- 7 replies
- 3k views
Has anyone got a script which creates a different pilot badge depending on the pilot rank? Thanks
-
- 5 replies
- 3.6k 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, -
- 5 replies
- 2.1k views
Hey, I think,if have a way to get routes direct from other sites,because if you have a lot of a routes do add, is very tiring and time consuming to add with admin panel. Waiting. Thanx
Last reply by Gabriel Fernandez, -
- 1 reply
- 1.7k views
I am a web designer and would like to build my own VA website, do you guys have all the codes that i would need to add different functionality to my site and is there any video tutorial that explains step by step how to go about adding such scripts in for some who may not know who are beginners....reason i ask is because i have many folks here who is into aviation looking to start a VA and get their sites up but i have to first get clearification as to building one and teaching them how i got it done.
Last reply by Sava, -
Live Fuel Problem work around
by Guest lorathon- 9 replies
- 5.5k views
Since the live fuel server stopped allowing phpVMS users to access the live fuel I have been seeing too many flights with a zero for fuel price. I am assuming this was due to the copy that Nabeel put up for the live lookup. I still wanted to use the live lookup ( I dont like the idea of all of the airports having the same fuel price) so I just looked for a work around. What I wanted was to be able to poll the live fuel server, if there was a price there then use it. If not then use the default. The problem became that sometimes a zero was sent back. The script would then run the fuel calc with zero as the fuel price. So I dug in and worked out a way to accomplish…
Last reply by Ghiby, -
- 11 replies
- 4.6k views
If you would like to use phpfree chat, here goes. Visit their page for docs, their info is really helpful. Upload phpfree chat to your website . Place this at the beginning of your chat page. <?php require_once dirname(__FILE__)."/phpfreechat-1.5/src/phpfreechat.class.php"; //this is the location of your chat directory $params = array(); $params["admins"] = array('your-admin-name' => 'your-password');//this is the admin name and password - you can have more than one admin $params["title"] = "Pilot's Lounge"; //name of the chat room $params['firstisadmin'] = false; //do not change this $params["theme"] = "blune"; //this is where you change the theme $params['…
Last reply by RogerB, -
- 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, -
- 1 reply
- 1.6k views
Please help me, i want to limit access to specific module. Probably via .htaccess and password. Please help if you know how ... P.
Last reply by simpilot, -
- 0 replies
- 1.3k views
Hi, How would I go about creating a page in the Admin panel of PHPVMS? I understand about adding the link in the nav on the left, but I can't link it up etc. If anybody could help, would be great. Thanks Daniel
Last reply by PlumbBum, -
- 5 replies
- 2.2k 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, -
- 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, -
- 3 replies
- 2.2k views
Hello, Could someone please provide me with a bit of code that echo's out the id of the current signed in pilot. I can already make it go VIRXXXX but I just need it to show the XXXX part, without the "VIR" infront? If that makes sense, Thanks for help in advanced, Regards, Daniel
Last reply by Sava, -
- 8 replies
- 3k views
Hello everyone, i am trying to built my own award module for my virtual airline in order to have the possibility to add the same award multiple times to a pilot. For now i have stucked on a "silly" part: I want to make an auto count the <tr> of my table awards. Fore example: Auto Number Award Type Issued 1. Good Pilot 10/10/10 2. Good Landing 11/10/12 I just want to create the bold numbers automatically . servetas
Last reply by Strider, -
- 4 replies
- 1.8k views
Whilst looking at my bookings list for my pilots the idea of having a reminder of bookings hit me. I know this can be done. I was considering something along the lines having an email sent to the pilot if their bid is more than one week old. And to prevent several emails at once (say the pilot booked a 10-leg journey) mention each booking in the one mail. I would do a rough code but my brain won't work. I've been working on a lot tonight. ----- Oh and one more thing, some of you may remember me asking what the cons of deleting a pilot were. Well, I found this in my PilotData.class.php: public static function deletePilot($pilotid) { $sql = array(); unset(self::$pi…
Last reply by freshJet, -
- 8 replies
- 5.1k views
Hey guys, I have a new project that I want to do. I noticed the boarding pass does this thing where is gets a random gate, how can I make it randomly select the specific gate at an airport? For example, I have 14 gates at Las Vegas, and 11 gates at San Jose. If a pilot views the boarding pass I want it to randomly select one of the gate numbers I put in for Vegas. Then I plan on taking this method and putting it in my flight dispatch for pilots. So, how would I go about doing this? Would if be possible to write something like if $airport = KLAS select gates x - x or something of the sort? I'm not all to great with php..
Last reply by CPC900, -
- 4 replies
- 2.7k views
The latest pilots to join thing on the index is nice and dandy if you keep consecutive Pilot IDs. If you change the Pilot IDs on registration (say, for hub purposes) there is an unfortunate problem where it only shows the highest Pilot ID, which may not necessarily be the newest pilot. I whipped up a work-around that should benefit airlines that do this. This simple change can be condensed even more, but I figured I would create a new Method just to keep things clean (and give me something to fall back on later). Open core/common/PilotData.class.php Add this snippet somewhere (perhaps after the getLatestPilots method, Line ~227) public static function getLatestPilot…
Last reply by Vidofnir, -
There is no field for this so if I want the booking date I presume I would just find the phpvms_bids table and add a date field to for a timestamp? And if so is that all or is there more to it?
Last reply by Txmmy83, -
- 1 reply
- 1.7k views
Would like to see what the code is to show the number of pending pilots.
Last reply by Kyle, -
- 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,