Added datetime to notifications + Fixed sticky/unsticky notifications disappearing

This commit is contained in:
laf
2016-01-10 22:22:13 +00:00
parent d3248f8100
commit 93b0886567
3 changed files with 5 additions and 4 deletions

View File

@ -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';
}

View File

@ -75,7 +75,7 @@ $notifications = new ObjCache('notifications');
<div class="col-md-12">
<blockquote>
<p><?php echo $notif['body']; ?></p>
<footer>Source: <code><?php echo $notif['source']; ?></code></footer>
<footer><?php echo $notif['datetime']; ?> | Source: <code><?php echo $notif['source']; ?></code></footer>
</blockquote>
</div>
</div>
@ -104,7 +104,7 @@ $notifications = new ObjCache('notifications');
<div class="col-md-12">
<blockquote>
<p><?php echo preg_replace('/\\\n/','<br />', $notif['body']); ?></p>
<footer>Source: <code><?php echo $notif['source']; ?></code></footer>
<footer><?php echo $notif['datetime']; ?> | Source: <code><?php echo $notif['source']; ?></code></footer>
</blockquote>
</div>
</div>
@ -134,7 +134,7 @@ $notifications = new ObjCache('notifications');
<div class="col-md-12">
<blockquote>
<p><?php echo preg_replace('/\\\n/','<br />', $notif['body']); ?></p>
<footer>Source: <code><?php echo $notif['source']; ?></code></footer>
<footer><?php echo $notif['datetime']; ?> | Source: <code><?php echo $notif['source']; ?></code></footer>
</blockquote>
</div>
</div>

1
sql-schema/087.sql Normal file
View File

@ -0,0 +1 @@
ALTER TABLE `notifications` ADD `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;