From a69b60703b2a3b641420e855736fed672e92fe03 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 8 Feb 2025 19:54:49 -0500 Subject: [PATCH] Dedup Notications code and move to a modal instead of a drop menu --- check_login.php | 9 ----- includes/footer.php | 1 + includes/top_nav.php | 74 +++++----------------------------- modals/notifications_modal.php | 70 ++++++++++++++++++++++++++++++++ post/misc.php | 2 + 5 files changed, 82 insertions(+), 74 deletions(-) create mode 100644 modals/notifications_modal.php diff --git a/check_login.php b/check_login.php index 36cd2b34..9b691a56 100644 --- a/check_login.php +++ b/check_login.php @@ -103,11 +103,9 @@ try { $access_permission_query = ""; // Ensure safe default if query fails } - // Include the settings vars require_once "get_settings.php"; - //Detects if using an Apple device and uses Apple Maps instead of google $iPod = stripos($_SERVER['HTTP_USER_AGENT'], "iPod"); $iPhone = stripos($_SERVER['HTTP_USER_AGENT'], "iPhone"); @@ -119,12 +117,5 @@ if ($iPod || $iPhone || $iPad) { $session_map_source = "google"; } - // Check if mobile device $session_mobile = isMobile(); - - -// Get Notification Count for the badge on the top nav -$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('notification_id') AS num FROM notifications WHERE (notification_user_id = $session_user_id OR notification_user_id = 0) AND notification_dismissed_at IS NULL")); -$num_notifications = $row['num']; - diff --git a/includes/footer.php b/includes/footer.php index 2d7a3247..b85eb7fc 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,4 +1,5 @@ diff --git a/includes/top_nav.php b/includes/top_nav.php index 1cc8cf17..0146c6e3 100644 --- a/includes/top_nav.php +++ b/includes/top_nav.php @@ -62,78 +62,22 @@ - 0) { ?> - - - - - - - -