Jump to content

mark1million

Moderators
  • Posts

    2288
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by mark1million

  1. Good job, i know what its like banging your head and i also know what its like when you get things working
  2. Guys all the base package is OK, fine, its when you start adding skins and other scripts without verifying what they can do or create on your server, then there becomes a problem. If other links are placed anywhere on a domain to a site that has been associated as hosting malware then you will most probably get a warning message about it which makes sense. Thing to remember is look at every script before you put on your site or use, if you dont understand what it can do then dont put it on.
  3. Dont worry i got it Your light shon the way. Thanks, <?php MainController::Run('TouchdownStats', 'top_landing_this_month'); ?>
  4. Dave, Its not showing and im not getting any errors in the logs either
  5. Maybe you can mash this up to get what you want, this will run outside vms, should also work inside with a bit of alteration. <?php error_reporting(E_ALL); include '/YOURPATH TO CORE//core/codon.config.php'; $allpilots = PilotData::getAllPilots(); foreach($allpilots as $pilot) { } ?> <h3>Aerosoft Pilot Hours Validation</h3> <p>To Quick search name or pilot id hit Ctrl + F and and type in data.</p> <?php if(!$allpilots) { echo 'There are no pilots!</div>'; return; } ?> <table width="380" cellspacing="1" cellpadding="5" border="1"> <thead> <tr> <th width="60px">Pilot ID</th> <th width="200px">Name</th> <th width="55px">Hours</th> <th width="65px">Active/Inactive</th> </tr> </thead> <tbody> <?php foreach($allpilots as $pilot) { /* To include a custom field, use the following example: <td> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </td> For instance, if you added a field called "IVAO Callsign": echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign'); */ ?> <tr> <td width="1%" nowrap><a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td> <div align="left"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </div></td> <td><div align="center"><?php echo $pilot->totalhours?></div></td> <td><div align="center"><?php If ($pilot->retired == 0) { echo '<img src="/images/green-status.gif" />'; } else { echo '<img src="/images/red-status.gif" />'; } ?></div></td></div></td> <?php } ?> </div> </tbody> </table>
  6. Even easier if you have a old machine, just download ubuntu server 32bit you will be up and running in an hour or so.
  7. 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.
  8. 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.
  9. Nope, what's the site you are using?
  10. 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,
  11. 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.
  12. :) :) Top man. Thankyou.
  13. OK the now() works but its bringing back all the years so Feb 2010 and 2011, how do i limit the year.
  14. 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
  15. 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
  16. 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.
  17. 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.
  18. Current month with maybe a selection drop down?
  19. What was it?
  20. Ah ok just change the image part to the variable $fieldvalue I have not tested but should be OK
  21. The code above presumes you have a field value in registration called Vatsim ID That is a line from my pilots list tpl
  22. 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>
  23. 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
  24. 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.
×
×
  • Create New...