Skip to content

Commit

Permalink
Final Changes For New Profile
Browse files Browse the repository at this point in the history
Replacing the links to the old profile throughout the site.
  • Loading branch information
jmo1121109 committed Nov 1, 2020
1 parent 9c0231b commit 6efeb01
Show file tree
Hide file tree
Showing 19 changed files with 361 additions and 194 deletions.
2 changes: 1 addition & 1 deletion admin/adminAdvancedAccessLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class UserData
{
if (($checkIPs=='checked' and $values->IPCount > 0) or ($chCookies=='checked' and $values->CookieCount > 0))
{
print '<TR><TD class= "modTools"><a href="profile.php?userID='.$values->userID.'">'.$values->username.'</a></TD>';
print '<TR><TD class= "modTools"><a href="userprofile.php?userID='.$values->userID.'">'.$values->username.'</a></TD>';
print '<TD class= "modTools">'.$values->email.'</TD>';
print '<TD class= "modTools">'.gmstrftime("%d %b / %I:%M %p",$values->timeJoined).'</TD>';

Expand Down
4 changes: 2 additions & 2 deletions admin/adminMultiFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public function findbUserIDs()
*/
public function printCheckSummary()
{
print '<p>'.l_t('Checking %s %s %s (userID=%s)','<a href="profile.php?userID='.$this->aUserID.'">'.$this->aUser->username.'</a>',
print '<p>'.l_t('Checking %s %s %s (userID=%s)','<a href="userprofile.php?userID='.$this->aUserID.'">'.$this->aUser->username.'</a>',
'('.$this->aUser->points.' '.libHTML::points().')',
'RR: '.$this->aUser->reliabilityRating,$this->aUserID)
.($this->aUser->type['Banned'] ? '<img src="'.l_s('images/icons/cross.png').'" alt="X" title="'.l_t('Banned').'" />' : '').'
Expand Down Expand Up @@ -697,7 +697,7 @@ public function compare(User $bUser)
global $DB;

print '<ul>';
print '<li><a href="profile.php?userID='.$bUser->id.'">'.$bUser->username.'</a> ('.$bUser->points.' '.libHTML::points().')
print '<li><a href="userprofile.php?userID='.$bUser->id.'">'.$bUser->username.'</a> ('.$bUser->points.' '.libHTML::points().')
'.($bUser->type['Banned'] ? '<img src="'.l_s('images/icons/cross.png').'" alt="X" title="'.l_t('Banned').'" />' : '').'
RR: '.$bUser->reliabilityRating.'
(<a href="?aUserID='.$bUser->id.'#viewMultiFinder" class="light">'.l_t('check userID=%s',$bUser->id).'</a>)
Expand Down
14 changes: 7 additions & 7 deletions admin/adminStatusLists.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,19 @@ function adminStatusList($name, $query)
//require_once('gamemaster/game.php');
//adminStatusTable('Backed up games',processGame::backedUpGames());

adminStatusList(l_t('Mods'),"SELECT CONCAT('<a href=\"profile.php?userID=',id,'\" class=\"light\">',username,'</a>') FROM wD_Users WHERE type LIKE '%Moderator%'");
adminStatusList(l_t('Senior Mods'),"SELECT CONCAT('<a href=\"profile.php?userID=',id,'\" class=\"light\">',username,'</a>') FROM wD_Users WHERE type LIKE '%SeniorMod%'");
adminStatusList(l_t('Admins'),"SELECT CONCAT('<a href=\"profile.php?userID=',id,'\" class=\"light\">',username,'</a>') FROM wD_Users WHERE type LIKE '%Admin%'");
adminStatusList(l_t('Temp Banned - By Mod'),"SELECT CONCAT('<a href=\"profile.php?userID=',id,'\" class=\"light\">',username,'</a>')
adminStatusList(l_t('Mods'),"SELECT CONCAT('<a href=\"userprofile.php?userID=',id,'\" class=\"light\">',username,'</a>') FROM wD_Users WHERE type LIKE '%Moderator%'");
adminStatusList(l_t('Senior Mods'),"SELECT CONCAT('<a href=\"userprofile.php?userID=',id,'\" class=\"light\">',username,'</a>') FROM wD_Users WHERE type LIKE '%SeniorMod%'");
adminStatusList(l_t('Admins'),"SELECT CONCAT('<a href=\"userprofile.php?userID=',id,'\" class=\"light\">',username,'</a>') FROM wD_Users WHERE type LIKE '%Admin%'");
adminStatusList(l_t('Temp Banned - By Mod'),"SELECT CONCAT('<a href=\"userprofile.php?userID=',id,'\" class=\"light\">',username,'</a>')
FROM wD_Users WHERE tempBanReason is not null and tempBanReason <> 'System' and tempBan > ".time());

adminStatusList(l_t('Temp Banned - By System'),"SELECT CONCAT('<a href=\"profile.php?userID=',id,'\" class=\"light\">',username,'</a>')
adminStatusList(l_t('Temp Banned - By System'),"SELECT CONCAT('<a href=\"userprofile.php?userID=',id,'\" class=\"light\">',username,'</a>')
FROM wD_Users WHERE (tempBanReason is null or tempBanReason = 'System') and tempBan > ".time());

adminStatusList(l_t('Donors'),"SELECT CONCAT('<a href=\"profile.php?userID=',id,'\" class=\"light\">',username,'</a>')
adminStatusList(l_t('Donors'),"SELECT CONCAT('<a href=\"userprofile.php?userID=',id,'\" class=\"light\">',username,'</a>')
FROM wD_Users WHERE type LIKE '%Donator%'".(isset($_REQUEST['full'])?'':"LIMIT 50"));

adminStatusList(l_t('Banned users'),"SELECT CONCAT('<a href=\"profile.php?userID=',id,'\" class=\"light\">',username,'</a>')
adminStatusList(l_t('Banned users'),"SELECT CONCAT('<a href=\"userprofile.php?userID=',id,'\" class=\"light\">',username,'</a>')
FROM wD_Users WHERE type LIKE '%Banned%'".(isset($_REQUEST['full'])?'':"LIMIT 50"));

list($notice) = $DB->sql_row("SELECT message FROM wD_Config WHERE name = 'Notice'");
Expand Down
4 changes: 2 additions & 2 deletions contactUsDirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class GameResultData
{
$Mailer->Send(array($email=>$email), $subject.' '.$User->username,
"
This request is from <a href='https://www.webdiplomacy.net/profile.php?userID=".$User->id."' class = 'contactUs'>".$User->username."</a>,
This request is from <a href='https://www.webdiplomacy.net/userprofile.php?userID=".$User->id."' class = 'contactUs'>".$User->username."</a>,
and their registered email is: ".$User->email."<br><br>
<strong>An emergency pause was used because of ".$actualProblem."</strong>
Expand Down Expand Up @@ -331,7 +331,7 @@ class GameResultData
{
$Mailer->Send(array($email=>$email), $subject.' '.$User->username,
"
This request is from <a href='https://www.webdiplomacy.net/profile.php?userID=".$User->id."' class = 'contactUs'>".$User->username."</a>,
This request is from <a href='https://www.webdiplomacy.net/userprofile.php?userID=".$User->id."' class = 'contactUs'>".$User->username."</a>,
and their registered email is: ".$User->email."<br><br>
<strong>The user called out ".$userPickedGame. ".</strong><br><br>
Expand Down
8 changes: 4 additions & 4 deletions detailedSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class GameResultData
print "</tr>";
foreach ($UsersData as $values)
{
print '<TR><TD class= "advancedSearch"><a href="profile.php?userID='.$values->userID.'">'.$values->userID.'</a>';
print '<TR><TD class= "advancedSearch"><a href="userprofile.php?userID='.$values->userID.'">'.$values->userID.'</a>';

// Print the mod or banned icons if the user is one or the other.
if ($values->mod)
Expand Down Expand Up @@ -939,9 +939,9 @@ class GameResultData
{
$sql = $sql." and ((select count(1) from wD_Members m where m.userID = ".$User->id." and m.gameID = g.id ) > 0) ";
$sqlCounter = $sqlCounter." and ((select count(1) from wD_Members m where m.userID = ".$User->id." and m.gameID = g.id ) > 0) ";
$userMessage = "Showing <a href='profile.php?userID=".$paramUserID."'>".$checkedUsername."'s</a> completed games against me.</p>";
$userMessage = "Showing <a href='userprofile.php?userID=".$paramUserID."'>".$checkedUsername."'s</a> completed games against me.</p>";
}
else { $userMessage = "Showing <a href='profile.php?userID=".$paramUserID."'>".$checkedUsername."'s</a> completed games.</p>";}
else { $userMessage = "Showing <a href='userprofile.php?userID=".$paramUserID."'>".$checkedUsername."'s</a> completed games.</p>";}

if ($showOnlyJoinable == 'checked')
{
Expand Down Expand Up @@ -1146,7 +1146,7 @@ function printGameResults($seeVariant, $seeGamename, $seeGameOver, $seePot, $see

if ($seeDirector=='checked')
{
if ($values->directorUserID) { print '<TD class= "advancedSearch"><a href="profile.php?userID='.$values->directorUserID.'">'.$values->directorUserID.'</a></TD>'; }
if ($values->directorUserID) { print '<TD class= "advancedSearch"><a href="userprofile.php?userID='.$values->directorUserID.'">'.$values->directorUserID.'</a></TD>'; }
else { print '<TD class= "advancedSearch">N/A</TD>'; }
}
if ($seeMinRR=='checked') { print '<TD class= "advancedSearch">'.$values->minimumRR.'</TD>'; }
Expand Down
4 changes: 2 additions & 2 deletions gamepanel/member.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function memberName()
if ($this->isNameHidden())
return '('.l_t('Anonymous').')';
else
return '<a href="profile.php?userID='.$this->userID.'">'.$this->username.'</a>
return '<a href="userprofile.php?userID='.$this->userID.'">'.$this->username.'</a>
'.'
<span class="points">('.$this->points.libHTML::points().User::typeIcon($this->userType).')</span>'
.(defined('AdminUserSwitch') ? ' (<a href="board.php?gameID='.$this->gameID.'&auid='.$this->userID.'" class="light">+</a>)':'');
Expand All @@ -245,7 +245,7 @@ function memberNameCountry()
if ( $this->isNameHidden() )
$buf .= '<span class="country'.$this->countryID.'">'.l_t($this->country).'</span>';
else
$buf .= '<a class="country'.$this->countryID.'" href="profile.php?userID='.$this->userID.'">'.$this->username.'</a>';
$buf .= '<a class="country'.$this->countryID.'" href="userprofile.php?userID='.$this->userID.'">'.$this->username.'</a>';

$buf .= '</span>';

Expand Down
2 changes: 1 addition & 1 deletion gamepanel/members.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function membersList()
foreach ($this->Game->civilDisorderInfo as $userID => $CD)
{
$cdUser = new User($userID);
$extras .= '<tr class="member memberAlternate1"><td class="memberLeftSide" style="white-space: nowrap;"><span><a href="profile.php?userID='.$userID .'">'.$cdUser->username.'</a>'.
$extras .= '<tr class="member memberAlternate1"><td class="memberLeftSide" style="white-space: nowrap;"><span><a href="userprofile.php?userID='.$userID .'">'.$cdUser->username.'</a>'.
' <span class="points">('.$cdUser->points.libHTML::points().User::typeIcon($cdUser->type).')'
.(defined('AdminUserSwitch') ? ' (<a href="board.php?gameID='.$this->Game->id.'&auid='.$cdUser->id.'" class="light">+</a>)':'') .
'</span></span></td><td class="memberRightSide">';
Expand Down
157 changes: 130 additions & 27 deletions halloffame.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,19 @@

libHTML::starthtml();

print libHTML::pageTitle(l_t('Hall of fame'),l_t('The webDiplomacy hall of fame; the 100 highest ranking players on this server.'));
print libHTML::pageTitle(l_t('Hall of fame'),l_t('The webDiplomacy hall of fame, the 100 highest ranking players on the site.'));

print '<p align="center"><img src="'.l_s('images/points/stack.png').'" alt=" " title="'.l_t('webDiplomacy points').'" /></p>';

print '<p></p>';

print '<button class="SearchCollapsible">All Time</button>';

print '<button class="SearchCollapsible">All Time Points</button>';
print'<div class="advancedSearchContent">';

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

$players = $Misc->RankingPlayers;

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

$i=1;
Expand All @@ -65,37 +60,32 @@
<td class="hof"> '.number_format($points).' '.libHTML::points().' - #'.$i.' </td>';
if ($User->username == $username)
{
print '<td class="hof"><a class="hof-self" href="profile.php?userID='.$id.'">'.$username.'</a></td> ';
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="profile.php?userID='.$id.'">'.$username.'</a></td> ';
print '<td class="hof"><a href="userprofile.php?userID='.$id.'">'.$username.'</a></td> ';
}
print' </tr>';
$i++;
}

if ( $User->type['User'] && $User->points > 100 and $showMe == 1 )
if ( $User->type['User'] && $User->points > 100 && $showMe == 1 )
{
print ' <tr class="hof">
<td class="hof">...</td>
<td class="hof">...</td>
</tr>';
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 hof-self"><strong><em>'.$User->username.'</em></strong></td>
</tr>';
}

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

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

print '<button class="SearchCollapsible">Active (Last 6 Months)</button>';

print '<button class="SearchCollapsible">All Time Points (Last 6 Months)</button>';
print'<div class="advancedSearchContent"></br>';

$sixMonths = time() - 15552000;

if ( $User->type['User'] && $User->points > 100 && $User->timeLastSessionEnded > $sixMonths)
Expand All @@ -105,11 +95,10 @@
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 %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>';
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 id, username, points FROM wD_Users WHERE timeLastSessionEnded > ".$sixMonths." order BY points DESC LIMIT 100 ");

print "<TABLE class='hof'>";
Expand All @@ -125,31 +114,145 @@
<td class="hof"> '.number_format($points).' '.libHTML::points().' - #'.$i.' </td>';
if ($User->username == $username)
{
print '<td class="hof"><a class="hof-self" href="profile.php?userID='.$id.'">'.$username.'</a></td> ';
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="profile.php?userID='.$id.'">'.$username.'</a></td> ';
print '<td class="hof"><a href="userprofile.php?userID='.$id.'">'.$username.'</a></td> ';
}
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">...</td>
<td class="hof">...</td>
<td class="hof"> '.number_format($User->points).' '.libHTML::points().' - <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>';

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

$currentRating = 0;
list ($currentRating) = $DB->sql_row("SELECT rating 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 rating > ".$currentRating);
list($players) = $DB->sql_row("SELECT COUNT(1) FROM wD_GhostRatings WHERE categoryID = 0 and rating > 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.rating as 'points' FROM wD_GhostRatings g
inner join wD_Users u on g.userID = u.id
where g.categoryID = 0 order BY g.rating 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($User->points).' '.libHTML::points().' - <a name="me"></a>#'.$position.' </td>
<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 rating > ".$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 rating > 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.rating 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>';

print '</div>';
?>

Expand Down
Loading

0 comments on commit 6efeb01

Please sign in to comment.