diff options
author | Mario <mario@mariovavti.com> | 2021-04-16 12:41:31 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-04-20 10:58:56 +0200 |
commit | 60a0fdc76b3ccf1434cd0a5761fba14cd79e8e16 (patch) | |
tree | aace09f60f966131439426c46275ccf03f2fcbc2 | |
parent | cd760454a5cdaee591bdd2e0b3e0637799e0094e (diff) | |
download | volse-hubzilla-60a0fdc76b3ccf1434cd0a5761fba14cd79e8e16.tar.gz volse-hubzilla-60a0fdc76b3ccf1434cd0a5761fba14cd79e8e16.tar.bz2 volse-hubzilla-60a0fdc76b3ccf1434cd0a5761fba14cd79e8e16.zip |
fix regression in mod notifications
(cherry picked from commit b8a5f5fbf2b1702642c9489ea5ae3360c5b731bb)
-rw-r--r-- | Zotlabs/Module/Notifications.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Zotlabs/Module/Notifications.php b/Zotlabs/Module/Notifications.php index 55268e0a2..8ecf5760a 100644 --- a/Zotlabs/Module/Notifications.php +++ b/Zotlabs/Module/Notifications.php @@ -6,15 +6,17 @@ require_once('include/bbcode.php'); class Notifications extends \Zotlabs\Web\Controller { function get() { - + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } - + nav_set_selected('Notifications'); - + $o = ''; + $notif_content = ''; + $notifications_available = false; $r = q("select count(*) as total from notify where uid = %d and seen = 0", intval(local_channel()) @@ -24,7 +26,8 @@ class Notifications extends \Zotlabs\Web\Controller { and seen = 0 order by created desc limit 50", intval(local_channel()) ); - } else { + } + else { $r1 = q("select * from notify where uid = %d and seen = 0 order by created desc limit 50", intval(local_channel()) @@ -36,12 +39,12 @@ class Notifications extends \Zotlabs\Web\Controller { ); $r = array_merge($r1,$r2); } - + if($r) { - $notifications_available = 1; + $notifications_available = true; foreach ($r as $rr) { $x = strip_tags(bbcode($rr['msg'])); - $notif_content = replace_macros(get_markup_template('notify.tpl'),array( + $notif_content .= replace_macros(get_markup_template('notify.tpl'),array( '$item_link' => z_root().'/notify/view/'. $rr['id'], '$item_image' => $rr['photo'], '$item_text' => $x, @@ -54,15 +57,15 @@ class Notifications extends \Zotlabs\Web\Controller { else { $notif_content = t('No more system notifications.'); } - + $o .= replace_macros(get_markup_template('notifications.tpl'),array( '$notif_header' => t('System Notifications'), '$notif_link_mark_seen' => t('Mark all seen'), '$notif_content' => $notif_content, '$notifications_available' => $notifications_available, )); - + return $o; } - + } |