]> git.mxchange.org Git - friendica.git/blobdiff - mod/manage.php
The manage page now shows the unread notifications
[friendica.git] / mod / manage.php
index c0eedc2ba07ebcfecaa4b05cd44ab428c844ef5d..3f2023b7e3cd2b1d01c6c4461f9f92e778b2dec7 100644 (file)
@@ -114,6 +114,20 @@ function manage_content(&$a) {
                $identities[$key][thumb] = $thumb[0][thumb];
 
                $identities[$key]['selected'] = (($id['nickname'] === $a->user['nickname']) ? true : false);
+
+               $notifications = 0;
+
+               $r = q("SELECT DISTINCT(`parent`) FROM `notify` WHERE `uid` = %d AND NOT `seen` AND NOT (`type` IN (%d, %d))",
+                       intval($id['uid']), intval(NOTIFY_INTRO), intval(NOTIFY_MAIL));
+               if ($r)
+                       $notifications = sizeof($r);
+
+               $r = q("SELECT DISTINCT(`convid`) FROM `mail` WHERE `uid` = %d AND NOT `seen`",
+                       intval($id['uid']));
+               if ($r)
+                       $notifications = $notifications + sizeof($r);
+
+               $identities[$key]['notifications'] = $notifications;
        }
 
        $o = replace_macros(get_markup_template('manage.tpl'), array(