]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
forgotten templates
[friendica.git] / mod / ping.php
index 883129d14f1c22f2215e0de4e22ccba07dd60d8d..d8eaa8126fd03f0aad9b5a079db905dab216b2c5 100644 (file)
@@ -10,11 +10,11 @@ use Friendica\Core\System;
 use Friendica\Core\PConfig;
 use Friendica\Database\DBM;
 use Friendica\Model\Contact;
+use Friendica\Model\Group;
 use Friendica\Util\XML;
 
 require_once 'include/datetime.php';
 require_once 'include/bbcode.php';
-require_once 'include/group.php';
 require_once 'mod/proxy.php';
 require_once 'include/enotify.php';
 
@@ -152,7 +152,7 @@ function ping_init(App $a)
                if ($network_count) {
                        if (intval(Feature::isEnabled(local_user(), 'groups'))) {
                                // Find out how unseen network posts are spread across groups
-                               $group_counts = groups_count_unseen();
+                               $group_counts = Group::countUnseen();
                                if (DBM::is_result($group_counts)) {
                                        foreach ($group_counts as $group_count) {
                                                if ($group_count['count'] > 0) {
@@ -164,8 +164,8 @@ function ping_init(App $a)
 
                        if (intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
                                $forum_counts = ForumManager::countUnseenItems();
-                               if (DBM::is_result($forums_counts)) {
-                                       foreach ($forums_counts as $forum_count) {
+                               if (DBM::is_result($forum_counts)) {
+                                       foreach ($forum_counts as $forum_count) {
                                                if ($forum_count['count'] > 0) {
                                                        $forums_unseen[] = $forum_count;
                                                }
@@ -490,8 +490,10 @@ function ping_get_notifications($uid)
 
                        $notification["href"] = System::baseUrl() . "/notify/view/" . $notification["id"];
 
-                       if ($notification["visible"] && !$notification["spam"]
-                               && !$notification["deleted"] && !is_array($result[$notification["parent"]])
+                       if ($notification["visible"]
+                               && !$notification["spam"]
+                               && !$notification["deleted"]
+                               && !(x($result, $notification["parent"]) && is_array($result[$notification["parent"]]))
                        ) {
                                // Should we condense the notifications or show them all?
                                if (PConfig::get(local_user(), 'system', 'detailed_notif')) {