X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcommunity.php;h=59be7487bdca55a8318410b80e4eeab16f2dc199;hb=55eb0100e6db28d7df1487b856846dbb03daee2f;hp=29fcd447944fc2020362f0099038155be2fceb67;hpb=4949be60a899105aa7f125227f2767af87afceb2;p=friendica.git diff --git a/mod/community.php b/mod/community.php index 29fcd44794..59be7487bd 100644 --- a/mod/community.php +++ b/mod/community.php @@ -2,8 +2,10 @@ /** * @file mod/community.php */ + use Friendica\App; use Friendica\Content\Nav; +use Friendica\Core\ACL; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -28,6 +30,11 @@ function community_content(App $a, $update = 0) $page_style = Config::get('system', 'community_page_style'); + if ($page_style == CP_NO_INTERNAL_COMMUNITY) { + notice(L10n::t('Access denied.') . EOL); + return; + } + if ($a->argc > 1) { $content = $a->argv[1]; } else { @@ -63,7 +70,6 @@ function community_content(App $a, $update = 0) } } - require_once 'include/bbcode.php'; require_once 'include/security.php'; require_once 'include/conversation.php'; @@ -72,7 +78,7 @@ function community_content(App $a, $update = 0) if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system', 'singleuser'))) { $tabs[] = [ - 'label' => L10n::t('Community'), + 'label' => L10n::t('Local Community'), 'url' => 'community/local', 'sel' => $content == 'local' ? 'active' : '', 'title' => L10n::t('Posts from local users on this server'), @@ -83,10 +89,10 @@ function community_content(App $a, $update = 0) if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) { $tabs[] = [ - 'label' => L10n::t('Global Timeline'), + 'label' => L10n::t('Global Community'), 'url' => 'community/global', 'sel' => $content == 'global' ? 'active' : '', - 'title' => L10n::t('Posts from users of the federated network'), + 'title' => L10n::t('Posts from users of the whole federated network'), 'id' => 'community-global-tab', 'accesskey' => 'g' ]; @@ -105,7 +111,7 @@ function community_content(App $a, $update = 0) 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], 'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'), - 'acl' => populate_acl($a->user, true), + 'acl' => ACL::getFullSelectorHTML($a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), @@ -165,7 +171,7 @@ function community_content(App $a, $update = 0) $s = $r; } - $o .= conversation($a, $s, 'community', $update); + $o .= conversation($a, $s, 'community', $update, false, 'commented', local_user()); if (!$update) { $o .= alt_pager($a, count($r)); @@ -194,7 +200,8 @@ function community_getitems($start, $itemspage, $content) } elseif ($content == 'global') { $r = dba::p("SELECT `uri` FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid` - WHERE `thread`.`uid` = 0 + INNER JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id` + WHERE `thread`.`uid` = 0 AND NOT `author`.`hidden` AND NOT `author`.`blocked` ORDER BY `thread`.`commented` DESC LIMIT " . intval($start) . ", " . intval($itemspage)); return dba::inArray($r); }