aboutsummaryrefslogtreecommitdiffstats
path: root/mod/notify.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/notify.php')
-rw-r--r--mod/notify.php52
1 files changed, 26 insertions, 26 deletions
diff --git a/mod/notify.php b/mod/notify.php
index ae8273a1d..dd26bfe7e 100644
--- a/mod/notify.php
+++ b/mod/notify.php
@@ -5,9 +5,9 @@ function notify_init(&$a) {
if(! local_user())
return;
- if($a->argc > 2 && $a->argv[1] === 'view' && intval($a->argv[2])) {
+ if(argc() > 2 && argv(1) === 'view' && intval(argv(2))) {
$r = q("select * from notify where id = %d and uid = %d limit 1",
- intval($a->argv[2]),
+ intval(argv(2)),
intval(local_user())
);
if(count($r)) {
@@ -23,7 +23,7 @@ function notify_init(&$a) {
goaway($a->get_baseurl(true));
}
- if($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) {
+ if(argc() > 2 && argv(1) === 'mark' && argv(2) === 'all' ) {
$r = q("update notify set seen = 1 where uid = %d",
intval(local_user())
);
@@ -39,35 +39,35 @@ function notify_content(&$a) {
if(! local_user())
return login();
- $notif_tpl = get_markup_template('notifications.tpl');
+ $notif_tpl = get_markup_template('notifications.tpl');
- $not_tpl = get_markup_template('notify.tpl');
- require_once('include/bbcode.php');
+ $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 date desc",
- intval(local_user())
- );
+ $r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc",
+ intval(local_user())
+ );
- if (count($r) > 0) {
- foreach ($r as $it) {
- $notif_content .= replace_macros($not_tpl,array(
- '$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
- '$item_image' => $it['photo'],
- '$item_text' => strip_tags(bbcode($it['msg'])),
- '$item_when' => relative_date($it['date'])
- ));
- }
- } else {
- $notif_content .= t('No more system notifications.');
+ if (count($r) > 0) {
+ foreach ($r as $it) {
+ $notif_content .= replace_macros($not_tpl,array(
+ '$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
+ '$item_image' => $it['photo'],
+ '$item_text' => strip_tags(bbcode($it['msg'])),
+ '$item_when' => relative_date($it['date'])
+ ));
}
+ }
+ 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,
- ));
+ $o .= replace_macros($notif_tpl,array(
+ '$notif_header' => t('System Notifications'),
+ '$tabs' => '', // $tabs,
+ '$notif_content' => $notif_content,
+ ));
return $o;
-
} \ No newline at end of file