I am trying to copy some code from top pilots module, put into my frontpage_main.php. When I do this I get this message.
I have flights already this month, the mod pages shows that aswell.
Here is the code take from the modules template file. Am I missing something? Any idea why its not showing the flights?
<div class="group">
<div class="col span_1_of_2">
<h3>Hours Flown</h3>
<table>
<thead>
<tr>
<th>
Member
</th>
<th style="text-align: right;">
Hours
</th>
</tr>
</thead>
<tbody>
<?php
$all_hours = TopPilotData::top_pilot_hours($today[mon], $today[year], 5); ?>
<?php if (!$all_hours): ?>
<tr><td colspan="2">Get a head start on this month's leaderboard by flying today!</td></tr>
<?php else:
foreach($all_hours as $entry):
$pilot = PilotData::GetPilotData($entry->pilot_id); ?>
<tr>
<td>
<strong>
<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></strong>
<img src="<?php echo Countries::getCountryImage($pilot->location);?>"
alt="<?php echo Countries::getCountryName($pilot->location);?>" style="padding-right: 10px; position: relative; top: 1px;"/><br/>
<a href="<?php echo url('profile/view/'.$pilot->pilotid); ?>">
<?php echo $pilot->firstname.' '.$pilot->lastname?></a>
</td>
<td style="text-align: right;">
<?php echo str_replace(".", ":", number_format($entry->hours, 2)); ?>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
</div>