Support / Feature request:

My client asked me to display the known 'login or register to post comments' link, displayed in the bottom of nodes any comments-enabled drupal site, only when the full node is displayed, not in the teaser node-list view.

I am using Phptemplate. Drupal version: 4.6.1. Web server: apache. Browsers: IE/Firefox.

I've tried to modify links.tpl.php, or to override the phptemplate_comment_post_forbidden() function, or to override the phptemplate_links function - but I get into the same problem : how do I tell if this is the full node or the teaser or the main links?

Or is there a better way to solve the issue?

Please advise.

This may also be posted as a feature request (optional flag) for future versions of the comments module.

Thanks

Amnon
-
Personal: Bring Dolphin's Simple Joy to your Work - Job - Career
Professional: Small business web hosting strategies, Drupal Hebrew Hosting

Comments

druvision’s picture

I've also added it as a theme support request.

druvision’s picture

Title: make 'login or register to post comments' placement optional » Optionally, the add comment link should be hidden in the node listings
Status: Active » Needs review

Revised feature request:

Optionally, the 'add comment' link (and the ('login or register to post comments' link) should be hidden in the node listings

Here is a code which does it.

No, after a long research I've found that I can't change the workflow from within the theme and that the function which does it is not themable.

Non-disclaimer: Sorry I don't know how to make a patch yet. Sorry if my PHP style is not drupal-correct - I have alot to learn. The added lines are marked by /* AL New */ before, and /* AL End */ after them. Also, this should probably be an option.

****************************************************************************************************
* 22 Feb 2006,
* modules/comment.module, modify the comment_link function (line 201 in drupal 4.6.1 version) to only display links in the full item display
****************************************************************************************************

        else {
          if ($node->comment == 2) {
/* AL New */
if (substr ($_GET['q'], 0, 5) == 'node/') {
/* AL End */
            if (user_access('post comments')) {
              $links[] = l(t('add new comment'), "comment/reply/$node->nid",
array('title' => t('Add a new comment to this page.')));
            }
            else {
              $links[] = theme('comment_post_forbidden');
            }
/* AL New */
}
/* AL End */

magico’s picture

Version: 4.6.1 » x.y.z
Category: support » feature
Status: Needs review » Needs work
dmitrig01’s picture

Version: x.y.z » 6.x-dev
Status: Needs work » Active

please attach a patch

dpearcefl’s picture

Is there any interest or a need any longer?

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.