]> git.mxchange.org Git - friendica.git/commitdiff
Make the community pages available to local users every time
authorMichael <heluecht@pirati.ca>
Wed, 3 Jan 2018 14:49:22 +0000 (14:49 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 3 Jan 2018 14:49:22 +0000 (14:49 +0000)
mod/admin.php
mod/community.php
src/Module/Global.php

index bef912cd50d9cafd09131b348c9affd4c5423874..f9cd9c25b10d71e1e220eb2d1f8b6dca7926cf51 100644 (file)
@@ -1312,7 +1312,7 @@ function admin_page_site(App $a)
                '$no_multi_reg'         => array('no_multi_reg', t("Block multiple registrations"),  Config::get('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")),
                '$no_openid'            => array('no_openid', t("OpenID support"), !Config::get('system','no_openid'), t("OpenID support for registration and logins.")),
                '$no_regfullname'       => array('no_regfullname', t("Fullname check"), !Config::get('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")),
-               '$community_page_style' => array('community_page_style', t("Community Page Style"), Config::get('system','community_page_style'), t("Type of community page to show. 'Global community' shows every public posting from an open distributed network that arrived on this server."), $community_page_style_choices),
+               '$community_page_style' => array('community_page_style', t("Community pages for visitors"), Config::get('system','community_page_style'), t("Which community pages should be shown to visitors. Local users always see both pages. 'Global community' shows every public posting from an open distributed network that arrived on this server."), $community_page_style_choices),
                '$max_author_posts_community_page' => array('max_author_posts_community_page', t("Posts per user on community page"), Config::get('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")),
                '$ostatus_disabled'     => array('ostatus_disabled', t("Enable OStatus support"), !Config::get('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")),
                '$ostatus_full_threads' => array('ostatus_full_threads', t("Only import OStatus threads from our contacts"), Config::get('system','ostatus_full_threads'), t("Normally we import every content from our OStatus contacts. With this option we only store threads that are started by a contact that is known on our system.")),
index 1a110a3b0571a3598b0165b9e2b6696a25142e28..f4c650ec17d4919ad16ac7cd5b74bbe7905f54f0 100644 (file)
@@ -19,7 +19,7 @@ function community_content(App $a, $update = 0) {
                return;
        }
 
-       if (!in_array(Config::get('system','community_page_style'), [CP_USERS_ON_SERVER, CP_USERS_AND_GLOBAL])) {
+       if (!local_user() && !in_array(Config::get('system','community_page_style'), [CP_USERS_ON_SERVER, CP_USERS_AND_GLOBAL])) {
                notice(t('Not available.') . EOL);
                return;
        }
index 310ecd0221f4dadd3ebb5f6c832512f18ac8c143..a48ea4dc18931f91c6f4c2425ae7ed915dfeaba9 100644 (file)
@@ -36,7 +36,7 @@ class GlobalModule extends BaseModule {
                        return;
                }
 
-               if (!in_array(Config::get('system','community_page_style'), [CP_GLOBAL_COMMUNITY, CP_USERS_AND_GLOBAL])) {
+               if (!local_user() && !in_array(Config::get('system','community_page_style'), [CP_GLOBAL_COMMUNITY, CP_USERS_AND_GLOBAL])) {
                        notice(t('Not available.') . EOL);
                        return;
                }
@@ -66,37 +66,9 @@ class GlobalModule extends BaseModule {
                        return $o;
                }
 
-               $maxpostperauthor = Config::get('system','max_author_posts_community_page');
-
-               if ($maxpostperauthor != 0) {
-                       $count = 1;
-                       $previousauthor = "";
-                       $numposts = 0;
-                       $s = array();
-
-                       do {
-                               foreach ($r AS $row=>$item) {
-                                       if ($previousauthor == $item["author-link"]) {
-                                               ++$numposts;
-                                       } else {
-                                               $numposts = 0;
-                                       }
-                                       $previousauthor = $item["author-link"];
-
-                                       if (($numposts < $maxpostperauthor) && (sizeof($s) < $a->pager['itemspage'])) {
-                                               $s[] = $item;
-                                       }
-                               }
-                               if (sizeof($s) < $a->pager['itemspage']) {
-                                       $r = self::getPublicItems($a->pager['start'] + ($count * $a->pager['itemspage']), $a->pager['itemspage']);
-                               }
-                       } while ((sizeof($s) < $a->pager['itemspage']) && (++$count < 50) && (sizeof($r) > 0));
-               } else {
-                       $s = $r;
-               }
                // we behave the same in message lists as the search module
 
-               $o .= conversation($a, $s, 'community', $update);
+               $o .= conversation($a, $r, 'community', $update);
 
                $o .= alt_pager($a, count($r));