Skip to content

Commit 1c1971f

Browse files
committed
update
1 parent f694209 commit 1c1971f

18 files changed

+179
-45
lines changed

new-g4o2-chat/account-settings.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
if (isset($_POST["submit"])) {
3636
if (!file_exists($_FILES['fileToUpload']['tmp_name']) || !is_uploaded_file($_FILES['fileToUpload']['tmp_name'])) {
37-
$stmta = $pdo->prepare("SELECT pfp FROM account WHERE name=?");
38-
$stmta->execute([$_SESSION['name']]);
37+
$stmta = $pdo->prepare("SELECT pfp FROM account WHERE user_id=?");
38+
$stmta->execute([$_SESSION['user_id']]);
3939
$pfptemp = $stmta->fetchAll(PDO::FETCH_ASSOC);
4040

4141
foreach ($pfptemp as $test) {
@@ -79,6 +79,7 @@
7979
}
8080

8181
$sql = "UPDATE account SET pfp = :pfp,
82+
username = :newUsername,
8283
name = :newName,
8384
email = :email,
8485
password = :password,
@@ -89,6 +90,7 @@
8990
$stmt->execute(array(
9091
':pfp' => $base64,
9192
':usrid' => $_SESSION['user_id'],
93+
':newUsername' => str_replace('<', ' ¯\_(ツ)_/¯ ', $_POST['username']),
9294
':newName' => str_replace('<', ' ¯\_(ツ)_/¯ ', $_POST['name']),
9395
':email' => str_replace('<', ' ¯\_(ツ)_/¯ ', $_POST['email']),
9496
':password' => $hash,
@@ -172,8 +174,10 @@
172174
<body>
173175
<form class="form-signin" action="account-settings.php" method="post" enctype="multipart/form-data" autocomplete="off">
174176
<h1 class="h3 mb-3 font-weight-normal">Account Settings</h1>
175-
Select image to upload for <?= $_SESSION['name'] ?>
177+
Select image to upload for <?= $_SESSION['username'] ?>
176178
<input type="file" name="fileToUpload" id="fileToUpload">
179+
<label for="name" class="sr-only">Username</label>
180+
<input type="text" name="username" class="form-control" placeholder="" required="" autofocus="" value="<?= $response['username'] ?>">
177181
<label for="name" class="sr-only">Name</label>
178182
<input type="text" name="name" class="form-control" placeholder="" required="" autofocus="" value="<?= $response['name'] ?>">
179183
<label for="email" class="sr-only">Email</label>

new-g4o2-chat/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ body {
44

55
main {
66
padding: 35px;
7+
}
8+
9+
a {
10+
text-decoration: none !important;
711
}

new-g4o2-chat/favicon.ico

303 KB
Binary file not shown.
29.5 KB
Loading
47.4 KB
Loading
26.2 KB
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/mstile-150x150.png"/>
6+
<TileColor>#da532c</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>
1.47 KB
Loading
2.39 KB
Loading

new-g4o2-chat/favicon/favicon.ico

14.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)