From 93b0886567ff918b5db418c02b72c5e077ba2264 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 10 Jan 2016 22:22:13 +0000 Subject: [PATCH] Added datetime to notifications + Fixed sticky/unsticky notifications disappearing --- html/includes/forms/notifications.inc.php | 2 +- html/pages/notifications.inc.php | 6 +++--- sql-schema/087.sql | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 sql-schema/087.sql diff --git a/html/includes/forms/notifications.inc.php b/html/includes/forms/notifications.inc.php index d787389e5..187f2ee2c 100644 --- a/html/includes/forms/notifications.inc.php +++ b/html/includes/forms/notifications.inc.php @@ -33,7 +33,7 @@ if (isset($_REQUEST['notification_id']) && isset($_REQUEST['action'])) { $status = 'ok'; $message = 'Set as Sticky'; } - elseif ($_SESSION['userlevel'] == 10 && $_REQUEST['action'] == 'unstick' && dbUpdate(array('key'=>'sticky','value'=>0),'notifications_attribs','notifications_id = ? && user_id = ?',array($_REQUEST['notification_id'],$_SESSION['user_id']))) { + elseif ($_SESSION['userlevel'] == 10 && $_REQUEST['action'] == 'unstick' && dbDelete('notifications_attribs',"notifications_id = ? && user_id = ? AND `key`='sticky'",array($_REQUEST['notification_id'],$_SESSION['user_id']))) { $status = 'ok'; $message = 'Removed Sticky'; } diff --git a/html/pages/notifications.inc.php b/html/pages/notifications.inc.php index edc25e803..713a12eb3 100644 --- a/html/pages/notifications.inc.php +++ b/html/pages/notifications.inc.php @@ -75,7 +75,7 @@ $notifications = new ObjCache('notifications');

-
Source:
+
| Source:
@@ -104,7 +104,7 @@ $notifications = new ObjCache('notifications');

', $notif['body']); ?>

-
Source:
+
| Source:
@@ -134,7 +134,7 @@ $notifications = new ObjCache('notifications');

', $notif['body']); ?>

-
Source:
+
diff --git a/sql-schema/087.sql b/sql-schema/087.sql new file mode 100644 index 000000000..4febc4931 --- /dev/null +++ b/sql-schema/087.sql @@ -0,0 +1 @@ +ALTER TABLE `notifications` ADD `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;