diff --git a/admin/user_management/user_edit_form.php b/admin/user_management/user_edit_form.php index 554598e..8bed1d1 100644 --- a/admin/user_management/user_edit_form.php +++ b/admin/user_management/user_edit_form.php @@ -57,7 +57,7 @@ try { // Try opening the SQL database connection " id="discord" name="discord" class="newLine" style="width:100%" maxlength="50"/> - " id="discordLink" name="discordLink" class="newLine" style="width:100%" maxlength="50"/> + " id="discordLink" name="discordLink" class="newLine" style="width:100%" pattern="[0-9]*" maxlength="50"/> " id="twitch" name="twitch" class="newLine" style="width:100%" maxlength="50" /> diff --git a/scripts/user_management.js b/scripts/user_management.js index 04d50c9..780a228 100644 --- a/scripts/user_management.js +++ b/scripts/user_management.js @@ -172,6 +172,30 @@ function togglePWChange() { } } +function toggleAccountEdit() { + // This function handles the switch between showing the regular socials display, and the edit panel + var socialsDiv = document.getElementById("accountSocialsPanel"); + + var socialsEdit = document.getElementById("accountSocialsPanelEdit"); + + if (socialsEdit.style.display == "none") { + socialsDiv.style.display = "none"; + socialsDiv.style.zIndex = "-1"; + socialsEdit.style.display = "flex"; + socialsEdit.style.zIndex = "1"; + } else if (socialsEdit.style.display == "flex") { + socialsDiv.style.display = "flex"; + socialsDiv.style.zIndex = "1"; + socialsEdit.style.display = "none"; + socialsEdit.style.zIndex = "-1"; + } else { + socialsDiv.style.display = "none"; + socialsDiv.style.zIndex = "-1"; + socialsEdit.style.display = "flex"; + socialsEdit.style.zIndex = "1"; + } +} + function editUser() { console.log("YAASSS"); var div = document.getElementById("userEditFrameDiv"); @@ -179,7 +203,7 @@ function editUser() { var html = ""; - html += ""; + html += ""; div.innerHTML = html; diff --git a/styles/primary.css b/styles/primary.css index 23e876f..fd44729 100644 --- a/styles/primary.css +++ b/styles/primary.css @@ -229,6 +229,39 @@ For all the things at the bottom of the page; log in/out, 'my account', etc. color: rgb(60, 60, 60); } +/* TOOLTIP */ + +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; + /*border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ + } + +/* Tooltip text */ +.tooltip .tooltipText { +visibility: hidden; +width: 180px; +background-color: black; +color: #fff; +text-align: center; +padding: 5px 10px; +border-radius: 6px; + +/* Position the tooltip text - see examples below! */ +position: absolute; +z-index: 1; +bottom: 100%; +left: 50%; +margin-left: -90px; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltipText { + visibility: visible; +} + + diff --git a/styles/user_management.css b/styles/user_management.css index e367115..4c5c5c5 100644 --- a/styles/user_management.css +++ b/styles/user_management.css @@ -51,6 +51,28 @@ } +#accountSocialsPanelEdit { + z-index: -1; + display: none; + flex-direction: row; + flex-wrap: wrap; + width: 45%; + border: 1px solid black; + border-radius: 8px; + margin-right: 2%; + padding: 5px; + padding-bottom: 25px; + margin: 0 auto; +} + +#accountSocialsPanelEdit p { + height: 25px; +} +#accountSocialsPanelEdit h3 { + text-align: center; +} + + #passwordChangePanel { z-index: -1; @@ -181,6 +203,30 @@ transform: translateY(2px); } +#editAccountButton { + margin: auto; + padding: 5px 10px; + font-weight: 600; + font-size: 75%; + text-decoration: none; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background-color: rgba(255, 255, 255, 0); + border-radius: 3px; + border: 1px solid rgb(0, 0, 255); + box-shadow: 0px 2px 4px; + color: black; +} + +#editAccountButton:hover { + color: black; + background-color: rgba(255, 165, 0, .6); +} + +#editAccountButton:active { + box-shadow: 0px 0px 2px; + transform: translateY(2px); +} + #textInputArea { diff --git a/user/account.php b/user/account.php index fa49a53..e4e4617 100644 --- a/user/account.php +++ b/user/account.php @@ -118,26 +118,26 @@ try { // Try opening the SQL database connection if (isset($_SESSION["userID"])) { if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) { echo (" -
Twitch (name):
-YouTube (name):
-YouTube (link):
-Discord (name):
-Discord (UserID):
+Twitch (name):Your Twitch username
+YouTube (name):Your YouTube username
+YouTube (link):Link to your YouTube channel
+Discord (name):You Discord name (how it's displayed)
+Discord (UserID):This is the numerical User ID from Discord. Right-click your profile name to copy your ID
- +
" . $userDetails["twitch"] . "
"); + } else { + echo ("none
"); + } + + if (isset($userDetails["youtube"]) && $userDetails["youtube"] != "") { + if (isset($userDetails["youtubeLink"]) && $userDetails["youtubeLink"] != "") { + echo ("" . $userDetails["youtube"] . "
"); + } else { + echo ("" . $userDetails["youtube"] . "
"); + } + } else { + echo ("none
"); + } + + if (isset($userDetails["discord"]) && $userDetails["discord"] != "") { + if (isset($userDetails["discordLink"]) && $userDetails["discordLink"] != "") { + echo (" " . $userDetails["discord"] . ""); + } else { + echo ("" . $userDetails["discord"] . "
"); + } + } else { + echo ("none
"); + } + + + echo (" ++
+ +
+
Twitch:
YouTube:
@@ -228,7 +279,6 @@ try { // Try opening the SQL database connection } } else { echo (" -