How can i insert a comment form between parent comment and comment replies？
I don't know if it's correct way but maybe help somebody.


    function theme_preprocess_node(&amp;$variables, $hook) {

$test_pid = array(); 
$test_cid = array();   
$keys = array_keys($variables['elements']['comments']['comments']);   

foreach ($keys as $k) {
    if (!is_numeric($k)) {
      continue;
    }
$pid = $variables['elements']['comments']['comments'][$k]['#comment']-&gt;pid;
$cid = $variables['elements']['comments']['comments'][$k]['#comment']-&gt;cid;
$test_pid[] += $pid;
$test_cid[] += $cid;
$variables['elements']['comments']['comments'][$pid]['#comment']-&gt;has_children = TRUE;    
$last = $k; 
}

// find all last children in comments
$Mcomment_children= array();
foreach($test_pid as $key=&gt;$p){
    if (in_array($p, $test_cid)) {      
         $Mcomment_children[$p] = $test_cid[$key];          
    }
  }

  foreach($Mcomment_children as $last_children){
    $variables['elements']['comments']['comments'][$last_children]['#comment']-&gt;last_children = TRUE; 
  }    
  $variables['elements']['comments']['comments'][$last]['#comment']-&gt;last = TRUE;
}

In comment template file (comment.tpl) you can close div with children last. I used display suite but it's the same.

&lt;?php if($comment-&gt;has_children !== true): ?&gt;
&lt;/&lt;?php print $ds_content_wrapper ?&gt;&gt;
  &lt;?php endif;?&gt;
  &lt;?php if($comment-&gt;last_children === true): ?&gt;
&lt;/&lt;?php print $ds_content_wrapper ?&gt;&gt;
  &lt;?php endif;?&gt;