]> git.mxchange.org Git - friendica.git/commitdiff
Issue 1871: Show an information if a group is empty
authorMichael Vogel <icarus@dabo.de>
Sat, 5 Dec 2015 22:29:42 +0000 (23:29 +0100)
committerMichael Vogel <icarus@dabo.de>
Sat, 5 Dec 2015 22:29:42 +0000 (23:29 +0100)
mod/group.php
view/templates/groupeditor.tpl

index e9f9561f4613eaa0728b06f5e1113828e1cb7c15..5b28784f5663cc1b7056125b26619416e9e76b6d 100644 (file)
@@ -190,6 +190,7 @@ function group_content(&$a) {
                'label_members' => t('Members'),
                'members' => array(),
                'label_contacts' => t('All Contacts'),
+               'group_is_empty' => t('Group is empty'),
                'contacts' => array(),
        );
 
@@ -204,7 +205,7 @@ function group_content(&$a) {
                        group_rmv_member(local_user(),$group['name'],$member['id']);
        }
 
-       $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC",
+       $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `self` ORDER BY `name` ASC",
                intval(local_user())
        );
 
index b0f267dde9116de2b03e3b347a59df39d63a2aee..86458ded2e0d81c0151cd3b5b27ee7a3481250b4 100644 (file)
@@ -2,7 +2,11 @@
 <div id="group">
 <h3>{{$groupeditor.label_members}}</h3>
 <div id="group-members" class="contact_list">
-{{foreach $groupeditor.members as $c}} {{$c}} {{/foreach}}
+{{if $groupeditor.members }}
+       {{foreach $groupeditor.members as $c}} {{$c}} {{/foreach}}
+{{else}}
+{{$groupeditor.group_is_empty}}
+{{/if}}
 </div>
 <div id="group-members-end"></div>
 <hr id="group-separator" />