Jump to content

Someone please help me


Omerr01

Recommended Posts

Hello,

-

Ive been trying to limit the landing rate stats module to a weekly limit. ie, to only show the to landings of every given week. Ive been having some trouble achieving this. I have gone through the mega thread of the module it self and while there are some hints of a code snippet to limit it to monthly, unfortunately i have not been able to work out how to implement the code or where to implement it to.

I would greatly appreciate any help or an explanation on how to implement a code that will restrict the top landings for a weekly display which will reset itself every week.

--

and the two is about TOPPILOT Moudle:

Im trying to get some of the top pilot tables to show on our homepage. Can anyone provide anyt insight as to what the code should look like and where should it go.

Thanks for helpers

Link to comment
Share on other sites

1. I don't have this module, so I can only guess the module's code.

In the module's class file (core/common):

$weekago = strftime("d/m/Y", date() - 60*60*24*7);

An then, in the SQL code that retrieves the PIREPs, add this:

AND submitdate > '$weekago'

2. Here's an example for the most flights per pilot for this month. Variables might not be correct in the table I'm afraid, I'm doing this quickly.

<table>
<?php
$month = date('m');
$year = date('Y');
$mostflights = TopPilot::top_pilot_flights($month, $year, 5);

foreach($mostflights as $flight){
<tr>
<td><?php echo $flight->pilotid;?></td>
<td><?php echo $flight->flights;?></td>
</tr>
}
?>
</table>

Both untested, give it a go.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...