Moderators mark1million Posted April 30, 2011 Moderators Report Share Posted April 30, 2011 Strange thing is though all the old variables will still work so im not sure why your not able to get the map to display. Quote Link to comment Share on other sites More sharing options...
Industrialshadow Posted April 30, 2011 Report Share Posted April 30, 2011 i dont know why i become it not to display. But i the map is show on the frontpage only the error nervs me *lol* I will also search. i hope i can find the error but my coding experience is not the best..... cheers Quote Link to comment Share on other sites More sharing options...
Jeff Posted April 30, 2011 Report Share Posted April 30, 2011 deleted reply 1 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted June 24, 2011 Report Share Posted June 24, 2011 Any idea why my map would show as a broken image. It was working fine untill today. I didn't touch the code. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted June 24, 2011 Report Share Posted June 24, 2011 Check the flights. One of the airports may not be in the DB of the GCMap. You may have to wait until a few more pireps are filed for it to clear the recent flights. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted June 24, 2011 Report Share Posted June 24, 2011 TY Quote Link to comment Share on other sites More sharing options...
JustinRomaine Posted July 29, 2011 Report Share Posted July 29, 2011 Hey I got this errer above the photo, Warning: Invalid argument supplied for foreach() in /home/spiritvi/public_html/lib/skins/brilliancev1/frontpage_main.tpl on line 6 Heres the Code: <?php $flights = PIREPData::getRecentReportsByCount(10); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <img src="[url="http://www.gcmap.com/map?P=<?php"]http://www.gcmap.com/map?P=<?php[/url] echo $string ?>&MS=bm&MR=240&MX=590x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /> <?php $count = 15; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table width="94%" border="0" bordercolor="#FFFFFF"> <thead> <tr align="center" valign="middle" bgcolor="#7D95AF"> <th>Flight #</th> <th>Departure</th> <th>Arrival</th> <th>Duration</th> <th>Pilot</th> <th>Landing Rate</th> <th>Aircraft</th> </tr> </thead> <tbody> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); echo "<tr>"; echo "<td align=center> $pirep->code $pirep->flightnum </td>"; echo "<td align=center> $pirep->depicao </td>"; echo "<td align=center> $pirep->arricao </td>"; echo "<td align=center> $pirep->flighttime </td>"; echo "<td align=center> $pilotid $pilotinfo->firstname $pilotinfo->lastname </td>"; echo "<td align=center> $pirep->landingrate </td>"; echo "<td align=center> $pirep->aircraft </td>"; echo "</tr>"; } } else { echo "<tr><td>There are no recent flights!</td></tr>"; } ?> </tr></table> </div> Quote Link to comment Share on other sites More sharing options...
JustinRomaine Posted June 17, 2012 Report Share Posted June 17, 2012 <?php $count = 5; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table width="427" border="0" cellspacing="2" cellpadding="2"> <tdead> <tr class="recent"> <td width="68"><strong>Flight No</strong></td> <td width="70"><strong>Departure</strong></td> <td width="84"><strong>Arrival</strong></td> <td width="74"><strong>Duration</strong></td> <td width="38"><strong>Pilot</strong></td> <td width="55"><strong>Status</strong></td> </tr> </tdead> <tbody> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); } ?> <tr> <td><a href="<?php echo url('/pireps/viewreport/'.$pirep->pirepid);?>"> <?php echo $pirep->code.$pirep->flightnum; ?></a> </td> <td><?php echo $pirep->depicao; ?></td> <td><?php echo $pirep->arricao; ?></td> <td><?php echo $pirep->flighttime; ?></td> <td><?php echo $pirep->pilotid; ?></td> <td><?php if($pirep->accepted == PIREP_ACCEPTED) echo '<span style="color:#347C17"><strong>Accepted</strong></span>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<span style="color:#FF0000"><strong>Rejected</strong></span>'; elseif($pirep->accepted == PIREP_PENDING) echo '<span style="color:#E56717"><strong>Approval Pending</strong></span>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<span style="color:#whatever">Flight in Progress</span>'; ?> </td> </tr> <?php }} else { echo '<tr><td>There are no recent flights!</td></tr>'; } ?> </tbody> </table> Im useing this coded but I cant seem to get a map to link to it and the map show the routes what am I doing wrong thanks. Quote Link to comment Share on other sites More sharing options...
Curshad Posted July 18, 2012 Report Share Posted July 18, 2012 Hey I got this errer above the photo, Warning: Invalid argument supplied for foreach() in /home/spiritvi/public_html/lib/skins/brilliancev1/frontpage_main.tpl on line 6 Heres the Code: <?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=590x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /> <?php $count = 15; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table width="94%" border="0" bordercolor="#FFFFFF"> <thead> <tr align="center" valign="middle" bgcolor="#7D95AF"> <th>Flight #</th> <th>Departure</th> <th>Arrival</th> <th>Duration</th> <th>Pilot</th> <th>Landing Rate</th> <th>Aircraft</th> </tr> </thead> <tbody> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); echo "<tr>"; echo "<td align=center> $pirep->code $pirep->flightnum </td>"; echo "<td align=center> $pirep->depicao </td>"; echo "<td align=center> $pirep->arricao </td>"; echo "<td align=center> $pirep->flighttime </td>"; echo "<td align=center> $pilotid $pilotinfo->firstname $pilotinfo->lastname </td>"; echo "<td align=center> $pirep->landingrate </td>"; echo "<td align=center> $pirep->aircraft </td>"; echo "</tr>"; } } else { echo "<tr><td>There are no recent flights!</td></tr>"; } ?> </tr></table> </div> I got the Same Error any know how to fix? or is this because there were no flights made? Quote Link to comment Share on other sites More sharing options...
Marmus Posted November 7, 2012 Report Share Posted November 7, 2012 I understand how this code "builds" the website address by adding the Departure and Arrival airports into the website link....but GCMaps also allows you to build the same link using the Latitude and Longitude coordinates to build the address. I would like to add code so that it looks up the Departure and Arrival Airports in my own MySQL database and retrieve the Lat/Long coordinates to be inputted into the web address. This would eliminate errors for the smaller airports that may not be into the GCMaps database. The downside is that it will not list the airport name code on the map. The web address format for San Fransisco to Los Angles Airports with the code as currently written would be:http://www.gcmap.com/mapui?P=LAX-SFO (http://www.gcmap.com/mapui?P=LAX-SFO) But using the Lat/Long coordinates, it can also be written as:http://www.gcmap.com/mapui?P=37.618972+N+122.374889+W-33.942495+N+118.408067+W (http://www.gcmap.com... N 118.408067 W) I am just not sure of the easiest way to query the "phpvms_airports" database for the Lat/Long and write the new code into the current code. <?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=590x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /> <?php $count = 15; $pireps = PIREPData::getRecentReportsByCount($count); ?> Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted November 10, 2012 Report Share Posted November 10, 2012 How about doing it for each individual pilot so i could put in on their pilotcentre. Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted November 11, 2012 Report Share Posted November 11, 2012 anyone? ^^ Quote Link to comment Share on other sites More sharing options...
Marmus Posted November 29, 2012 Report Share Posted November 29, 2012 Check this thread. It is the second portion of code on 2nd post of thread...works great on the pilot page http://forum.phpvms.net/topic/8040-adding-map/page__hl__+great%20+circle#entry53587 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.