Skip to content

Commit

Permalink
Merge pull request kestasjk#709 from jmo1121109/updates-to-new-profile
Browse files Browse the repository at this point in the history
Updates to new profile
  • Loading branch information
jmo1121109 authored Oct 24, 2020
2 parents c7f2975 + 6fb26c7 commit 9c0231b
Show file tree
Hide file tree
Showing 9 changed files with 461 additions and 111 deletions.
30 changes: 27 additions & 3 deletions css/darkMode/desktopOnly/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ img {
border:0;
}
p.profileComment {
font-size:12px;
font-style:italic;
width:80%;
margin-left:auto;
margin-right:auto;
word-break: break-word;
}
p.newProfileComment {
font-size:12px;
font-style:italic;
width:95%;
Expand Down Expand Up @@ -264,6 +272,15 @@ p.profileComment {
padding: 0 0 0 10px;
margin-top: 3px !important;
}
.profile_content_gr {
border-radius: 7px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
overflow: hidden;
font-size: 13px;
display: show;
padding: 0 0 0 0;
margin-top: 3px !important;
}

#profile-forum-link-container {
display: flex;
Expand Down Expand Up @@ -337,7 +354,7 @@ div.profile-show-inside-left {
border-radius: 7px;
background-color: #5f6368;
padding: 5px;
min-width:35%;
min-width:30%;
margin-right:20px;
}
div.profile-show-inside {
Expand All @@ -350,7 +367,7 @@ div.profile-show-ranking {
border-radius: 7px;
background-color: #5f6368;
padding: 5px;
min-width:25%;
min-width:30%;
margin-right:20px;
}
div.rightHalf {
Expand All @@ -377,6 +394,13 @@ ul.formlist {
padding:0;
color: rgba(255, 255, 255, 0.8);
}
ul.profile {
list-style: none;
margin-left:5px;
margin-right:5px;
padding:0;
color: rgba(255, 255, 255, 0.8);
}

li {
margin-bottom:5px;
Expand Down Expand Up @@ -2393,4 +2417,4 @@ input[id^="FinalizeButton"]{
table-layout: fixed;
}

/* end of desktop mode */
/* end of desktop mode */
31 changes: 29 additions & 2 deletions css/darkMode/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ img {
border:0;
}
p.profileComment {
font-size:12px;
font-style:italic;
width:80%;
margin-left:auto;
margin-right:auto;
word-break: break-word;
}
p.newProfileComment {
font-size:12px;
font-style:italic;
width:95%;
Expand Down Expand Up @@ -264,6 +272,15 @@ p.profileComment {
padding: 0 0 0 10px;
margin-top: 3px !important;
}
.profile_content_gr {
border-radius: 7px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
overflow: hidden;
font-size: 13px;
display: show;
padding: 0 0 0 0;
margin-top: 3px !important;
}

#profile-forum-link-container {
display: flex;
Expand Down Expand Up @@ -337,7 +354,7 @@ div.profile-show-inside-left {
border-radius: 7px;
background-color: #5f6368;
padding: 5px;
min-width:35%;
min-width:30%;
margin-right:20px;
}
div.profile-show-inside {
Expand All @@ -350,7 +367,7 @@ div.profile-show-ranking {
border-radius: 7px;
background-color: #5f6368;
padding: 5px;
min-width:25%;
min-width:30%;
margin-right:20px;
}
div.rightHalf {
Expand All @@ -377,6 +394,13 @@ ul.formlist {
padding:0;
color: rgba(255, 255, 255, 0.8);
}
ul.profile {
list-style: none;
margin-left:5px;
margin-right:5px;
padding:0;
color: rgba(255, 255, 255, 0.8);
}

li {
margin-bottom:5px;
Expand Down Expand Up @@ -2480,6 +2504,9 @@ input[id^="FinalizeButton"]{
ul.formlist{
margin: 0;
}
ul.profile{
margin: 0;
}
input[type="text"], input[type="submit"], input[type="password"], textarea, select{
font-size: 16px;
width: 95%;
Expand Down
31 changes: 27 additions & 4 deletions css/desktopOnly/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ img {
border:0;
}
p.profileComment {
font-size:12px;
font-style:italic;
width:80%;
margin-left:auto;
margin-right:auto;
word-break: break-word;
}
p.newPprofileComment {
font-size:12px;
font-style:italic;
width:95%;
Expand Down Expand Up @@ -256,7 +264,15 @@ p.profileComment {
padding: 0 0 0 10px;
margin-top: 3px !important;
}

.profile_content_gr {
border-radius: 7px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
overflow: hidden;
font-size: 13px;
display: show;
padding: 0 0 0 0;
margin-top: 3px !important;
}
#profile-forum-link-container {
display: flex;
justify-content: space-around;
Expand Down Expand Up @@ -329,7 +345,7 @@ div.profile-show-inside-left {
border-radius: 7px;
background-color: #f1f1f1;
padding: 5px;
min-width:35%;
min-width:30%;
margin-right:20px;
}
div.profile-show-inside {
Expand All @@ -342,7 +358,7 @@ div.profile-show-ranking {
border-radius: 7px;
background-color: #f1f1f1;
padding: 5px;
min-width:25%;
min-width:30%;
margin-right:20px;
}
div.rightHalf {
Expand All @@ -369,6 +385,13 @@ ul.formlist {
padding:0;
}

ul.profile {
list-style: none;
margin-left:5px;
margin-right:5px;
padding:0;
}

li {
margin-bottom:5px;
}
Expand Down Expand Up @@ -2068,4 +2091,4 @@ input[id^="FinalizeButton"]{
table-layout: fixed;
}

/* end desktop only */
/* end desktop only */
32 changes: 29 additions & 3 deletions css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ img {
border:0;
}
p.profileComment {
font-size:12px;
font-style:italic;
width:80%;
margin-left:auto;
margin-right:auto;
word-break: break-word;
}
p.newProfileComment {
font-size:12px;
font-style:italic;
width:95%;
Expand Down Expand Up @@ -256,7 +264,15 @@ p.profileComment {
padding: 0 0 0 10px;
margin-top: 3px !important;
}

.profile_content_gr {
border-radius: 7px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
overflow: hidden;
font-size: 13px;
display: show;
padding: 0 0 0 0;
margin-top: 3px !important;
}
#profile-forum-link-container {
display: flex;
justify-content: space-around;
Expand Down Expand Up @@ -329,7 +345,7 @@ div.profile-show-inside-left {
border-radius: 7px;
background-color: #f1f1f1;
padding: 5px;
min-width:35%;
min-width:30%;
margin-right:20px;
}
div.profile-show-inside {
Expand All @@ -342,7 +358,7 @@ div.profile-show-ranking {
border-radius: 7px;
background-color: #f1f1f1;
padding: 5px;
min-width:25%;
min-width:30%;
margin-right:20px;
}
div.rightHalf {
Expand All @@ -369,6 +385,13 @@ ul.formlist {
padding:0;
}

ul.profile {
list-style: none;
margin-left:5px;
margin-right:5px;
padding:0;
}

li {
margin-bottom:5px;
}
Expand Down Expand Up @@ -2154,6 +2177,9 @@ input[id^="FinalizeButton"]{
ul.formlist{
margin: 0;
}
ul.profile{
margin: 0;
}
input[type="text"], input[type="submit"], input[type="password"], textarea, select{
font-size: 16px;
width: 95%;
Expand Down
2 changes: 1 addition & 1 deletion global/definitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

//Increment these versions whenever you update any js or css files for cachebusting
define("JSVERSION",1.6);
define("CSSVERSION",1.35);
define("CSSVERSION",1.36);

if( !defined('FACEBOOK') )
define('FACEBOOK',false);
Expand Down
2 changes: 2 additions & 0 deletions lib/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,13 +841,15 @@ static public function pages()
$links['tournamentRegistration.php']=array('name'=>'Tournament Registration', 'inmenu'=>FALSE);
$links['botgamecreate.php']=array('name'=>'New Bot Game', 'inmenu'=>TRUE, 'title'=>"Start up a new bot game");


if ( is_object($User) )
{
if ( $User->type['Admin'] or $User->type['Moderator'] )
{
$links['profile.php']=array('name'=>'Find user', 'inmenu'=>true); // Overrides the previous one with one that appears in the menu
$links['admincp.php']=array('name'=>'Admin CP', 'inmenu'=>true);
$links['userprofile.php']=array('name'=>'ProfileNew', 'inmenu'=>FALSE);
$links['search.php']=array('name'=>'Find user 2.0', 'inmenu'=>FALSE); // Overrides the previous one with one that appears in the menu
}
$links['gamemaster.php']=array('name'=>'GameMaster', 'inmenu'=>FALSE);
}
Expand Down
49 changes: 48 additions & 1 deletion objects/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,6 @@ public function getLikeMessages()

public function likeMessageToggleLink($messageID, $fromUserID=-1)
{

if( $this->type['User'] && $this->id != $fromUserID && !in_array($messageID, $this->getLikeMessages()))
return '<a id="likeMessageToggleLink'.$messageID.'"
href="#" title="'.l_t('Give a mark of approval for this post').'" class="light likeMessageToggleLink" '.
Expand Down Expand Up @@ -1361,5 +1360,53 @@ public function modLastCheckedBy()

return $modLastCheckedBy;
}

/*
* Get the GR category, rating, peak, and position for a given user for all categories.
*/
public function getCurrentGRByCategory()
{
global $DB;
$ghostRatingCategories = array();

$tabl = $DB->sql_tabl(
"SELECT g.categoryID, g.rating, g.peakRating,
(select count(1)+1 from wD_GhostRatings g1 where g1.categoryID = g.categoryID and g1.rating > g.rating) as position
FROM wD_GhostRatings g WHERE g.userID = ".$this->id
);

while ( list($categoryID, $rating, $peakRating, $position) = $DB->tabl_row($tabl) )
{
$categoryName = Config::$grCategories[$categoryID]["name"];

$ghostRatingCategories[$categoryName]['Rating'] = $rating;
$ghostRatingCategories[$categoryName]['Peak'] = $peakRating;
$ghostRatingCategories[$categoryName]['Position'] = $position;
}

return $ghostRatingCategories;
}

/*
* Get the GR category, rating, peak, and position for a given user for all categories.
*/
public function getGRTrending($categoryID, $limit)
{
global $DB;
$ghostRatingTrends = array();

$tabl = $DB->sql_tabl(
"SELECT concat(LEFT(g.yearMonth,4), '-', RIGHT(g.yearMonth,2)) as timePeriod, g.rating
FROM wD_GhostRatingsHistory g WHERE g.userID = ".$this->id. " and g.categoryID = ".(int)$categoryID." order by g.yearMonth desc limit ".(int)$limit
);

while ( list($timePeriod, $rating) = $DB->tabl_row($tabl) )
{
$ghostRatingTrends[$timePeriod] = $rating;
}

$reversed = array_reverse($ghostRatingTrends);
return $reversed;
}
}
?>
Loading

0 comments on commit 9c0231b

Please sign in to comment.