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
This commit is contained in:
parent
f128ec66c2
commit
69ef9fa67c
@ -104,7 +104,7 @@ try { // Try opening the SQL database connection
|
|||||||
if (isset($names[$i])) {
|
if (isset($names[$i])) {
|
||||||
$name = $names[$i];
|
$name = $names[$i];
|
||||||
$numWins = $wins[$i];
|
$numWins = $wins[$i];
|
||||||
echo "<p class=\"divisionResultsTableLeft\">$name</p>";
|
echo "<p class=\"divisionResultsTableLeft\"><a href=\"/user/" . $name . "\" onclick=\"redirect('this', '/user/" . $name . "')\" class=\"plainLinkBlack\">$name</a></p>";
|
||||||
echo "<p class=\"divisionResultsTableRight\">$numWins</p>";
|
echo "<p class=\"divisionResultsTableRight\">$numWins</p>";
|
||||||
$contentLatch = 1;
|
$contentLatch = 1;
|
||||||
}
|
}
|
||||||
|
@ -25,17 +25,21 @@ function verifyPageInFrame() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function redirect(location, address) {
|
function redirect(location, address) {
|
||||||
|
// Open a new tab/window with the selected link
|
||||||
|
// Formats the link based on inputted data
|
||||||
switch (location) {
|
switch (location) {
|
||||||
case "twitch":
|
case "twitch":
|
||||||
var link = "https://twitch.tv/" + address;
|
var link = "https://twitch.tv/" + address;
|
||||||
break;
|
window.open(link).focus();
|
||||||
|
break;
|
||||||
case "discord":
|
case "discord":
|
||||||
var link = "https://discordapp.com/users/" + address;
|
var link = "https://discordapp.com/users/" + address;
|
||||||
break;
|
window.open(link).focus();
|
||||||
|
break;
|
||||||
|
case "this":
|
||||||
|
window.top.location.href = address;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
var link = address;
|
window.open(address).focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
window.open(link).focus();
|
|
||||||
}
|
}
|
@ -136,6 +136,7 @@
|
|||||||
.divisionResultsTableLeft {
|
.divisionResultsTableLeft {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divisionResultsTableRight {
|
.divisionResultsTableRight {
|
||||||
|
@ -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);;
|
color: rgb(30, 90, 255);;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.plainLinkBlack {
|
||||||
|
text-decoration: none;
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.plainLinkBlack:hover {
|
||||||
|
color: rgb(60, 60, 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,6 +92,11 @@
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#accountDetailsTitlePanel {
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
font-size: 1.1em;
|
||||||
|
}
|
||||||
|
|
||||||
.accountUpdateButton input[type="submit"] {
|
.accountUpdateButton input[type="submit"] {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@ -261,4 +266,8 @@
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
height: 0px;
|
height: 0px;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noUser {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
203
user/account.php
203
user/account.php
@ -65,112 +65,123 @@ try { // Try opening the SQL database connection
|
|||||||
<title>User Account Management</title>
|
<title>User Account Management</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="accountDetailsBody">
|
<body>
|
||||||
<div id="accountDetailsPanel">
|
<div id="accountDetailsTitlePanel">
|
||||||
<h3>Info</h3>
|
<?php
|
||||||
<p class="newLine"></p>
|
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
||||||
<div class="accountDetailsLeftSide">
|
echo "<h2 id=\"adminHeader\">My Account</h2>";
|
||||||
<p class="detailsBold">Username:</p>
|
} else {
|
||||||
<p class="detailsBold">Date Joined:</p>
|
echo "<h2 id=\"adminHeader\">$username's Account</h2>";
|
||||||
<p class="detailsBold">Total trophies:</p>
|
}
|
||||||
<p> By division</p>
|
?>
|
||||||
<p> Open:</p>
|
|
||||||
<p> Intermediate:</p>
|
|
||||||
<p> Main:</p>
|
|
||||||
<p> </p>
|
|
||||||
</div>
|
|
||||||
<div class="accountDetailsRightSide">
|
|
||||||
<p><?php echo $username ?></p>
|
|
||||||
<p><?php echo $dateCreated->format('F j, Y'); ?></p>
|
|
||||||
<p><?php echo $totalWins; ?></p>
|
|
||||||
<p> </p>
|
|
||||||
<p><?php echo $openWins; ?></p>
|
|
||||||
<p><?php echo $intWins; ?></p>
|
|
||||||
<p><?php echo $mainWins; ?></p>
|
|
||||||
<p> </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<p> </p>
|
||||||
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
<div id="accountDetailsBody">
|
||||||
echo ("
|
<div id="accountDetailsPanel">
|
||||||
<div id=\"accountSocialsPanel\">
|
<h3>Info</h3>
|
||||||
<h3>Edit</h3>
|
<p class="newLine"></p>
|
||||||
<p class=\"newLine\"></p>
|
<div class="accountDetailsLeftSide">
|
||||||
<div class=\"accountDetailsLeftSide\">
|
<p class="detailsBold">Username:</p>
|
||||||
<p>Twitch (name):</p>
|
<p class="detailsBold">Date Joined:</p>
|
||||||
<p>YouTube (name):</p>
|
<p class="detailsBold">Total trophies:</p>
|
||||||
<p>YouTube (link):</p>
|
<p> By division</p>
|
||||||
<p>Discord (name):</p>
|
<p> Open:</p>
|
||||||
<p>Discord (UserID):</p>
|
<p> Intermediate:</p>
|
||||||
<p> </p>
|
<p> Main:</p>
|
||||||
<p><a href=\"/admin/user_management/change_password.php\" id=\"changePasswordButton\" style=\"text-align:center;\" class=\"disabled\">Change Password</a></p>
|
<p> </p>
|
||||||
<p>(coming soon!)</p>
|
</div>
|
||||||
</div>
|
<div class="accountDetailsRightSide">
|
||||||
<div class=\"accountDetailsRightSide\">
|
<p><?php echo $username ?></p>
|
||||||
<form id=\"editUserDetails\" action=\"/admin/user_management/edit_user.php\" method=\"post\">
|
<p><?php echo $dateCreated->format('F j, Y'); ?></p>
|
||||||
<p><input type=\"text\" placeholder=\"" . $userDetails["twitch"] . "\" id=\"twitch\" name=\"twitch\"></p>
|
<p><?php echo $totalWins; ?></p>
|
||||||
<p><input type=\"text\" placeholder=\"" . $userDetails["youtube"] . "\" id=\"youtube\" name=\"youtube\"></p>
|
<p> </p>
|
||||||
<p><input type=\"text\" placeholder=\"" . $userDetails["youtubeLink"] . "\" id=\"youtubeLink\" name=\"youtubeLink\"></p>
|
<p><?php echo $openWins; ?></p>
|
||||||
<p><input type=\"text\" placeholder=\"" . $userDetails["discord"] . "\" id=\"discord\" name=\"discord\"></p>
|
<p><?php echo $intWins; ?></p>
|
||||||
<p><input type=\"text\" placeholder=\"" . $userDetails["discordLink"] . "\" id=\"discordLink\" name=\"discordLink\"></p>
|
<p><?php echo $mainWins; ?></p>
|
||||||
|
<p> </p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
||||||
|
echo ("
|
||||||
|
<div id=\"accountSocialsPanel\">
|
||||||
|
<h3>Edit</h3>
|
||||||
|
<p class=\"newLine\"></p>
|
||||||
|
<div class=\"accountDetailsLeftSide\">
|
||||||
|
<p>Twitch (name):</p>
|
||||||
|
<p>YouTube (name):</p>
|
||||||
|
<p>YouTube (link):</p>
|
||||||
|
<p>Discord (name):</p>
|
||||||
|
<p>Discord (UserID):</p>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
<div class=\"accountUpdateButton\">
|
<p><a href=\"/admin/user_management/change_password.php\" id=\"changePasswordButton\" style=\"text-align:center;\" class=\"disabled\">Change Password</a></p>
|
||||||
<input type=\"submit\" id=\"submitButton\" value=\"Update\">
|
<p>(coming soon!)</p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<div class=\"accountDetailsRightSide\">
|
||||||
|
<form id=\"editUserDetails\" action=\"/admin/user_management/edit_user.php\" method=\"post\">
|
||||||
|
<p><input type=\"text\" placeholder=\"" . $userDetails["twitch"] . "\" id=\"twitch\" name=\"twitch\"></p>
|
||||||
|
<p><input type=\"text\" placeholder=\"" . $userDetails["youtube"] . "\" id=\"youtube\" name=\"youtube\"></p>
|
||||||
|
<p><input type=\"text\" placeholder=\"" . $userDetails["youtubeLink"] . "\" id=\"youtubeLink\" name=\"youtubeLink\"></p>
|
||||||
|
<p><input type=\"text\" placeholder=\"" . $userDetails["discord"] . "\" id=\"discord\" name=\"discord\"></p>
|
||||||
|
<p><input type=\"text\" placeholder=\"" . $userDetails["discordLink"] . "\" id=\"discordLink\" name=\"discordLink\"></p>
|
||||||
|
<p> </p>
|
||||||
|
<div class=\"accountUpdateButton\">
|
||||||
|
<input type=\"submit\" id=\"submitButton\" value=\"Update\">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
");
|
||||||
");
|
|
||||||
} else {
|
|
||||||
echo ("
|
|
||||||
<div id=\"accountSocialsPanel\">
|
|
||||||
<h3>Socials</h3>
|
|
||||||
<p class=\"newLine\"></p>
|
|
||||||
<div class=\"accountDetailsLeftSide\">
|
|
||||||
<p>Twitch:</p>
|
|
||||||
<p>YouTube:</p>
|
|
||||||
<p>Discord:</p>
|
|
||||||
<p> </p>
|
|
||||||
<p> </p>
|
|
||||||
<p> </p>
|
|
||||||
<p> </p>
|
|
||||||
<p> </p>
|
|
||||||
</div>
|
|
||||||
<div class=\"accountDetailsRightSide\">
|
|
||||||
");
|
|
||||||
if (isset($userDetails["twitch"]) && $userDetails["twitch"] != "") {
|
|
||||||
echo ("<p><a href=\"#\" id=\"twitchURL\" onclick=\"redirect('twitch', '" . $userDetails["twitch"] . "')\" class=\"plainLinkBlue\">" . $userDetails["twitch"] . "</a></p>");
|
|
||||||
} else {
|
} else {
|
||||||
echo ("<p>none</p>");
|
echo ("
|
||||||
}
|
<div id=\"accountSocialsPanel\">
|
||||||
|
<h3>Socials</h3>
|
||||||
if (isset($userDetails["youtube"]) && $userDetails["youtube"] != "") {
|
<p class=\"newLine\"></p>
|
||||||
if (isset($userDetails["youtubeLink"]) && $userDetails["youtubeLink"] != "") {
|
<div class=\"accountDetailsLeftSide\">
|
||||||
echo ("<p><a href=\"#\" id=\"youtubeURL\" onclick=\"redirect('youtube', '" . $userDetails["youtubeLink"] . "')\" class=\"plainLinkBlue\">" . $userDetails["youtube"] . "</a></p>");
|
<p>Twitch:</p>
|
||||||
|
<p>YouTube:</p>
|
||||||
|
<p>Discord:</p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
</div>
|
||||||
|
<div class=\"accountDetailsRightSide\">
|
||||||
|
");
|
||||||
|
if (isset($userDetails["twitch"]) && $userDetails["twitch"] != "") {
|
||||||
|
echo ("<p><a href=\"#\" id=\"twitchURL\" onclick=\"redirect('twitch', '" . $userDetails["twitch"] . "')\" class=\"plainLinkBlue\">" . $userDetails["twitch"] . "</a></p>");
|
||||||
} else {
|
} else {
|
||||||
echo ("<p>" . $userDetails["youtube"] . "</a></p>");
|
echo ("<p>none</p>");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
echo ("<p>none</p>");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($userDetails["discord"]) && $userDetails["discord"] != "") {
|
if (isset($userDetails["youtube"]) && $userDetails["youtube"] != "") {
|
||||||
if (isset($userDetails["discordLink"]) && $userDetails["discordLink"] != "") {
|
if (isset($userDetails["youtubeLink"]) && $userDetails["youtubeLink"] != "") {
|
||||||
echo ("<a href=\"#\" id=\"discordURL\" onclick=\"redirect('discord', '" . $userDetails["discordLink"] . "')\" class=\"plainLinkBlue\"> " . $userDetails["discord"] . "</a></p>");
|
echo ("<p><a href=\"#\" id=\"youtubeURL\" onclick=\"redirect('youtube', '" . $userDetails["youtubeLink"] . "')\" class=\"plainLinkBlue\">" . $userDetails["youtube"] . "</a></p>");
|
||||||
|
} else {
|
||||||
|
echo ("<p>" . $userDetails["youtube"] . "</a></p>");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo ("<p>" . $userDetails["discord"] . "</a></p>");
|
echo ("<p>none</p>");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
echo ("<p>none</p>");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo ("
|
if (isset($userDetails["discord"]) && $userDetails["discord"] != "") {
|
||||||
|
if (isset($userDetails["discordLink"]) && $userDetails["discordLink"] != "") {
|
||||||
|
echo ("<a href=\"#\" id=\"discordURL\" onclick=\"redirect('discord', '" . $userDetails["discordLink"] . "')\" class=\"plainLinkBlue\"> " . $userDetails["discord"] . "</a></p>");
|
||||||
|
} else {
|
||||||
|
echo ("<p>" . $userDetails["discord"] . "</a></p>");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo ("<p>none</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
echo ("
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
");
|
||||||
");
|
}
|
||||||
}
|
?>
|
||||||
?>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -19,11 +19,13 @@ try { // Try opening the SQL database connection
|
|||||||
$results = $sqlGetUserList->fetch();
|
$results = $sqlGetUserList->fetch();
|
||||||
|
|
||||||
// Check if user exists
|
// Check if user exists
|
||||||
if (mb_strtolower($_GET["username"]) == mb_strtolower($results["username"])) {
|
if (isset($results)) {
|
||||||
$userExists = true;
|
if (mb_strtolower($_GET["username"]) != mb_strtolower($results["username"])) {
|
||||||
} else {
|
$userExists = false;
|
||||||
$userExists = false;
|
echo "NO USER";
|
||||||
|
} else {
|
||||||
|
$userExists = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -54,21 +56,25 @@ try { // Try opening the SQL database connection
|
|||||||
</div>
|
</div>
|
||||||
<div id="headerCentre">
|
<div id="headerCentre">
|
||||||
<h1 id="headerText"><a href="/" class="plainLinkBlue">TrojanDestinyRL</a></h1>
|
<h1 id="headerText"><a href="/" class="plainLinkBlue">TrojanDestinyRL</a></h1>
|
||||||
<div id="youtubeImage" onclick="redirect('mainpage', 'https://www.youtube.com/@TrojanDestinyRL')"><img src="/assets/youtube.svg" alt="youtube logo"></div>
|
<div id="youtubeImage" onclick="redirect('this', 'https://www.youtube.com/@TrojanDestinyRL')"><img src="/assets/youtube.svg" alt="youtube logo"></div>
|
||||||
<div id="twitchImage" onclick="redirect('mainpage', 'https://www.twitch.tv/trojandestinyrl')"><img src="/assets/twitch.svg" alt="twitch logo"></div>
|
<div id="twitchImage" onclick="redirect('this', 'https://www.twitch.tv/trojandestinyrl')"><img src="/assets/twitch.svg" alt="twitch logo"></div>
|
||||||
<div id="discordImage" onclick="redirect('mainpage', 'https://discord.com')"><img src="/assets/discord.svg" alt="discord logo"></div>
|
<div id="discordImage" onclick="redirect('this', 'https://discord.gg/bzU5fVxCZJ')"><img src="/assets/discord.svg" alt="discord logo"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="headerRight">
|
<div id="headerRight">
|
||||||
<img src="/assets/trojan_image_2.png" alt="Trojan Destiny logo" id="headerImage">
|
<img src="/assets/trojan_image_2.png" alt="Trojan Destiny logo" id="headerImage">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p></p>
|
<p></p>
|
||||||
<h2 id="adminHeader">My Account</h2>
|
|
||||||
<?php
|
<?php
|
||||||
if ($userExists) {
|
if ($userExists) {
|
||||||
echo ("<iframe src=\"/user/account.php?username=" . $_GET["username"] . "\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>");
|
echo ("<iframe src=\"/user/account.php?username=" . $_GET["username"] . "\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>");
|
||||||
} else {
|
} else {
|
||||||
echo "<p>USER NO EXISTS</p>";
|
echo "<div class=\"noUser\">";
|
||||||
|
echo "<h2>USER NOT FOUND!</h2>";
|
||||||
|
echo "<p>This person may have played some games with us, but hasn't registered an account yet.</p>";
|
||||||
|
echo "<p>Please check back later!</p>";
|
||||||
|
echo "<p></p>";
|
||||||
|
echo "</div>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user