Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing RR table and HOF #739

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions css/darkMode/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -1461,21 +1461,27 @@ input[type=submit].gameCreate:hover {
border-collapse: collapse;
}

.rrInfo table {
overflow-x: auto;
min-width:600px;
}

.rrInfo td, .rrInfo th {
border: 1px solid #ddd;
padding: 6px;
}

.rrInfo tr:nth-child(even){background-color: #555; word-break: break-word;}
.rrInfo tr:nth-child(odd){background-color: #777; word-break: break-word;}
.rrInfo tr:nth-child(even){background-color: #555; word-break: break-word; font-size: 12px;}
.rrInfo tr:nth-child(odd){background-color: #777; word-break: break-word; font-size: 12px;}

.rrInfo th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #009902;
color: white;
min-width:70px;
font-size: 12px;
min-width: 50px;
}

.rr-profile-info {
Expand Down Expand Up @@ -2619,4 +2625,7 @@ input[id^="FinalizeButton"]{
padding: 5px;
margin-right:0px;
}
.profile_content {
overflow: auto !important;
}
}
14 changes: 12 additions & 2 deletions css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -1436,13 +1436,18 @@ input[type=submit].gameCreate:hover {
border-collapse: collapse;
}

.rrInfo table {
overflow-x: auto;
min-width:600px;
}

.rrInfo td, .rrInfo th {
border: 1px solid #ddd;
padding: 6px;
}

.rrInfo tr:nth-child(even){background-color: #f2f2f2; word-break: break-word;}
.rrInfo tr:nth-child(odd){background-color: #ffffff; word-break: break-word;}
.rrInfo tr:nth-child(even){background-color: #f2f2f2; word-break: break-word; font-size: 12px;}
.rrInfo tr:nth-child(odd){background-color: #ffffff; word-break: break-word; font-size: 12px;}

.rrInfo th {
padding-top: 12px;
Expand All @@ -1451,6 +1456,8 @@ input[type=submit].gameCreate:hover {
background-color: #009902;
color: white;
min-width:70px;
font-size: 12px;
min-width: 50px;
}

.rr-profile-info {
Expand Down Expand Up @@ -2291,4 +2298,7 @@ input[id^="FinalizeButton"]{
padding: 5px;
margin-right:0px;
}
.profile_content {
overflow: auto !important;
}
}
34 changes: 20 additions & 14 deletions halloffame.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
}

$i=1;
$crashed = $DB->sql_tabl("SELECT id, username, points FROM wD_Users order BY points DESC LIMIT 100 ");
$top100 = $DB->sql_tabl("SELECT id, username, points FROM wD_Users order BY points DESC LIMIT 100 ");

print "<TABLE class='hof'>";
print "<tr>";
Expand All @@ -54,7 +54,7 @@
print "</tr>";

$showMe = 1;
while ( list($id, $username, $points) = $DB->tabl_row($crashed) )
while ( list($id, $username, $points) = $DB->tabl_row($top100) )
{
print ' <tr class="hof">
<td class="hof"> '.number_format($points).' '.libHTML::points().' - #'.$i.' </td>';
Expand Down Expand Up @@ -99,7 +99,7 @@
}

$i=1;
$crashed = $DB->sql_tabl("SELECT id, username, points FROM wD_Users WHERE timeLastSessionEnded > ".$sixMonths." order BY points DESC LIMIT 100 ");
$top100 = $DB->sql_tabl("SELECT id, username, points FROM wD_Users WHERE timeLastSessionEnded > ".$sixMonths." order BY points DESC LIMIT 100 ");

print "<TABLE class='hof'>";
print "<tr>";
Expand All @@ -108,7 +108,7 @@
print "</tr>";

$showMe = 1;
while ( list($id, $username, $points) = $DB->tabl_row($crashed) )
while ( list($id, $username, $points) = $DB->tabl_row($top100) )
{
print ' <tr class="hof">
<td class="hof"> '.number_format($points).' '.libHTML::points().' - #'.$i.' </td>';
Expand Down Expand Up @@ -146,15 +146,20 @@

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");
list($position) = $DB->sql_row("SELECT COUNT(g.userID)+1 FROM wD_GhostRatings g
inner join wD_Users u on u.id = g.userID
WHERE g.categoryID = 0 and g.peakRating > ".$currentRating." and u.type <> 'banned' and g.userID <> ".$User->id);

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

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
$top100 = $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 ");

Expand All @@ -165,7 +170,7 @@
print "</tr>";

$showMe = 1;
while ( list($id, $username, $points) = $DB->tabl_row($crashed) )
while ( list($id, $username, $points) = $DB->tabl_row($top100) )
{
print ' <tr class="hof">
<td class="hof"> '.number_format($points).' - #'.$i.' </td>';
Expand Down Expand Up @@ -201,21 +206,22 @@

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($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." and u.type <> 'banned' and userID <> ".$User->id);

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");
WHERE categoryID = 0 and timeLastSessionEnded > ".$sixMonths." and peakRating > 100 and u.type <> 'banned'");

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
$top100 = $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 ");
where g.categoryID = 0 and timeLastSessionEnded > ".$sixMonths." and u.type <> 'banned' order BY g.peakRating DESC LIMIT 100 ");

print "<TABLE class='hof'>";
print "<tr>";
Expand All @@ -224,7 +230,7 @@
print "</tr>";

$showMe = 1;
while ( list($id, $username, $points) = $DB->tabl_row($crashed) )
while ( list($id, $username, $points) = $DB->tabl_row($top100) )
{
print ' <tr class="hof">
<td class="hof"> '.number_format($points).' - #'.$i.' </td>';
Expand Down
11 changes: 3 additions & 8 deletions userprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@
print '<div class = "profile-show">';
print '<div class = "rrInfo">';

print '<div class = "profile_title"> Reliability Rating: '.$totalRR.'%</div>';
print '<div class = "profile_title"> Reliability Rating: '.round($totalRR,2).'%</div>';
print '<div class = "profile_content">';

print '<h4>Reliability Explained:</h4>';
Expand Down Expand Up @@ -634,11 +634,9 @@
{
print '<TABLE class="rrInfo">';
print '<tr>';
print '<th class= "rrInfo">ID:</th>';
print '<th class= "rrInfo">Game:</th>';
print '<th class= "rrInfo">Country</th>';
print '<th class= "rrInfo">Turn:</th>';
print '<th class= "rrInfo">LiveGame:</th>';
print '<th class= "rrInfo">Live?:</th>';
print '<th class= "rrInfo">System Excused:</th>';
print '<th class= "rrInfo">Mod Excused:</th>';
print '<th class= "rrInfo">Same Period Excused:</th>';
Expand All @@ -650,12 +648,10 @@
if ($systemExcused == 'No' && $modExcused == 'No' && $samePeriodExcused == 'No') { print '<tr style="background-color:#F08080;">'; }
else { print '<tr>'; }

print '<td> <strong>'.$id.'</strong></td>';
if ($name != '')
{
$Variant=libVariant::loadFromGameID($gameID);
print '<td> <strong><a href="board.php?gameID='.$gameID.'">'.$name.'</a></strong></td>';
print '<td> <strong>'.$Variant->countries[$countryID-1].'</strong></td>';
print '<td> <strong>'.$Variant->turnAsDate($turn).'</strong></td>';
print '<td> <strong>'.$liveGame.'</strong></td>';
print '<td> <strong>'.$systemExcused.'</strong></td>';
Expand All @@ -665,8 +661,7 @@
}
else
{
print '<td> <strong>Cancelled Game</strong></td>';
print '<td> <strong>'.$countryID.'</strong></td>';
print '<td> <strong>Cancelled: '.$id.'</strong></td>';
print '<td> <strong>'.$turn.'</strong></td>';
print '<td> <strong>'.$liveGame.'</strong></td>';
print '<td> <strong>'.$systemExcused.'</strong></td>';
Expand Down