From 61360c3e4cabbd8fdc1e883e4c0b95ee425a414c Mon Sep 17 00:00:00 2001 From: Borgal Date: Mon, 2 Feb 2026 12:52:27 +0100 Subject: [PATCH] =?UTF-8?q?v1.4.0=20-=20zuletzt=20Aktiv=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/users.php b/users.php index b5af325..c680e83 100755 --- a/users.php +++ b/users.php @@ -60,7 +60,7 @@ if ($is_admin && isset($_GET['action']) && $_GET['action'] == 'delete' && isset( // --- Nur Admins: Bearbeiten --- if ($is_admin && isset($_GET['action']) && $_GET['action'] == 'edit' && isset($_GET['id'])) { $id = (int)$_GET['id']; - $stmt = mysqli_prepare($conn, "SELECT id, username, email, role, birthday FROM users WHERE id = ?"); + $stmt = mysqli_prepare($conn, "SELECT id, username, email, role, birthday, last_activity FROM users WHERE id = ?"); mysqli_stmt_bind_param($stmt, "i", $id); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); @@ -88,9 +88,6 @@ if ($is_admin && $_SERVER["REQUEST_METHOD"] == "POST") { $email = !empty($email_raw) ? $email_raw : null; $birthday_db = deDateToDb($birthday_de); - // --- DEBUG: Zeige, was konvertiert wurde (kannst du später löschen) --- - // error_log("DEBUG: birthday_de='$birthday_de' → birthday_db='$birthday_db'"); - if (empty($username)) { $message = "Benutzername ist erforderlich."; $message_type = 'danger'; @@ -186,9 +183,9 @@ if ($is_admin && $_SERVER["REQUEST_METHOD"] == "POST") { } } -// --- Mitgliederliste --- +// --- Mitgliederliste --- 🔹 last_activity hinzugefügt $users = []; -$result = mysqli_query($conn, "SELECT id, username, role, email, birthday FROM users ORDER BY id ASC"); +$result = mysqli_query($conn, "SELECT id, username, role, email, birthday, last_activity FROM users ORDER BY id ASC"); while ($row = mysqli_fetch_assoc($result)) { $users[] = $row; } @@ -280,6 +277,7 @@ require_once 'inc/header.php'; Daten Rolle + @@ -309,6 +307,22 @@ require_once 'inc/header.php'; + + + = strtotime('-10 minutes'); + $tooltip = $is_online + ? 'Online' + : (!empty($user['last_activity']) + ? 'Zuletzt online: ' . date('d.m.Y H:i', strtotime($user['last_activity'])) + : 'Noch nie gesehen'); + $color = $is_online ? 'success' : 'secondary'; + ?> + +