]> git.mxchange.org Git - friendica.git/commitdiff
Different comment limits for single view
authorMichael <heluecht@pirati.ca>
Tue, 16 Jun 2020 06:49:53 +0000 (06:49 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 16 Jun 2020 06:49:53 +0000 (06:49 +0000)
include/conversation.php
src/Module/Admin/Site.php
view/templates/admin/site.tpl
view/theme/frio/templates/admin/site.tpl

index e623c9320bf911e3fb5a457f1adb58f9caeade0e..6e024fe20f1cb72a1c14e6c8dc10aaefc8a88010 100644 (file)
@@ -760,7 +760,11 @@ function conversation_fetch_comments($thread_items, $pinned) {
  * @throws \Friendica\Network\HTTPException\InternalServerErrorException
  */
 function conversation_add_children(array $parents, $block_authors, $order, $uid) {
-       $max_comments = DI::config()->get('system', 'max_comments', 100);
+       if (count($parents) > 1) {
+               $max_comments = DI::config()->get('system', 'max_comments', 100);
+       } else {
+               $max_comments = DI::config()->get('system', 'max_display_comments', 1000);
+       }
 
        $params = ['order' => ['uid', 'commented' => true]];
 
index 8dcddb188e25bd02c3a5d47aa6fd5e8c5d97138c..124b21c28a7a2a798b5d3de5bb7d553fba877535 100644 (file)
@@ -199,6 +199,7 @@ class Site extends BaseAdmin
                $itemcache              = (!empty($_POST['itemcache'])              ? Strings::escapeTags(trim($_POST['itemcache']))  : '');
                $itemcache_duration     = (!empty($_POST['itemcache_duration'])     ? intval($_POST['itemcache_duration'])            : 0);
                $max_comments           = (!empty($_POST['max_comments'])           ? intval($_POST['max_comments'])                  : 0);
+               $max_display_comments   = (!empty($_POST['max_display_comments'])   ? intval($_POST['max_display_comments'])          : 0);
                $temppath               = (!empty($_POST['temppath'])               ? Strings::escapeTags(trim($_POST['temppath']))   : '');
                $singleuser             = (!empty($_POST['singleuser'])             ? Strings::escapeTags(trim($_POST['singleuser'])) : '');
                $proxy_disabled         = !empty($_POST['proxy_disabled']);
@@ -407,6 +408,7 @@ class Site extends BaseAdmin
                DI::config()->set('system', 'itemcache', $itemcache);
                DI::config()->set('system', 'itemcache_duration', $itemcache_duration);
                DI::config()->set('system', 'max_comments', $max_comments);
+               DI::config()->set('system', 'max_display_comments', $max_display_comments);
 
                if ($temppath != '') {
                        $temppath = BasePath::getRealPath($temppath);
@@ -695,6 +697,7 @@ class Site extends BaseAdmin
                        '$itemcache'              => ['itemcache', DI::l10n()->t('Path to item cache'), DI::config()->get('system', 'itemcache'), DI::l10n()->t('The item caches buffers generated bbcode and external images.')],
                        '$itemcache_duration'     => ['itemcache_duration', DI::l10n()->t('Cache duration in seconds'), DI::config()->get('system', 'itemcache_duration'), DI::l10n()->t('How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.')],
                        '$max_comments'           => ['max_comments', DI::l10n()->t('Maximum numbers of comments per post'), DI::config()->get('system', 'max_comments'), DI::l10n()->t('How much comments should be shown for each post? Default value is 100.')],
+                       '$max_display_comments'   => ['max_display_comments', DI::l10n()->t('Maximum numbers of comments per post on the display page'), DI::config()->get('system', 'max_display_comments'), DI::l10n()->t('How much comments should be shown on the single view for each post? Default value is 1000.')],
                        '$temppath'               => ['temppath', DI::l10n()->t('Temp path'), DI::config()->get('system', 'temppath'), DI::l10n()->t('If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.')],
                        '$proxy_disabled'         => ['proxy_disabled', DI::l10n()->t('Disable picture proxy'), DI::config()->get('system', 'proxy_disabled'), DI::l10n()->t('The picture proxy increases performance and privacy. It shouldn\'t be used on systems with very low bandwidth.')],
                        '$only_tag_search'        => ['only_tag_search', DI::l10n()->t('Only search in tags'), DI::config()->get('system', 'only_tag_search'), DI::l10n()->t('On large systems the text search can slow down the system extremely.')],
index cb948aabe67645e26b04e8e3fe17d5b44d1310a0..dc76db31c559c659cd4528ef15bc8e799bec07af 100644 (file)
                {{include file="field_input.tpl" field=$itemcache}}
                {{include file="field_input.tpl" field=$itemcache_duration}}
                {{include file="field_input.tpl" field=$max_comments}}
+               {{include file="field_input.tpl" field=$max_display_comments}}
                {{include file="field_checkbox.tpl" field=$proxy_disabled}}
                {{include file="field_checkbox.tpl" field=$dbclean}}
                {{include file="field_input.tpl" field=$dbclean_expire_days}}
index 652fe91c337f91257f843e116ce8d977b83a7e14..5c9cfb1981b22060fa687b0fc0eb5200162a724a 100644 (file)
                                                {{include file="field_input.tpl" field=$itemcache}}
                                                {{include file="field_input.tpl" field=$itemcache_duration}}
                                                {{include file="field_input.tpl" field=$max_comments}}
+                                               {{include file="field_input.tpl" field=$max_display_comments}}
                                                {{include file="field_checkbox.tpl" field=$proxy_disabled}}
                                                {{include file="field_checkbox.tpl" field=$dbclean}}
                                                {{include file="field_input.tpl" field=$dbclean_expire_days}}