]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Move suppress_tags config to template
[friendica.git] / include / conversation.php
index 5a18e4d201bf8879531ba73a9df6b6137ccf0de2..c473d011bed138ff10c20ea1e8c51d1ea6cacfc6 100644 (file)
@@ -21,8 +21,6 @@ use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Temporal;
 use Friendica\Util\XML;
 
-require_once "include/acl_selectors.php";
-
 function item_extract_images($body) {
 
        $saved_image = [];
@@ -445,7 +443,7 @@ These Fields are not added below (yet). They are here to for bug search.
        return "`item`.`author-id`, `item`.`author-link`, `item`.`author-name`, `item`.`author-avatar`,
                `item`.`owner-id`, `item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`,
                `item`.`contact-id`, `item`.`uid`, `item`.`id`, `item`.`parent`,
-               `item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`,
+               `item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`content-warning`,
                `item`.`commented`, `item`.`created`, `item`.`edited`, `item`.`received`,
                `item`.`verb`, `item`.`object-type`, `item`.`postopts`, `item`.`plink`,
                `item`.`guid`, `item`.`wall`, `item`.`private`, `item`.`starred`,
@@ -905,7 +903,13 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
  * @return array items with parents and comments
  */
 function conversation_add_children($parents, $block_authors, $order) {
-       $max_comments = Config::get("system", "max_comments", 100);
+       $max_comments = Config::get('system', 'max_comments', 100);
+
+       if ($max_comments > 0) {
+               $limit = ' LIMIT '.intval($max_comments + 1);
+       } else {
+               $limit = '';
+       }
 
        $items = [];
 
@@ -914,7 +918,7 @@ function conversation_add_children($parents, $block_authors, $order) {
        foreach ($parents AS $parent) {
                $thread_items = dba::p(item_query()." AND `item`.`uid` = ?
                        AND `item`.`parent-uri` = ? $block_sql
-                       ORDER BY `item`.`commented` DESC LIMIT ".intval($max_comments + 1),
+                       ORDER BY `item`.`commented` DESC" . $limit,
                        local_user(),
                        $parent['uri']
                );
@@ -1241,7 +1245,7 @@ function format_like($cnt, array $arr, $type, $id) {
                                break;
                        case 'attendmaybe':
                                $phrase = L10n::t('<span  %1$s>%2$d people</span> attend maybe', $spanatts, $cnt);
-                               $explikers = L10n::t('%s anttend maybe.', $likers);
+                               $explikers = L10n::t('%s attend maybe.', $likers);
                                break;
                }
 
@@ -1639,7 +1643,7 @@ function get_responses($conv_responses, $response_verbs, $ob, $item) {
        foreach ($response_verbs as $v) {
                $ret[$v] = [];
                $ret[$v]['count'] = defaults($conv_responses[$v], $item['uri'], '');
-               $ret[$v]['list']  = defaults($conv_responses[$v], $item['uri'] . '-l', '');
+               $ret[$v]['list']  = defaults($conv_responses[$v], $item['uri'] . '-l', []);
                $ret[$v]['self']  = defaults($conv_responses[$v], $item['uri'] . '-self', '0');
                if (count($ret[$v]['list']) > MAX_LIKERS) {
                        $ret[$v]['list_part'] = array_slice($ret[$v]['list'], 0, MAX_LIKERS);