* Type of the community page
* @{
*/
-define('CP_NO_COMMUNITY_PAGE', -1);
-define('CP_USERS_ON_SERVER', 0);
-define('CP_GLOBAL_COMMUNITY', 1);
-define('CP_USERS_AND_GLOBAL', 2);
+define('CP_NO_INTERNAL_COMMUNITY', -2);
+define('CP_NO_COMMUNITY_PAGE', -1);
+define('CP_USERS_ON_SERVER', 0);
+define('CP_GLOBAL_COMMUNITY', 1);
+define('CP_USERS_AND_GLOBAL', 2);
/**
* @}
*/
/* Community page style */
$community_page_style_choices = [
+ CP_NO_INTERNAL_COMMUNITY => L10n::t("No community page for local users"),
CP_NO_COMMUNITY_PAGE => L10n::t("No community page"),
CP_USERS_ON_SERVER => L10n::t("Public postings from users of this site"),
CP_GLOBAL_COMMUNITY => L10n::t("Public postings from the federated network"),
}
}
- if (local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) {
+ if ((local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) &&
+ !(Config::get('system', 'community_page_style') == CP_NO_INTERNAL_COMMUNITY)) {
$nav['community'] = ['community', L10n::t('Community'), '', L10n::t('Conversations on this and other servers')];
}
public static function addShadow($itemid)
{
$fields = ['uid', 'wall', 'private', 'moderated', 'visible', 'contact-id', 'deleted', 'network', 'author-id', 'owner-id'];
- $condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
+ $condition = ['id' => $itemid, 'parent' => [0, $itemid]];
$item = dba::selectFirst('item', $fields, $condition);
if (!DBM::is_result($item)) {
return;
}
- // Only do these checks if the post isn't a wall post
- if (!$item["wall"]) {
- // Check, if hide-friends is activated - then don't do a shadow entry
- if (dba::exists('profile', ['is-default' => true, 'uid' => $item['uid'], 'hide-friends' => true])) {
- return;
- }
-
- // Check if the contact is hidden or blocked
- if (!dba::exists('contact', ['hidden' => false, 'blocked' => false, 'id' => $item['contact-id']])) {
- return;
- }
- }
-
- // Only add a shadow, if the profile isn't hidden
- if (dba::exists('user', ['uid' => $item['uid'], 'hidewall' => true])) {
- return;
- }
-
$item = dba::selectFirst('item', [], ['id' => $itemid]);
- if (DBM::is_result($item) && ($item["allow_cid"] == '') && ($item["allow_gid"] == '') &&
+ if (DBM::is_result($item) && ($item["allow_cid"] == '') && ($item["allow_gid"] == '') &&
($item["deny_cid"] == '') && ($item["deny_gid"] == '')) {
if (!dba::exists('item', ['uri' => $item['uri'], 'uid' => 0])) {