]> git.mxchange.org Git - friendica.git/commitdiff
ping: further work
authorrabuzarus <>
Thu, 3 Dec 2015 21:42:53 +0000 (22:42 +0100)
committerrabuzarus <>
Thu, 3 Dec 2015 21:42:53 +0000 (22:42 +0100)
include/group.php
mod/ping.php

index 7e417b0e65268ecea62a53eef5f50540edac4920..64c74ba2d123ab4c517359ff1508a24ff74ef636 100644 (file)
@@ -340,18 +340,30 @@ function groups_containing($uid,$c) {
 
        return $ret;
 }
-
+/**
+ * @brief count unread group items
+ *
+ * Count unread items of each groups
+ *
+ * @return array
+ *     'id' => contact id
+ *     'name' => group name
+ *     'count' => counted unseen group items
+ *
+ */
 function groups_count_unseen() {
-       
-       $r = q("SELECT `group`.`id`, `group`.`name`, COUNT(`item`.id`) AS `count` FROM `group`, `group_member`, `item`
+
+       $r = q("SELECT `group`.`id`, `group`.`name`, COUNT(`item`.`id`) AS `count` FROM `group`, `group_member`, `item`
                        WHERE `group`.`uid` = %d
                        AND `item`.`uid` = %d
                        AND `item`.`unseen` AND `item`.`visible`
                        AND NOT `item`.`deleted`
                        AND `item`.`contact-id` = `group_member`.`contact-id`
                        AND `group_member`.`gid` = `group`.`id`
-                       GROUP BY `group.id` ",
+                       GROUP BY `group`.`id` ",
                intval(local_user()),
                intval(local_user())
        );
+
+       return $r;
 }
\ No newline at end of file
index f8faadff85d1bad10ee2d9cc3693e527bb029cff..57728d32949ef64aab036fbd6f8ffd10531366f3 100644 (file)
@@ -2,7 +2,7 @@
 require_once("include/datetime.php");
 require_once('include/bbcode.php');
 require_once('include/forums.php');
-require_once('include/groupo.php');
+require_once('include/group.php');
 require_once("mod/proxy.php");
 
 function ping_init(&$a) {