From 69ef9fa67cab45fa1a461381274a9c76d6cc8548 Mon Sep 17 00:00:00 2001 From: Taylor Courage Date: Sat, 8 Mar 2025 16:25:21 -0500 Subject: [PATCH] Changed userlist in divisions to be links to player profiles, if they exist Made a change so not-found users are displayed as such Changed the title of the user account page to reflect the account we're looking at, and whether or not it's our own --- display/division_results.php | 2 +- scripts/tools.js | 16 +-- styles/data_display.css | 1 + styles/primary.css | 9 ++ styles/user_management.css | 9 ++ user/account.php | 203 ++++++++++++++++++----------------- user/user.php | 26 +++-- 7 files changed, 153 insertions(+), 113 deletions(-) diff --git a/display/division_results.php b/display/division_results.php index 4fc5395..b8d1832 100644 --- a/display/division_results.php +++ b/display/division_results.php @@ -104,7 +104,7 @@ try { // Try opening the SQL database connection if (isset($names[$i])) { $name = $names[$i]; $numWins = $wins[$i]; - echo "

$name

"; + echo "

$name

"; echo "

$numWins

"; $contentLatch = 1; } diff --git a/scripts/tools.js b/scripts/tools.js index 8b214bd..6f31008 100644 --- a/scripts/tools.js +++ b/scripts/tools.js @@ -25,17 +25,21 @@ function verifyPageInFrame() { } function redirect(location, address) { - + // Open a new tab/window with the selected link + // Formats the link based on inputted data switch (location) { case "twitch": var link = "https://twitch.tv/" + address; - break; + window.open(link).focus(); + break; case "discord": var link = "https://discordapp.com/users/" + address; - break; + window.open(link).focus(); + break; + case "this": + window.top.location.href = address; + break; default: - var link = address; + window.open(address).focus(); } - - window.open(link).focus(); } \ No newline at end of file diff --git a/styles/data_display.css b/styles/data_display.css index b47bfa0..1507fcb 100644 --- a/styles/data_display.css +++ b/styles/data_display.css @@ -136,6 +136,7 @@ .divisionResultsTableLeft { text-align: left; width: 80%; + cursor: pointer; } .divisionResultsTableRight { diff --git a/styles/primary.css b/styles/primary.css index e28918e..39e3654 100644 --- a/styles/primary.css +++ b/styles/primary.css @@ -328,6 +328,15 @@ For all the things at the bottom of the page; log in/out, 'my account', etc. color: rgb(30, 90, 255);; } +.plainLinkBlack { + text-decoration: none; + color: rgb(0, 0, 0); +} + +.plainLinkBlack:hover { + color: rgb(60, 60, 60); +} + diff --git a/styles/user_management.css b/styles/user_management.css index 35404ff..3dc5601 100644 --- a/styles/user_management.css +++ b/styles/user_management.css @@ -92,6 +92,11 @@ text-align: right; } +#accountDetailsTitlePanel { + text-align: center; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 1.1em; +} .accountUpdateButton input[type="submit"] { margin: auto; @@ -261,4 +266,8 @@ visibility: hidden; height: 0px; font-size: 90%; +} + +.noUser { + text-align: center; } \ No newline at end of file diff --git a/user/account.php b/user/account.php index 11b185b..ee5d8ee 100644 --- a/user/account.php +++ b/user/account.php @@ -65,112 +65,123 @@ try { // Try opening the SQL database connection User Account Management - -
-

Info

-

-
-

Username:

-

Date Joined:

-

Total trophies:

-

 By division

-

   Open:

-

   Intermediate:

-

   Main:

-

 

-
-
-

-

format('F j, Y'); ?>

-

-

 

-

-

-

-

 

-
+ +
+ My Account"; + } else { + echo "

$username's Account

"; + } + ?>
- -

Edit

-

-
-

Twitch (name):

-

YouTube (name):

-

YouTube (link):

-

Discord (name):

-

Discord (UserID):

-

 

-

Change Password

-

(coming soon!)

-
-
-
-

-

-

-

-

+

 

+
+
+

Info

+

+
+

Username:

+

Date Joined:

+

Total trophies:

+

 By division

+

   Open:

+

   Intermediate:

+

   Main:

+

 

+
+
+

+

format('F j, Y'); ?>

+

+

 

+

+

+

+

 

+
+
+ +

Edit

+

+
+

Twitch (name):

+

YouTube (name):

+

YouTube (link):

+

Discord (name):

+

Discord (UserID):

 

-
- -
- +

Change Password

+

(coming soon!)

+
+
+
+

+

+

+

+

+

 

+
+ +
+
+
-
- "); - } else { - echo (" -
-

Socials

-

-
-

Twitch:

-

YouTube:

-

Discord:

-

 

-

 

-

 

-

 

-

 

-
-
- "); - if (isset($userDetails["twitch"]) && $userDetails["twitch"] != "") { - echo ("

" . $userDetails["twitch"] . "

"); + "); } else { - echo ("

none

"); - } - - if (isset($userDetails["youtube"]) && $userDetails["youtube"] != "") { - if (isset($userDetails["youtubeLink"]) && $userDetails["youtubeLink"] != "") { - echo ("

" . $userDetails["youtube"] . "

"); + echo (" +
+

Socials

+

+
+

Twitch:

+

YouTube:

+

Discord:

+

 

+

 

+

 

+

 

+

 

+
+
+ "); + if (isset($userDetails["twitch"]) && $userDetails["twitch"] != "") { + echo ("

" . $userDetails["twitch"] . "

"); } else { - echo ("

" . $userDetails["youtube"] . "

"); + echo ("

none

"); } - } else { - echo ("

none

"); - } - if (isset($userDetails["discord"]) && $userDetails["discord"] != "") { - if (isset($userDetails["discordLink"]) && $userDetails["discordLink"] != "") { - echo (" " . $userDetails["discord"] . "

"); + if (isset($userDetails["youtube"]) && $userDetails["youtube"] != "") { + if (isset($userDetails["youtubeLink"]) && $userDetails["youtubeLink"] != "") { + echo ("

" . $userDetails["youtube"] . "

"); + } else { + echo ("

" . $userDetails["youtube"] . "

"); + } } else { - echo ("

" . $userDetails["discord"] . "

"); + echo ("

none

"); } - } else { - echo ("

none

"); - } - - echo (" + if (isset($userDetails["discord"]) && $userDetails["discord"] != "") { + if (isset($userDetails["discordLink"]) && $userDetails["discordLink"] != "") { + echo (" " . $userDetails["discord"] . "

"); + } else { + echo ("

" . $userDetails["discord"] . "

"); + } + } else { + echo ("

none

"); + } + + + echo (" +
-
- "); - } - ?> - + "); + } + ?> +
\ No newline at end of file diff --git a/user/user.php b/user/user.php index e86a726..2d01a2e 100644 --- a/user/user.php +++ b/user/user.php @@ -19,11 +19,13 @@ try { // Try opening the SQL database connection $results = $sqlGetUserList->fetch(); // Check if user exists - if (mb_strtolower($_GET["username"]) == mb_strtolower($results["username"])) { - $userExists = true; - } else { - $userExists = false; - + if (isset($results)) { + if (mb_strtolower($_GET["username"]) != mb_strtolower($results["username"])) { + $userExists = false; + echo "NO USER"; + } else { + $userExists = true; + } } @@ -54,21 +56,25 @@ try { // Try opening the SQL database connection

TrojanDestinyRL

-
youtube logo
-
twitch logo
-
discord logo
+
youtube logo
+
twitch logo
+
discord logo
Trojan Destiny logo

-

My Account

"); } else { - echo "

USER NO EXISTS

"; + echo "
"; + echo "

USER NOT FOUND!

"; + echo "

This person may have played some games with us, but hasn't registered an account yet.

"; + echo "

Please check back later!

"; + echo "

"; + echo "
"; } ?>