- Changes to user account viewing screen

- Links properly redirect (assuming they've been set properly)
This commit is contained in:
Taylor Courage 2025-03-08 08:20:48 -05:00
parent 491c34cc93
commit 872cd022ad
6 changed files with 49 additions and 10 deletions

View File

@ -195,7 +195,7 @@ session_start();
</div>
<div class="dateSelector">
<select size="1" name="month" id="month" onchange="refreshDisplay()">
<option value="all">All</option>
<option value="all">All</option> <!-- all option -->
<?php
// Automatically write the months using a script
// Also automatically selects the current month
@ -211,7 +211,7 @@ session_start();
?>
</select>
<select size="1" name="year" id="year" onchange="refreshDisplay()">
<option value="all">All</option>
<option value="all">All</option> <!-- all option -->
<?php
// This uses the years we grabbed earlier and ensures we're only showing
// the years we have entries for

View File

@ -22,4 +22,21 @@ function verifyPageInFrame() {
} else {
window.location = mainURL;
}
}
function redirect(location, address) {
switch (location) {
case "twitch":
var link = "https://twitch.tv/" + address;
break;
case "discord":
var link = "https://discordapp.com/users/" + address;
break;
case "youtube":
var link = address;
break;
}
window.open(link).focus();
}

View File

@ -1,3 +1,5 @@
/*
#generalBody {
width: 400px;
margin: 0;
@ -17,7 +19,6 @@
padding-bottom: 15px;
flex-grow: 1;
flex-shrink: 1;
/*box-shadow: 0px 5px 10px;*/
}
#informationContentPanel h4,h5 {
@ -83,4 +84,6 @@
.divTableRightColumn {
text-align: center;
}
}
*/

View File

@ -85,6 +85,7 @@
#editUserDetails input[type="text"] {
text-align: right;
width: 100%;
}
#editUserDetails input[type="text"]::placeholder {
@ -262,3 +263,11 @@
font-size: 90%;
}
.accountDetailsRightSide a {
text-decoration: none;
color: blue;
}
.accountDetailsRightSide a:hover {
color: rgb(30, 90, 255);;
}

View File

@ -61,6 +61,7 @@ try { // Try opening the SQL database connection
<link rel="stylesheet" href="/styles/data.css" />
<link rel="stylesheet" href="/styles/user_management.css" />
<link rel="stylesheet" href="/styles/db_management.css" />
<script src="/scripts/tools.js"></script>
<title>User Account Management</title>
</head>
@ -72,7 +73,7 @@ try { // Try opening the SQL database connection
<p class="detailsBold">Username:</p>
<p class="detailsBold">Date Joined:</p>
<p class="detailsBold">Total trophies:</p>
<p>&nbsp;By division:</p>
<p>&nbsp;By division</p>
<p>&nbsp;&nbsp;&nbsp;Open:</p>
<p>&nbsp;&nbsp;&nbsp;Intermediate:</p>
<p>&nbsp;&nbsp;&nbsp;Main:</p>
@ -100,9 +101,9 @@ try { // Try opening the SQL database connection
<p>YouTube (name):</p>
<p>YouTube (link):</p>
<p>Discord (name):</p>
<p>Discord (link):</p>
<p>Discord (UserID):</p>
<p>&nbsp;</p>
<p><a href=\"/admin/user_management/change_password.php\" id=\"changePasswordButton\" class=\"disabled\">Change Password</a></p>
<p><a href=\"/admin/user_management/change_password.php\" id=\"changePasswordButton\" style=\"text-align:center;\" class=\"disabled\">Change Password</a></p>
<p>(coming soon!)</p>
</div>
<div class=\"accountDetailsRightSide\">
@ -138,14 +139,14 @@ try { // Try opening the SQL database connection
<div class=\"accountDetailsRightSide\">
");
if (isset($userDetails["twitch"]) && $userDetails["twitch"] != "") {
echo ("<p><a href=\"https://twitch.tv/\"" . $userDetails["twitch"] . "> " . $userDetails["twitch"] . "</a></p>");
echo ("<p><a href=\"#\" id=\"twitchURL\" onclick=\"redirect('twitch', '" . $userDetails["twitch"] . "')\">" . $userDetails["twitch"] . "</a></p>");
} else {
echo ("<p>none</p>");
}
if (isset($userDetails["youtube"]) && $userDetails["youtube"] != "") {
if (isset($userDetails["youtubeLink"]) && $userDetails["youtubeLink"] != "") {
echo ("<p><a href=" . $userDetails["youtubeLink"] . "> " . $userDetails["youtube"] . "</a></p>");
echo ("<p><a href=\"#\" id=\"youtubeURL\" onclick=\"redirect('youtube', '" . $userDetails["youtubeLink"] . "')\">" . $userDetails["youtube"] . "</a></p>");
} else {
echo ("<p>" . $userDetails["youtube"] . "</a></p>");
}
@ -155,7 +156,7 @@ try { // Try opening the SQL database connection
if (isset($userDetails["discord"]) && $userDetails["discord"] != "") {
if (isset($userDetails["discordLink"]) && $userDetails["discordLink"] != "") {
echo ("<p><a href=" . $userDetails["discordLink"] . "> " . $userDetails["discord"] . "</a></p>");
echo ("<a href=\"#\" id=\"discordURL\" onclick=\"redirect('discord', '" . $userDetails["discordLink"] . "')\"> " . $userDetails["discord"] . "</a></p>");
} else {
echo ("<p>" . $userDetails["discord"] . "</a></p>");
}

View File

@ -65,8 +65,17 @@ try { // Try opening the SQL database connection
}
?>
<a href="../" class="subNavLink" id="mainHomeButton">HOME</a>
<?php
// If we're showing someone other than who's logged in, offer a link to their own page
if (isset($_SESSION["userID"]) && $_SESSION["username"] != $_GET["username"]){
echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">MY ACCOUNT</a>";
}
?>
<p class="newLine"></p>
<?php
// If someone is logged in, give them the opportunity to log out
if (isset($_SESSION["userID"])){
echo "<a href=\"../logout.php?redirect=\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>";
}