Skip to content

Commit

Permalink
Removed ghostrating related sections from HoF
Browse files Browse the repository at this point in the history
  • Loading branch information
diptobi1 committed Nov 22, 2021
1 parent d4ff304 commit 4c4e4d6
Showing 1 changed file with 0 additions and 116 deletions.
116 changes: 0 additions & 116 deletions halloffame.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,122 +137,6 @@
</tr>';
}

print '</table>';
print '</div></br></br>';

// Ghost Rating section
print '<button class="SearchCollapsible">Overall Peak Ghost Rating</button>';
print'<div class="advancedSearchContent">';

$currentRating = 0;
list ($currentRating) = $DB->sql_row("SELECT peakRating FROM wD_GhostRatings WHERE categoryID = 0 and userID = ".$User->id);

if ( $User->type['User'] && $currentRating > 0 )
{
list($position) = $DB->sql_row("SELECT COUNT(userID)+1 FROM wD_GhostRatings WHERE categoryID = 0 and peakRating > ".$currentRating);
list($players) = $DB->sql_row("SELECT COUNT(1) FROM wD_GhostRatings WHERE categoryID = 0 and peakRating > 100");

print '<p class = "hof">'.l_t('You are ranked <a href="#me" class="light">#'.$position.'</a> out of '.$players.' players with an overall GR of over 100').
l_t('. For more stats on your ranking, visit <a class="light" href="userprofile.php?userID='.$User->id.'">your profile</a>.').'</p>';
}

$i=1;
$crashed = $DB->sql_tabl("SELECT u.id, u.username, g.peakRating as 'points' FROM wD_GhostRatings g
inner join wD_Users u on g.userID = u.id
where g.categoryID = 0 order BY g.peakRating DESC LIMIT 100 ");

print "<TABLE class='hof'>";
print "<tr>";
print '<th class= "hof">Ghost Rating/Rank</th>';
print '<th class= "hof">User</th>';
print "</tr>";

$showMe = 1;
while ( list($id, $username, $points) = $DB->tabl_row($crashed) )
{
print ' <tr class="hof">
<td class="hof"> '.number_format($points).' - #'.$i.' </td>';
if ($User->username == $username)
{
print '<td class="hof"><a class="hof-self" href="userprofile.php?userID='.$id.'">'.$username.'</a></td> ';
$showMe = 0;
}
else
{
print '<td class="hof"><a href="userprofile.php?userID='.$id.'">'.$username.'</a></td> ';
}
print' </tr>';
$i++;
}

if ( $User->type['User'] && $currentRating > 100 && $showMe == 1 )
{
print ' <tr class="hof"> <td class="hof">...</td> <td class="hof">...</td> </tr>';
print ' <tr class="hof">
<td class="hof"> '.number_format($currentRating).' - <a name="me"></a>#'.$position.' </td>
<td class="hof hof-self"><strong><em>'.$User->username.'</em></strong></td>
</tr>';
}

print '</table>';
print '</div></br></br>';

// Active GR section
print '<button class="SearchCollapsible">Overall Peak Ghost Rating (Last 6 Months)</button>';
print'<div class="advancedSearchContent"></br>';
$sixMonths = time() - 15552000;

if ( $User->type['User'] && $currentRating > 100 && $User->timeLastSessionEnded > $sixMonths)
{
list($position) = $DB->sql_row("SELECT COUNT(userID)+1 FROM wD_GhostRatings g inner join wD_Users u on u.id = g.userID
WHERE categoryID = 0 and timeLastSessionEnded > ".$sixMonths." and peakRating > ".$currentRating);

list($players) = $DB->sql_row("SELECT COUNT(1) FROM wD_GhostRatings g inner join wD_Users u on u.id = g.userID
WHERE categoryID = 0 and timeLastSessionEnded > ".$sixMonths." and peakRating > 100");

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

$i=1;

$crashed = $DB->sql_tabl("SELECT u.id, u.username, g.peakRating as 'points' FROM wD_GhostRatings g
inner join wD_Users u on g.userID = u.id
where g.categoryID = 0 and timeLastSessionEnded > ".$sixMonths." order BY g.peakRating DESC LIMIT 100 ");

print "<TABLE class='hof'>";
print "<tr>";
print '<th class= "hof">Ghost Rating/Rank</th>';
print '<th class= "hof">User</th>';
print "</tr>";

$showMe = 1;
while ( list($id, $username, $points) = $DB->tabl_row($crashed) )
{
print ' <tr class="hof">
<td class="hof"> '.number_format($points).' - #'.$i.' </td>';
if ($User->username == $username)
{
print '<td class="hof"><a class="hof-self" href="userprofile.php?userID='.$id.'">'.$username.'</a></td> ';
$showMe = 0;
}
else
{
print '<td class="hof"><a href="userprofile.php?userID='.$id.'">'.$username.'</a></td> ';
}
print' </tr>';
$i++;
}

if ( $User->type['User'] && $currentRating > 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($currentRating).' - <a name="me"></a>#'.$position.' </td>
<td class="hof hof-self"><strong><em>'.$User->username.'</em></strong></td>
</tr>';
}

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

Expand Down

0 comments on commit 4c4e4d6

Please sign in to comment.