]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
Merge pull request #6340 from MrPetovan/bug/1495-fix-admin-theme-settings
[friendica.git] / mod / ping.php
index 6f5b5b4a9828aeed4a79c628f6e0213f2cafb3ec..b315ecf4b97a1ec597330e864621bf1aec046d28 100644 (file)
@@ -22,8 +22,6 @@ use Friendica\Util\Temporal;
 use Friendica\Util\Proxy as ProxyUtils;
 use Friendica\Util\XML;
 
-require_once 'include/enotify.php';
-
 /**
  * @brief Outputs the counts and the lists of various notifications
  *
@@ -150,25 +148,21 @@ 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 = Group::countUnseen();
-                               if (DBA::isResult($group_counts)) {
-                                       foreach ($group_counts as $group_count) {
-                                               if ($group_count['count'] > 0) {
-                                                       $groups_unseen[] = $group_count;
-                                               }
+                       // Find out how unseen network posts are spread across groups
+                       $group_counts = Group::countUnseen();
+                       if (DBA::isResult($group_counts)) {
+                               foreach ($group_counts as $group_count) {
+                                       if ($group_count['count'] > 0) {
+                                               $groups_unseen[] = $group_count;
                                        }
                                }
                        }
 
-                       if (intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
-                               $forum_counts = ForumManager::countUnseenItems();
-                               if (DBA::isResult($forum_counts)) {
-                                       foreach ($forum_counts as $forum_count) {
-                                               if ($forum_count['count'] > 0) {
-                                                       $forums_unseen[] = $forum_count;
-                                               }
+                       $forum_counts = ForumManager::countUnseenItems();
+                       if (DBA::isResult($forum_counts)) {
+                               foreach ($forum_counts as $forum_count) {
+                                       if ($forum_count['count'] > 0) {
+                                               $forums_unseen[] = $forum_count;
                                        }
                                }
                        }
@@ -192,7 +186,7 @@ function ping_init(App $a)
                $intro_count = count($intros1) + count($intros2);
                $intros = $intros1 + $intros2;
 
-               $myurl = System::baseUrl() . '/profile/' . $a->user['nickname'] ;
+               $myurl = System::baseUrl() . '/profile/' . $a->user['nickname'];
                $mails = q(
                        "SELECT `id`, `from-name`, `from-url`, `from-photo`, `created` FROM `mail`
                        WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
@@ -377,12 +371,12 @@ function ping_init(App $a)
        $sysmsgs = [];
        $sysmsgs_info = [];
 
-       if (x($_SESSION, 'sysmsg')) {
+       if (!empty($_SESSION['sysmsg'])) {
                $sysmsgs = $_SESSION['sysmsg'];
                unset($_SESSION['sysmsg']);
        }
 
-       if (x($_SESSION, 'sysmsg_info')) {
+       if (!empty($_SESSION['sysmsg_info'])) {
                $sysmsgs_info = $_SESSION['sysmsg_info'];
                unset($_SESSION['sysmsg_info']);
        }
@@ -487,7 +481,7 @@ function ping_get_notifications($uid)
 
                        if ($notification["visible"]
                                && !$notification["deleted"]
-                               && !(x($result, $notification["parent"]) && !empty($result[$notification["parent"]]))
+                               && empty($result[$notification["parent"]])
                        ) {
                                // Should we condense the notifications or show them all?
                                if (PConfig::get(local_user(), 'system', 'detailed_notif')) {