Du musst dich zuerst Einloggen oder Regestrieren
Hier Einloggen
Hier Regestrieren"); } include "db_connect.php"; if (!isset($_GET['user'])) { die("Kein Benutzer angegeben."); } $page = isset($_GET['page']) ? $_GET['page'] : 'posts'; $username = $_GET['user']; $userId = $_SESSION['user_id']; try { // Benutzerdaten abrufen $stmt = $pdo->prepare("SELECT id, username, email, created_at FROM users WHERE username = :username"); $stmt->execute([':username' => $username]); $selected_user = $stmt->fetch(PDO::FETCH_ASSOC); $stmt1 = $pdo->prepare("SELECT username, email, created_at FROM users WHERE id = :id"); $stmt1->execute([':id' => $userId]); $user = $stmt1->fetch(PDO::FETCH_ASSOC); $stmt2 = $pdo->prepare("SELECT file_path FROM profile_pictures WHERE user_id = :user_id"); $stmt2->execute([':user_id' => $userId]); $profile_pic2 = $stmt2->fetch(PDO::FETCH_ASSOC); $stmt3 = $pdo->prepare(" SELECT users.username, profile_pictures.file_path FROM users LEFT JOIN profile_pictures ON users.id = profile_pictures.user_id ORDER BY profile_pictures.uploaded_at DESC "); $stmt3->execute(); $users = $stmt3->fetchAll(PDO::FETCH_ASSOC); if (!$selected_user) { die("Benutzer nicht gefunden!"); } $stmt2 = $pdo->prepare("SELECT file_path FROM profile_pictures WHERE user_id = :user_id"); $stmt2->execute([':user_id' => $selected_user['id']]); $profile_pic = $stmt2->fetch(PDO::FETCH_ASSOC); if ($profile_pic) { $selected_profile_image = $profile_pic['file_path']; } else { $selected_profile_image = 'profile-pics/default.jpeg'; } if ($profile_pic2) { $selected_profile_image1 = $profile_pic2['file_path']; } else { $selected_profile_image1 = 'profile-pics/default.jpeg'; } $stmt3 = $pdo->prepare("SELECT COUNT(following_id) AS following_count FROM followers WHERE following_id = :user_id "); $stmt3->execute([':user_id' => $selected_user['id']]); $follower_count = $stmt3->fetch(PDO::FETCH_ASSOC)['following_count']; } catch (PDOException $e) { die("Fehler: " . $e->getMessage()); } ?> Profil von <?php echo htmlspecialchars($selected_user['username']); ?>

Profil von

Profilbild

Email:

Registriert seit:

Follower:

prepare("SELECT follower_id, following_id FROM followers WHERE follower_id = :user_id AND following_id = :id"); $stmt7->execute([':user_id' => $follower_id, ':id' => $selected_user['id']]); $isfollower = $stmt7->fetch(PDO::FETCH_ASSOC); ?>
Zurück zur Startseite Posts Über mich Einstellungen

Einstellungen

Profilbild änderen


Profilbild löschen

Profilbild änderm

Profilbild änderm

prepare(" SELECT posts.*, profile_pictures.file_path AS profile_picture, users.username FROM posts LEFT JOIN profile_pictures ON posts.user_id = profile_pictures.user_id LEFT JOIN users ON posts.user_id = users.id WHERE users.username = :username ORDER BY posts.created_at DESC "); $stmt45->execute([':username' => $username]); $posts = $stmt45->fetchAll(PDO::FETCH_ASSOC); ?>

Bild zum Post

Erstellt am: