People want to stop people adding comments to previews without reading the full entry: http://drupal.org/node/21538
Here is my quick solution for my site.

In function comment_configure() add:

  $form['viewing_options']['comment_no_add_with_readmore'] = array(
    '#type' => 'checkbox',
    '#title' => t('Suppress comments with readmore'),
    '#default_value' => variable_get('comment_no_add_with_readmore', false),
    '#description' => t('Stop people from adding comments when they have read only the teaser.'
		. ' If "read more" is present then remove the option to add comments.'),
  );

In comment_link() add:

/* PeterMoulding.com 20060403
	Add the option to suppress comments if there is more to read.
	*/
	$comment_no_add_with_readmore = false;
	if(variable_get('comment_no_add_with_readmore', false) == 1)
		{
		$comment_no_add_with_readmore = true;
		}

Replace:
$links[] = l(t('add new comment'), "comment/reply/$node->nid", array('title' => t('Add a new comment to this page.')), NULL, 'comment_form');
with:

						/* Copyright PeterMoulding.com 20060403
						Make function readable
						$links[] = l(t('add new comment'), "comment/reply/$node->nid", array('title' => t('Add a new comment to this page.')), NULL, 'comment_form');
						Add the option to suppress comments if there is more to read.
						*/
						if(!$comment_no_add_with_readmore or !$node->readmore)
							{
							$links[] = l(t('add new comment'), 'comment/reply/' . $node->nid,
								array('title' => t('Add a new comment to this page.')),
								NULL, 'comment_form');
							}
CommentFileSizeAuthor
#3 comment_33.patch5.85 KBpeterx
#2 comment_4.diff5.57 KBpeterx

Comments

Egon Bianchet’s picture

Version: 4.7.0-rc2 » x.y.z

Please submit a patch (howto create patches)

peterx’s picture

StatusFileSize
new5.57 KB

Here is the diff created by jdiff in jedit. There are lots of changes because I improve the formatting before changing the code.

peterx’s picture

StatusFileSize
new5.85 KB

The patch file did not look right so I used Cygwin diff.

Egon Bianchet’s picture

Status: Active » Needs review
dmitrig01’s picture

Version: x.y.z » 5.x-dev
Status: Needs review » Closed (fixed)

It needs to be open source