]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
Remove redundant htmlentities/htmlspecialchars
[friendica.git] / mod / ping.php
index ff0139f28f9d3b405f0b148ccf694b8ba03f0171..40700f36f862c70486e949a5f2a9d826fb3758c6 100644 (file)
@@ -150,25 +150,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 +188,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' ",
@@ -202,11 +198,7 @@ function ping_init(App $a)
                $mail_count = count($mails);
 
                if (intval(Config::get('config', 'register_policy')) === REGISTER_APPROVE && is_site_admin()) {
-                       $regs = q(
-                               "SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`
-                               FROM `contact` RIGHT JOIN `register` ON `register`.`uid` = `contact`.`uid`
-                               WHERE `contact`.`self` = 1"
-                       );
+                       $regs = Friendica\Model\Register::getPending();
 
                        if (DBA::isResult($regs)) {
                                $register_count = count($regs);
@@ -225,7 +217,7 @@ function ping_init(App $a)
                                DBA::escape(DateTimeFormat::utcNow())
                        );
                        if (DBA::isResult($ev)) {
-                               Cache::set($cachekey, $ev, CACHE_HOUR);
+                               Cache::set($cachekey, $ev, Cache::HOUR);
                        }
                }
 
@@ -381,12 +373,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']);
        }
@@ -491,7 +483,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')) {