--- original/comment.module 2007-08-12 18:12:00.000000000 +0200 +++ comment.module 2007-08-23 21:25:24.000000000 +0200 @@ -96,6 +96,16 @@ define('COMMENT_FORM_SEPARATE_PAGE', 0); define('COMMENT_FORM_BELOW', 1); /** + * The "add new comment" link on both node and teaser + */ +define('COMMENT_TEASER_SHOW_LINK', 0); + +/** + * The "add new comment" link on node only + */ +define('COMMENT_TEASER_NO_LINK', 1); + +/** * Comments for this node are disabled. */ define('COMMENT_NODE_DISABLED', 0); @@ -341,7 +351,8 @@ function comment_link($type, $node = NUL if ($type == 'node' && $node->comment) { if ($teaser) { - // Main page: display the number of comments that have been posted. + // Teaser (i.e. main page): display the number of comments that have been posted. + // Optionally add a "post comment" link (if allowed). if (user_access('access comments')) { $all = comment_num_all($node->nid); @@ -366,7 +377,7 @@ function comment_link($type, $node = NUL } } else { - if ($node->comment == COMMENT_NODE_READ_WRITE) { + if ($node->comment == COMMENT_NODE_READ_WRITE && variable_get('comment_teaser_add_link', COMMENT_TEASER_SHOW_LINK) == COMMENT_TEASER_SHOW_LINK) { if (user_access('post comments')) { $links['comment_add'] = array( 'title' => t('Add new comment'), @@ -590,6 +601,13 @@ function comment_admin_settings() { '#options' => array(t('Display on separate page'), t('Display below post or comments')), ); + $form['posting_settings']['comment_teaser_add_link'] = array( + '#type' => 'radios', + '#title' => t('Show "add new comment" link'), + '#default_value' => variable_get('comment_teaser_add_link', COMMENT_TEASER_SHOW_LINK), + '#options' => array(t('On node and teaser'), t('On node only')), + ); + return system_settings_form($form); }