Jump to content

mark1million

Moderators
  • Posts

    2283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by mark1million

  1. Even easier if you have a old machine, just download ubuntu server 32bit you will be up and running in an hour or so.
  2. You would need a static ip address or transfer your dns service to dyndns.org there you can fully manage your dns and download a client which if your ipaddress dies change it will update the dns records with the new one but this is not instant their can be a 5 minute delay at max. What ever you do do not host on winamp, just install apache mysql and php manually, its fairly easy to do it.
  3. Dave, I have been trying to get this to display on the top pilot page for hours now, i just cant seem to get it. <h3>Top 10 Landings for <?php echo date("F Y");?></h3> <table width="700" border="1" cellspacing="1" cellpadding="1"> <tr> <th>Pilot</th> <th>Aircraft</th> <th>Arrival Field</th> <th>Landing Rate</th> <th>Date Flown</th> </tr> <?php foreach($stats as $stat) { $pilot = PilotData::getPilotData($stat->pilotid); $aircraft = OperationsData::getAircraftInfo($stat->aircraft); echo '<tr>'; echo '<td>'.PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname.'</td>'; echo '<td align="center">'.$aircraft->fullname.'</td>'; echo '<td align="center">'.$stat->arricao.'</td>'; echo '<td align="center">'.$stat->landingrate.'</td>'; echo '<td align="center">'.date(DATE_FORMAT, strtotime($stat->submitdate)).'</td>'; echo '</tr>'; } ?> </table> I have added a new call to the module TouchdownStats.php, } public function top_landing_this_month () { $this->set('stats', TouchdownStatsData::get_stats_by_cur_month()); $this->show('touchdownstats/touchdownstats_index.tpl'); And also a new sql query to the TouchdownStatsData.class.php //added By Mark Grant 03-02-2011 public function get_stats_by_cur_month () { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' AND MONTH(submitdate)=MONTH(now()) AND YEAR(submitdate)=YEAR(now()) ORDER BY landingrate DESC LIMIT 10"; return DB::get_results($query); } Everything works fine when i use the url to call, http://www.easyjetva.com/index.php/TouchdownStats/top_landing_this_month but when i add that code to the tp_index.php i keep getting Invalid argument supplied for foreach(), i have tried renaming the variables but i cant seem to get it, any help would be appreciated. Thanks.
  4. Nope, what's the site you are using?
  5. Sorry didn't explain fully, i want that data on another page but i cant include it as it needs to be ran as a url,
  6. Right i have this working and limiting nicely now I want to put this page in another page but i cant seem to get it to work, any ideas would be great, i have tried, <?php MainController::Run('TouchdownStats', 'display_TouchdownStats/top_landing_this_month'); ?> here is the page, http://www.easyjetva.com/index.php/TouchdownStats/top_landing_this_month cheers.
  7. OK the now() works but its bringing back all the years so Feb 2010 and 2011, how do i limit the year.
  8. Right i have had to do a bit of syntax adjustment but its working to a point, the top function seems to pull back all the landings from every month, doesnt seem to limit by current month. I will keep playing and see what i can do
  9. Cheers i will give that a go in a bit let you know, as for the error a simple, error_reporting(0); will stop that outputting to screen
  10. Great, Just check that line echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; Dont think it needs 2 closing tags.
  11. I put my link in the id success div goes across the top of the page nicely, that was ages ago though i couldn't tell you the tpl file.
  12. Current month with maybe a selection drop down?
  13. Ah ok just change the image part to the variable $fieldvalue I have not tested but should be OK
  14. The code above presumes you have a field value in registration called Vatsim ID That is a line from my pilots list tpl
  15. Sorry guys i have just read this thread, this is more complex than it need be. Add another field on registration VatsimID, IVAO ID etc or what you like then you can call that field in the pilots list or where ever you like, Examples, http://www.easyjetva.com/index.php/pilots You can then output the id's as a link variable. <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank"><img src="/images/charticon.jpg" width="28" height="28" border="0" alt="Vatsim ID" /></a></a>' ; } else { echo '<img src="/images/nonreg.png" width="20" height="18" border="0" alt="Not Listed" /></a>' ; } ?> </div></td>
  16. Thank you, worked a treat. Hope you don't mind but im going to put your group icon on my home page, i get quote a lot of traffic so hopefully you will get some of it
  17. Yeh that sounds good, i would be willing to share my limited knowledge of php to get this thing off the ground. Maybe instead of predefined awards how about admin defined awards so each va's admin could create on the fly but like you said it would need the logic coding beforehand so that wouldn't quite work in all circumstanced but for amount of landings, pax, miles etc should be fine.
  18. That would be a good edition as this is all manually done at the moment apart from the ranks which are tied in to specified hours in the admin section. You would have to create a module for the admin side with the logic and definable parameters. Would be nice to see
  19. If you have root access just do, iptables -A INPUT -s ipaddress -j DROP replace the ipaddress with the up you want to ban. Basically that will use the iptables in linux to drop a connection that has an ipaddress you specify.
  20. Dave, is there a simple way if adding the historical stats in to a dropdown list? Would look much nicer as the list is starting to get a bit long now, Cheers.
  21. Not with in phpvms script but you can use your server to ban these, are you in linux or windows? Also what kind of access do you have to your server. If you using a Linux distro you can use, Permanently Ban IP Addresses, iptables -A INPUT -s IPADDRESSOFBAN -j DROP iptables-save > firewall.log and iptables-restore < firewall.log If you using Windows go in to iis and then security from there you can add ipaddresses to ban.
×
×
  • Create New...