Skip to content

Commit

Permalink
Fixed the ranking on active
Browse files Browse the repository at this point in the history
  • Loading branch information
Squigs44 committed Apr 19, 2019
1 parent e458422 commit cee0083
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions halloffame.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@
print'<div class="advancedSearchContent"></br>';
$sixMonths = time() - 15552000;

if ( $User->type['User'] && $User->points > 100 )
if ( $User->type['User'] && $User->points > 100 && $User->timeLastSessionEnded > $sixMonths)
{
list($position) = $DB->sql_row("SELECT COUNT(id)+1 FROM wD_Users WHERE points > ".$User->points." AND timeLastSessionEnded >".$sixMonths);
list($position) = $DB->sql_row("SELECT COUNT(id)+1 FROM wD_Users WHERE points > ".$User->points." AND timeLastSessionEnded > ".$sixMonths);

list($playersSixMonths) = $DB->sql_row("SELECT COUNT(1) FROM wD_Users WHERE points > 100 AND timeLastSessionEnded > ".$sixMonths);

print '<p class = "hof">'.l_t('You are ranked %s out of all players with over 100%s who have been active in the last six months.','<a href="#me" class="light">#'.$position.'</a>',libHTML::points()).
print '<p class = "hof">'.l_t('You are ranked %s out of %s players with over 100%s who have been active in the last six months','<a href="#me" class="light">#'.$position.'</a>',$playersSixMonths,libHTML::points()).
l_t('. For more stats on your ranking visit <a class="light" href="profile.php?userID='.$User->id.'">your profile</a>.').'</p>';
}

Expand Down Expand Up @@ -135,6 +137,17 @@
print' </tr>';
$i++;
}
if ( $User->type['User'] && $User->points > 100 && $User->timeLastSessionEnded > $sixMonths and $showMe == 1 )
{
print ' <tr class="hof">
<td class="hof">...</td>
<td class="hof">...</td>
</tr>';
print ' <tr class="hof">
<td class="hof"> '.number_format($User->points).' '.libHTML::points().' - <a name="me"></a>#'.$position.' </td>
<td class="hof" style="color:red;"><strong><em>'.$User->username.'</em></strong></td>
</tr>';
}

print '</table>';
print '</div>';
Expand Down

0 comments on commit cee0083

Please sign in to comment.