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 0000000..c74395a Binary files /dev/null and b/favicon-32x32.png differ diff --git a/index.php b/index.php index b53e766..ee55a68 100644 --- a/index.php +++ b/index.php @@ -18,6 +18,7 @@ TinyTalkHub +

TinyTalkHub

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