aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Notify.php
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2021-06-17 14:57:47 -0700
committernobody <nobody@zotlabs.com>2021-06-17 14:57:47 -0700
commitefda8aac1d7d90fd7eda4a449332eedf74342951 (patch)
tree3373c0579168776cccda5224b6b33ce59fa9b274 /Zotlabs/Module/Notify.php
parent686530c1873f98d724355bf3f456243b1b7fdadd (diff)
parenta84cec4acddf6804a88fcda52e4437c91785dfb2 (diff)
downloadvolse-hubzilla-efda8aac1d7d90fd7eda4a449332eedf74342951.tar.gz
volse-hubzilla-efda8aac1d7d90fd7eda4a449332eedf74342951.tar.bz2
volse-hubzilla-efda8aac1d7d90fd7eda4a449332eedf74342951.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Module/Notify.php')
-rw-r--r--Zotlabs/Module/Notify.php34
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;
-
+
}
}