Code Snippets
Pieces of code you can use around your site
327 topics in this forum
-
GCMap - Great Circle Mapper 1 2
by Guest lorathon- 42 replies
- 18.8k views
This will display the last 10 flights in a GCMap Great Circle Mapper Visit this site to customize the display of the map. <?php $flights = PIREPData::getRecentReportsByCount(10); $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=650x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /><br /> Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl …
Last reply by Marmus, -
Recent 5 Flights 1 2
by Jeff- 49 replies
- 23.1k 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, -
- 18 replies
- 7.9k 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, -
- 6 replies
- 18k views
I did this as a favor for someone, but I figured I'd share it with everyone.. you know, spread the wealth. This code simply reads the RSS feed that SMF outputs (of the latest posts) and returns it as a list (with the option to make it linkable). The implementation technique can vary, you could include the file, or just copy and paste it into your page (~100 lines). <?php /** SMF Forum RSS Feed to Latest Posts List Built for phpVMS www.phpvms.net Built by Lorenzo Aiello www.la92.com **/ /********* CONFIGURATION *********/ // Full URL to your SMF installation, WITH trailing slash $board_url = 'http://forum.yourwebsite.com/'; // Want the list to be linkable?…
Last reply by Strider, -
- 25 replies
- 8.5k 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, -
- 10 replies
- 6.9k views
A great site for worldwide notams & weather at specific airports is notams.com I have found this to be the most reliable and widest coverage of the offerings. Especially if your not US based. It can be integrated using the following code in schedule_breifing.tpl <td width="50%" ><?php echo "{$schedule->depname} ($schedule->depicao)"; ?><br /> <a href="http://<?php echo $schedule->depicao?>.notams.com/Weather" target="_blank">Click here to check the Notam's & Aiport Info</a></td> <td width="50%" ><?php echo "{$schedule->arrname} ($schedule->a…
Last reply by CPC900, -
- 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, -
- 11 replies
- 7.3k views
Hello i m looking for help ! I like to make an auto accept pirep system, if someone got a code to this please sheare the code with me. Thank you!
Last reply by Txmmy83, -
- 3 replies
- 3.4k views
Nabeel, i have a pilots list currently displayed in the va stats, listed i have all the countries displaying the flag and location in a table (for anyone else this is the code)Page in action <?php echo '<td align="center" width="250px" valign="top">'; echo '<table cellspacing="1" cellpadding="1" border="1">'; echo '<th width="150px"><div align="left">Country Location</div></th>'; echo '<th width="100px"><div align="center">Pilots</div></th>'; $country_info = DB::get_results('SELECT COUNT(pilotid) as total, location FROM '.TABLE_PREFIX.'pilots GROUP BY LOCATION'); foreach($country_info as $country) { echo …
Last reply by Nabeel, -
- 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, -
- 20 replies
- 9.8k 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, -
- 2 replies
- 2.1k views
I want to change the title to the Russian language, in which file can I change this? I was looking but never found! Schedules - KD Avia Profile - KD Avia Thanks!
Last reply by Artjom, -
Pirep times
by Alex- 4 replies
- 2.7k views
I have been getting complaints in relation to the filing of Pireps and in particular the flight duration box. We know that 5.3 = 5 1/2hrs or 5 hours 30 minutes. however some people have difficulty with this ???? is there a code snippet to include a box "hours" "minutes" in text format so that this issue can be resolved? Any help with coding would be appreciated, even if it's just to get the monkey off my back.
Last reply by Alex, -
- 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, -
- 9 replies
- 4.5k views
Hi is there a quick way of displaying the current flight bids on another page just like they are in the admin section?
Last reply by Aaryan, -
- 2 replies
- 2.5k views
Hey guys, Im trying to have some kind of a document center in my pilot center, So I created a category in the downloads called Documents, Now I want to display only that Category in the Profile_main.tpl I used <?php MainController::Run('Downloads', 'index'); ?> and it displays all the downloads. How would I accomplish this could I use an IF statement? Thanks, Chad C.
Last reply by piper338, -
- 4 replies
- 2.8k views
Hello users I will make a Last Flight and Date in pilot center and pilot public center! This code works in "Pilot Center" <li><strong>Last Flight: </strong><?php echo $report->code . $report->flightnum; ?>(<?php echo $report->submitdate; ?>)</li> And I will Last Flight and Date works in Pilot Public Profile How can I create this? please help. Best regards.
-
- 14 replies
- 9.1k views
Good day, I'm trying to display current bids, in table format, in the main body of the front page without much luck. The problem is that no data is displayed even though there are bids, there are also no error messages displayed. Any help would be greatly appreciated. Many thanks Mark
Last reply by Harryh, -
- 13 replies
- 9.7k views
This may have been covered before but is there a way to Put the ADD BID link on the Pilot Brief page. This would help my pilots so that instead of hitting the back button on their browser they could just add the bid to their schedules from the Pilot brief page. When you use the back tab it bring up all the current schedules. Any ideas? I tried to put the add bid code in from the schedule_results.tpl on to the schedule_briefing.tpl page and all I got was the word ADD BID but it had no action to it. Thanks for any help in this,
Last reply by AUZ, -
- 16 replies
- 4.5k views
Hey Guys, Well this is a record, I aint asked for help for a bit of time! Ok, So is there a way to do something like this... (UK FLAG) Total Pilots: 100 (US FLAG) Total Pilots: 100 (DE FLAG) Total Pilots: 100 etc... Thomas.
Last reply by mark1million, -
- 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, -
- 0 replies
- 2k views
This topic has been moved to Releases. [iurl]http://forum.phpvms.net/index.php?topic=2091.0[/iurl]
Last reply by Nabeel, -
Getting airport country names
by Guest chikolol- 3 replies
- 2.8k views
sorry to post this again, i know i have posted this before but no one answers me, how can i call for the country name of the airport to show in schedules details along with the airport name, i know something like $schedules->name pulls our the airport name but how about $schedules->country would that work?
-
- 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, -
- 11 replies
- 5.1k views
1_Edit the "frontpage_main.tpl" in /core/templates or /lib/Skins/. 2_ Place this code: <h3>Users Online<br /> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); ?> </h3> <h4 class="style6">Pilots Online </h4> <?php foreach($usersonline as $pilot) { echo "<p>"; echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />'; echo " {$pilot->firstname} {$pilot->lastname}<br />"; echo "</p>"; } ?> <br /> Have <?php ech…
Last reply by Thomas, -
- 5 replies
- 2.5k views
I would like to set something up on Pilots Profile where only people in Groups can see the content, this has failed. I wondered whether anyone knew a code that would work were only Certain groups can see the content.
Last reply by TAV1702, -
- 20 replies
- 12.1k views
I know most of you would get this working yourself, but for you who dont here is a sample of the code I use to display custom chart snapshots and links in the pilot briefing page. Also included are the links we use for weather: First of all I gathered all the links for the airports we fly to, based the charts on the lokal vacc at vatsim because many AIP sites require you to log in: I placed snaphost of the ground layout with format ICAO.gif in folder named images/charts . Image size 387*594. It is a bit of work, but I think the result is good. Have only received possitve feedback so far ;D Links placed in the airporttable under 'chartlink' and added a row for link to l…
Last reply by jonesrobin,