When I was using 4.7.x version I just implemented the following changes to comments.module to simply remove the ‘reply’ link from the user the comments.

Before:
$links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid");

After:
// $links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid");

But looking at the codes in 5.0, it’s different from the above, anyone know what I need to omit out exactly to remove the ‘reply’ button on user comments, on the code below? I don't want to break the drupal!

if (node_comment_mode($comment->nid) == COMMENT_NODE_READ_WRITE) {
    if (user_access('administer comments') && user_access('post comments')) {
      $links['comment_delete'] = array(
        'title' => t('delete'),
        'href' => "comment/delete/$comment->cid"
      );
      $links['comment_edit'] = array(
        'title' => t('edit'),
        'href' => "comment/edit/$comment->cid"
      );
      $links['comment_reply'] = array(
        'title' => t('reply'),
        'href' => "comment/reply/$comment->nid/$comment->cid"
      );
    }
    else if (user_access('post comments')) {
      if (comment_access('edit', $comment)) {
        $links['comment_edit'] = array(
          'title' => t('edit'),
          'href' => "comment/edit/$comment->cid"
        );
      }
      $links['comment_reply'] = array(
        'title' => t('reply'),
        'href' => "comment/reply/$comment->nid/$comment->cid"
      );
    }

Thanks!

Comments

binodc’s picture

First part of code for admin view

if (node_comment_mode($comment->nid) == COMMENT_NODE_READ_WRITE) {
 if (user_access('administer comments') && user_access('post comments')) {
  $links['comment_delete'] = array(  'title' => t('delete'),  'href' => "comment/delete/$comment->cid"  );
  $links['comment_edit'] = array(  'title' => t('edit'),  'href' => "comment/edit/$comment->cid"  );
  $links['comment_reply'] = array(  'title' => t('reply'),  'href' => "comment/reply/$comment->nid/$comment->cid"  ); 
 }

Second part is for Users view

 else if (user_access('post comments')) {
  if (comment_access('edit', $comment)) {
   $links['comment_edit'] = array(   'title' => t('edit'),   'href' => "comment/edit/$comment->cid"   );
  }
 $links['comment_reply'] = array( 'title' => t('reply'), 'href' => "comment/reply/$comment->nid/$comment->cid" );
}

The line your looking for is in second part

$links['comment_reply'] = array( 'title' => t('reply'), 'href' => "comment/reply/$comment->nid/$comment->cid" );