- $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.');
+ $not_tpl = get_markup_template('notify.tpl');
+
+ $r = $nm->getAll(['seen'=>0]);
+ if (DBA::isResult($r) > 0) {
+ foreach ($r as $it) {
+ $notif_content .= replace_macros($not_tpl, [
+ '$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'],
+ '$item_image' => $it['photo'],
+ '$item_text' => strip_tags(BBCode::convert($it['msg'])),
+ '$item_when' => Temporal::getRelativeDate($it['date'])
+ ]);