<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
public static function countUnseen()
{
$stmt = DBA::p("SELECT `group`.`id`, `group`.`name`,
- (SELECT COUNT(*) FROM `item` FORCE INDEX (`uid_unseen_contactid`)
+ (SELECT COUNT(*) FROM `post-user`
WHERE `uid` = ?
AND `unseen`
AND `contact-id` IN
$groupedit = null;
}
+ if ($each == 'group') {
+ $count = DBA::count('group_member', ['gid' => $group['id']]);
+ $group_name = sprintf('%s (%d)', $group['name'], $count);
+ } else {
+ $group_name = $group['name'];
+ }
+
$display_groups[] = [
'id' => $group['id'],
'cid' => $cid,
- 'text' => $group['name'],
+ 'text' => $group_name,
'href' => $each . '/' . $group['id'],
'edit' => $groupedit,
'selected' => $selected,