<?php
require_once('include/NotificationsManager.php');
-if(! function_exists('notify_init')) {
+
+
function notify_init(&$a) {
if(! local_user()) return;
-
$nm = new NotificationsManager();
if($a->argc > 2 && $a->argv[1] === 'view' && intval($a->argv[2])) {
echo $j;
killme();
}
-}
+
}
-if(! function_exists('notify_content')) {
function notify_content(&$a) {
if(! local_user()) return login();
require_once('include/bbcode.php');
$r = $nm->getAll(array('seen'=>0));
- if ($r!==false && count($r) > 0) {
+ if (dbm::is_result($r) > 0) {
foreach ($r as $it) {
$notif_content .= replace_macros($not_tpl,array(
'$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
return $o;
-}
-}
+}