function getRecentOnlineUsers($limit = 10) {
$conn = getDbConnection();
$cutoff_time = time() - (5 * 60 * 60 * 60); // Consider users active within last 5 minutes
$sql = "SELECT id, username, profile_picture, last_visit
FROM users
WHERE last_visit > ?
ORDER BY last_visit DESC
LIMIT ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ii", $cutoff_time, $limit);
$stmt->execute();
$result = $stmt->get_result();
return $result->fetch_all(MYSQLI_ASSOC);
}
?>
Fatal error: Uncaught Error: Call to undefined function getRecentOnlineUsers() in /home/duno/public_html/jayforo.com/header.php:256
Stack trace:
#0 /home/duno/public_html/jayforo.com/post.php(65): include()
#1 {main}
thrown in /home/duno/public_html/jayforo.com/header.php on line 256