aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Notify.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-07-29 06:59:13 +0000
committerMario <mario@mariovavti.com>2021-07-29 06:59:13 +0000
commit9722d157bf138753bc168f68c56b4963db6da4e9 (patch)
treea15bb81c35a2367fe4628614471d471ed86d2712 /Zotlabs/Module/Notify.php
parent219d47f04c7bb04dcc241b9ed6ca411fc9653f09 (diff)
parentc6133d2558ce29e44342fa7be8bb65e0059aea02 (diff)
downloadvolse-hubzilla-9722d157bf138753bc168f68c56b4963db6da4e9.tar.gz
volse-hubzilla-9722d157bf138753bc168f68c56b4963db6da4e9.tar.bz2
volse-hubzilla-9722d157bf138753bc168f68c56b4963db6da4e9.zip
Merge branch 'dev' into bs5
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;
-
+
}
}