In Teaser part, I want to disable "Log in or Register Add new comment" but I want to "Read more" to display.

Can anyone help me?

Comments

jferjan’s picture

this is marked as 4.7.x, but it should help you get started

http://drupal.org/node/44708
http://drupal.org/node/134442

faqing’s picture

Thanks jferjan. It seems drupal 5 more complicated. For now, I give up.

jabba_29’s picture

You can do it this way. Add the following to template.php

function phptemplate_comment_post_forbidden($nid) {
  global $user;
  if ($user->uid) {
    return t("you can't post comments");
  }
  else {
    // we cannot use drupal_get_destination() because these links sometimes appear on /node and taxo listing pages
    if (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
      $destination = "destination=". drupal_urlencode("comment/reply/$nid#comment_form");
    }
    else {
      $destination = "destination=". drupal_urlencode("node/$nid#comment_form");
    }
    return t('Please visit the site on a PC to comment!');
  }
}

Play around with it and change to suit.....
NOTE: I didn't write this code, I found it on this site last week (can't find it now though)...

Regards

Jamie

skiFFie: home of the accessibility module?

faqing’s picture

Thanks Jamie! I tried it did not work for drupal 5. I want to control $links in teaser display.

raphael_kariuki’s picture

Hi, I tried this and it works on Drupal 5:
go to modules/comment/comment.module

Around line 320 change the line from

if ($node->comment == COMMENT_NODE_READ_WRITE){

to

if (($node->comment == COMMENT_NODE_READ_WRITE)&&(!$node->teaser)) {