- $items = [];
- if (DBM::is_result($r)) {
- foreach ($r as $rr) {
- if (!in_array($rr['item_id'], $parents_arr)) {
- $parents_arr[] = $rr['item_id'];
- }
- }
-
- $parents_str = implode(', ', $parents_arr);
-
- // splitted into separate queries to avoid the problem with very long threads
- // so always the last X comments are loaded
- // This problem can occur expecially with imported facebook posts
- $max_comments = Config::get('system', 'max_comments');
- if ($max_comments == 0) {
- $max_comments = 100;
- }