diff options
author | Mario <mario@mariovavti.com> | 2021-06-17 07:33:45 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-06-17 07:33:45 +0000 |
commit | b55676d08914d58927b5503a1bfa283397cd6d44 (patch) | |
tree | 34827895f126f9afe0c1db284e089632e19984c6 /Zotlabs/Module/Notify.php | |
parent | b5a8ca6ef72366d355c99702f0a775ccc36734d5 (diff) | |
download | volse-hubzilla-b55676d08914d58927b5503a1bfa283397cd6d44.tar.gz volse-hubzilla-b55676d08914d58927b5503a1bfa283397cd6d44.tar.bz2 volse-hubzilla-b55676d08914d58927b5503a1bfa283397cd6d44.zip |
New landing page HQ with separate views for direct messages, public/limited messages and starred messages if the feature is enabled
Diffstat (limited to 'Zotlabs/Module/Notify.php')
-rw-r--r-- | Zotlabs/Module/Notify.php | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/Zotlabs/Module/Notify.php b/Zotlabs/Module/Notify.php index cffcc8099..5bfcec4f7 100644 --- a/Zotlabs/Module/Notify.php +++ b/Zotlabs/Module/Notify.php @@ -8,7 +8,15 @@ class Notify extends \Zotlabs\Web\Controller { function init() { if(! local_channel()) return; - + + if($_REQUEST['notify_id']) { + q("update notify set seen = 1 where id = %d and uid = %d", + intval($_REQUEST['notify_id']), + intval(local_channel()) + ); + killme(); + } + if(argc() > 2 && argv(1) === 'view' && intval(argv(2))) { $r = q("select * from notify where id = %d and uid = %d limit 1", intval(argv(2)), @@ -29,24 +37,24 @@ class Notify extends \Zotlabs\Web\Controller { } goaway(z_root()); } - - + + } - - + + function get() { if(! local_channel()) return login(); - + $notif_tpl = get_markup_template('notifications.tpl'); - + $not_tpl = get_markup_template('notify.tpl'); require_once('include/bbcode.php'); - + $r = q("SELECT * from notify where uid = %d and seen = 0 order by created desc", intval(local_channel()) ); - + if($r) { foreach ($r as $it) { $notif_content .= replace_macros($not_tpl,array( @@ -56,18 +64,18 @@ class Notify extends \Zotlabs\Web\Controller { '$item_when' => relative_date($it['created']) )); } - } + } else { $notif_content .= t('No more system notifications.'); } - + $o .= replace_macros($notif_tpl,array( '$notif_header' => t('System Notifications'), '$tabs' => '', // $tabs, '$notif_content' => $notif_content, )); - + return $o; - + } } |