From bd54358aa6bfe90bfbc8aed7baf3a8110d6e45ba Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 20 Sep 2014 16:31:56 +0200 Subject: show bookmarks menu only if we have any bookmarks already --- include/conversation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 05ae72d61..8f1767482 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1556,7 +1556,9 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ ); } - if($is_owner) { + require_once('include/menu.php'); + $has_bookmarks = menu_list_count(local_user(),'',MENU_BOOKMARK) + menu_list_count(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK); + if($is_owner && $has_bookmarks) { $tabs[] = array( 'label' => t('Bookmarks'), 'url' => $a->get_baseurl() . '/bookmarks', -- cgit v1.2.3 From 6c806f6f48fc7efe5fda380f2f9edb9a7dc09cab Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 20 Sep 2014 17:28:42 +0200 Subject: aalso change the way we check for number of chatrooms --- include/conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 8f1767482..6e56782dd 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1545,8 +1545,8 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ } require_once('include/chat.php'); - $chats = chatroom_list($uid); - if (count($chats)) { + $has_chats = chatroom_list_count($uid); + if (count($has_chats)) { $tabs[] = array( 'label' => t('Chatrooms'), 'url' => $a->get_baseurl() . '/chat/' . $nickname, -- cgit v1.2.3 From 69a10e8ca737a5848dd888879b32a95fa7267ad5 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 20 Sep 2014 17:30:11 +0200 Subject: oups... --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 6e56782dd..be5267207 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1546,7 +1546,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ require_once('include/chat.php'); $has_chats = chatroom_list_count($uid); - if (count($has_chats)) { + if ($has_chats) { $tabs[] = array( 'label' => t('Chatrooms'), 'url' => $a->get_baseurl() . '/chat/' . $nickname, -- cgit v1.2.3