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;
|
||||||
|
window.open(link).focus();
|
||||||
break;
|
break;
|
||||||
case "discord":
|
case "discord":
|
||||||
var link = "https://discordapp.com/users/" + address;
|
var link = "https://discordapp.com/users/" + address;
|
||||||
|
window.open(link).focus();
|
||||||
|
break;
|
||||||
|
case "this":
|
||||||
|
window.top.location.href = address;
|
||||||
break;
|
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;
|
||||||
@ -262,3 +267,7 @@
|
|||||||
height: 0px;
|
height: 0px;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.noUser {
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -65,7 +65,18 @@ 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="accountDetailsTitlePanel">
|
||||||
|
<?php
|
||||||
|
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
||||||
|
echo "<h2 id=\"adminHeader\">My Account</h2>";
|
||||||
|
} else {
|
||||||
|
echo "<h2 id=\"adminHeader\">$username's Account</h2>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<p> </p>
|
||||||
|
<div id="accountDetailsBody">
|
||||||
<div id="accountDetailsPanel">
|
<div id="accountDetailsPanel">
|
||||||
<h3>Info</h3>
|
<h3>Info</h3>
|
||||||
<p class="newLine"></p>
|
<p class="newLine"></p>
|
||||||
@ -171,6 +182,6 @@ try { // Try opening the SQL database connection
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</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