]> git.mxchange.org Git - friendica.git/commitdiff
Improved get_comment_box
authorDomovoy <domovoy@errlock.org>
Sun, 12 Aug 2012 14:26:37 +0000 (16:26 +0200)
committerDomovoy <domovoy@errlock.org>
Sun, 12 Aug 2012 14:26:37 +0000 (16:26 +0200)
object/Item.php

index 3a2b1fd835e51d182aaabfdb0ff4a88674f85666..0ddafff2a9bf48905080d3aa0602d2aadd79db23 100644 (file)
@@ -36,9 +36,11 @@ class Item extends BaseObject {
                $this->redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $this->get_data_value('cid') ;
 
                // Prepare the children
-               foreach($data['children'] as $item) {
-                       $child = new Item($item);
-                       $this->add_child($child);
+               if(count($data['children'])) {
+                       foreach($data['children'] as $item) {
+                               $child = new Item($item);
+                               $this->add_child($child);
+                       }
                }
        }
 
@@ -280,9 +282,6 @@ class Item extends BaseObject {
                else {
                        $item_result['flatten'] = true;
                        $item_result['threaded'] = false;
-                       if(!$htis->is_toplevel()) {
-                               $item_result['comment'] = false;
-                       }
                }
                
                $result = $item_result;
@@ -479,6 +478,10 @@ class Item extends BaseObject {
         *              _ false on failure
         */
        private function get_comment_box($ww) {
+               if(!$this->is_toplevel() && !get_config('system','thread_allow')) {
+                       return '';
+               }
+               
                $comment_box = '';
                $conv = $this->get_conversation();
                $template = get_markup_template($this->get_comment_box_template());