From df547a8bc98f494c42e21a6fef3bbc59da0490c4 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 10 Nov 2017 18:22:28 +0100 Subject: [PATCH 1/5] move HTML from mod/community into template file --- view/templates/community.tpl | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 view/templates/community.tpl diff --git a/view/templates/community.tpl b/view/templates/community.tpl new file mode 100644 index 0000000000..eb96fabb4d --- /dev/null +++ b/view/templates/community.tpl @@ -0,0 +1,7 @@ +

{{$header}}

+ +{{if $show_global_community_hint}} +

{{$global_community_hint}}

+{{/if}} + +{{$content}} From 3948539495b8193ee84786c2d3196cf1037ff554 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 10 Nov 2017 20:24:05 +0100 Subject: [PATCH 2/5] add docs for the show_global_community_hint option --- doc/htconfig.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/htconfig.md b/doc/htconfig.md index 6ebf1086fe..8c3e0b9c5d 100644 --- a/doc/htconfig.md +++ b/doc/htconfig.md @@ -87,6 +87,7 @@ Example: To set the directory value please add this line to your .htconfig.php: * **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one. * **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones. * **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones. +* **show_global_community_hint** (Bbolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node. * **throttle_limit_day** - Maximum number of posts that a user can send per day with the API. * **throttle_limit_week** - Maximum number of posts that a user can send per week with the API. * **throttle_limit_month** - Maximum number of posts that a user can send per month with the API. From 3e1d0bf7a8c2ada66a7c6b723e2398c337a27e93 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 10 Nov 2017 20:25:17 +0100 Subject: [PATCH 3/5] move HTML to template and add an optional hint that a global community page shows all arriving public postings --- mod/community.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mod/community.php b/mod/community.php index d428bddf8c..7a299357be 100644 --- a/mod/community.php +++ b/mod/community.php @@ -28,8 +28,6 @@ function community_content(App $a, $update = 0) { require_once('include/security.php'); require_once('include/conversation.php'); - - $o .= '

' . t('Community') . '

'; if (! $update) { nav_set_selected('community'); } @@ -83,9 +81,15 @@ function community_content(App $a, $update = 0) { $o .= conversation($a, $s, 'community', $update); - $o .= alt_pager($a, count($r)); + $o .= alt_pager($a, count($r)); - return $o; + $t = get_markup_template( "community.tpl" ); + return replace_macros($t, array( + '$content' => $o, + '$header' => t("Community"), + '$show_global_community_hint' => (Config::get('system', 'community_page_style') == CP_GLOBAL_COMMUNITY && Config::get('system', 'show_global_community_hint')), + '$global_community_hint' => t("This comunity stream shows all public messages arriving on this node. They do not reflect the opinion of the nodes users.") + )); } function community_getitems($start, $itemspage) { From 4f95b413fa3b4ef91afe4cf2e446c66cc944033b Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 10 Nov 2017 20:57:02 +0100 Subject: [PATCH 4/5] some corrections --- doc/htconfig.md | 2 +- mod/community.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/htconfig.md b/doc/htconfig.md index 8c3e0b9c5d..684be22fbc 100644 --- a/doc/htconfig.md +++ b/doc/htconfig.md @@ -87,7 +87,7 @@ Example: To set the directory value please add this line to your .htconfig.php: * **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one. * **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones. * **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones. -* **show_global_community_hint** (Bbolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node. +* **show_global_community_hint** (Boolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node. * **throttle_limit_day** - Maximum number of posts that a user can send per day with the API. * **throttle_limit_week** - Maximum number of posts that a user can send per week with the API. * **throttle_limit_month** - Maximum number of posts that a user can send per month with the API. diff --git a/mod/community.php b/mod/community.php index 7a299357be..14767b67c9 100644 --- a/mod/community.php +++ b/mod/community.php @@ -83,12 +83,12 @@ function community_content(App $a, $update = 0) { $o .= alt_pager($a, count($r)); - $t = get_markup_template( "community.tpl" ); + $t = get_markup_template("community.tpl"); return replace_macros($t, array( '$content' => $o, '$header' => t("Community"), '$show_global_community_hint' => (Config::get('system', 'community_page_style') == CP_GLOBAL_COMMUNITY && Config::get('system', 'show_global_community_hint')), - '$global_community_hint' => t("This comunity stream shows all public messages arriving on this node. They do not reflect the opinion of the nodes users.") + '$global_community_hint' => t("“This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.”") )); } From fd2b80729229a4b72ca01bd5f50baad10b56bfac Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 10 Nov 2017 22:00:39 +0100 Subject: [PATCH 5/5] halfe the double --- mod/community.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/community.php b/mod/community.php index 14767b67c9..df21263278 100644 --- a/mod/community.php +++ b/mod/community.php @@ -88,7 +88,7 @@ function community_content(App $a, $update = 0) { '$content' => $o, '$header' => t("Community"), '$show_global_community_hint' => (Config::get('system', 'community_page_style') == CP_GLOBAL_COMMUNITY && Config::get('system', 'show_global_community_hint')), - '$global_community_hint' => t("“This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.”") + '$global_community_hint' => t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.") )); }