How to disable "Add new comment" at teaser part, but "Read more" remains

faqing - June 13, 2007 - 23:47

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?

handbook

jferjan - June 17, 2007 - 15:00

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

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

Thanks jferjan. It seems

faqing - June 19, 2007 - 11:00

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

I found this on site

jabba_29 - July 2, 2007 - 15:20

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

<?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?

Thanks Jamie! I will try it

faqing - July 6, 2007 - 00:13

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

Hi, I tried this and it

raphael_kariuki - June 3, 2008 - 13:29

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)) {

 
 

Drupal is a registered trademark of Dries Buytaert.