From 41636a50aa4fd3f53ad9f9e9d797bfcc37ba8e13 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 22 Feb 2012 23:34:30 -0800 Subject: new notify sort of working in testbubble --- mod/notifications.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'mod') diff --git a/mod/notifications.php b/mod/notifications.php index 635639d89..5831c1b7a 100755 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -67,6 +67,11 @@ function notifications_content(&$a) { $o = ''; $tabs = array( + array( + 'label' => t('System'), + 'url'=>$a->get_baseurl() . '/notifications/system', + 'sel'=> (($a->argv[1] == 'system') ? 'active' : ''), + ), array( 'label' => t('Network'), 'url'=>$a->get_baseurl() . '/notifications/network', @@ -295,6 +300,36 @@ function notifications_content(&$a) { '$notif_content' => $notif_content, )); + } else if (($a->argc > 1) && ($a->argv[1] == 'system')) { + + $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 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().'/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'), + '$tabs' => $tabs, + '$notif_content' => $notif_content, + )); + } else if (($a->argc > 1) && ($a->argv[1] == 'personal')) { $notif_tpl = get_markup_template('notifications.tpl'); -- cgit v1.2.3