From e42e7dea9f5467e028cd5a1ee5d7acef76916fca Mon Sep 17 00:00:00 2001 From: NikolaiDerDeutsche Date: Mon, 4 Dec 2023 19:38:55 +0100 Subject: [PATCH] New Update --- auth.php | 1 + connectionDB.php | 6 +++--- css/global.css | 7 ++++++- favicon-32x32.png | Bin 0 -> 489 bytes index.php | 2 ++ profile.php | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 favicon-32x32.png diff --git a/auth.php b/auth.php index ba640ee..0d27527 100644 --- a/auth.php +++ b/auth.php @@ -35,6 +35,7 @@ if($_SERVER["REQUEST_METHOD"] === "POST") { TinyTalkHub +
diff --git a/connectionDB.php b/connectionDB.php index b42b285..75b7b07 100644 --- a/connectionDB.php +++ b/connectionDB.php @@ -1,12 +1,12 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $get_user = $pdo->prepare("SELECT * FROM users WHERE username = ? AND password = ?; "); $get_user_password = $pdo->prepare("SELECT * FROM users WHERE id = ?"); $get_user_id = $pdo->prepare("SELECT username FROM users WHERE id = ?;"); $get_user_posts = $pdo->prepare("SELECT content,date::date FROM posts WHERE autor_id = ? ORDER BY id DESC"); $get_posts_count = $pdo->prepare("SELECT COUNT(*) FROM posts WHERE autor_id = ?"); - $add_user = $pdo->prepare("INSERT INTO users (username,password) VAlUES(?,?);"); + $add_user = $pdo->prepare("INSERT INTO users (username,password,avatar_id) VAlUES(?,?,floor(random() * (20-1+1) + 1)::int);"); $add_post = $pdo->prepare("INSERT INTO posts (content, autor_id, date) VALUES(?, ?, NOW());"); - $get_posts_query = "SELECT posts.id, content, username, date::date,autor_id FROM posts JOIN users ON posts.autor_id = users.id ORDER BY posts.id DESC"; + $get_posts_query = "SELECT posts.id, content, username, date::date,autor_id, avatar_url FROM posts JOIN users ON posts.autor_id = users.id JOIN avatars ON users.avatar_id = avatars.id ORDER BY posts.id DESC"; ?> diff --git a/css/global.css b/css/global.css index f19fde1..f94338a 100644 --- a/css/global.css +++ b/css/global.css @@ -62,7 +62,11 @@ button { .wrap-post-info { display: flex; align-items: center; - column-gap: 40px; + column-gap: 20px; +} +.avatar { + width: 50px; + height: 50px; } .wrap-post-info p { opacity: 0.7; @@ -87,6 +91,7 @@ button { + @media screen and (max-width: 600px) { .form-auth-wrap { width: 100%; diff --git a/favicon-32x32.png b/favicon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..c74395a55137369b9071e892c81afb5d577ca53a GIT binary patch literal 489 zcmV(*!d4nUT*u@M6sxMazFtRd3Wq|Y#A%1wq>uYSPgaXFxms9d;z{|nY^sHZ0gE^vPS z{0o=o=4JtB-K$qWqUh1o TinyTalkHub +

TinyTalkHub

@@ -37,6 +38,7 @@ fetchAll() as $row) { ?>