hi folks, love this theme. In my audio nodes, the Number of Comments link doesn't show up. All i have is "add new comment," which takes you to the Add Comment form. I can add comments, but there i no link to view them.

This sounds like a theming issue. When I inspect the links below a node in Theme Developer I get this:
Drupal Themer Information
Parents: node.tpl.php < views-view-row-node.tpl.php < views-view-unformatted.tpl.php < views-view.tpl.php < page.tpl.php

Function called:
theme_links()
Candidate function names:
alagna_links < phptemplate_links < marinelli_links < theme_links
Duration: 0.55 ms

So do I just need to edit node.tpl.php for the theme? is there another way to do this?

THANKS

Comments

thinkyhead’s picture

Check out the function hook_link_alter. It receives the node as one of its parameters, and you can count the number of comments on the node with $count = db_result(db_query("SELECT COUNT(*) FROM {comments} WHERE nid=%d AND status=0", $node->nid))

thinkyhead’s picture

Aha, never mind the SQL. You can use $count = comment_num_all($node->nid) instead!

neclimdul’s picture

Status: Active » Closed (fixed)

comment_num_all($nid); is good. Also, check $node->links['comment_comments ']. Unfortunately its only populated if there are comments though. The format is text is formated by the following code in comment.module:

        $all = comment_num_all($node->nid);

        if ($all) {
          $links['comment_comments'] = array(
            'title' => format_plural($all, '1 comment', '@count comments'),
            'href' => "node/$node->nid",
            'attributes' => array('title' => t('Jump to the first comment of this posting.')),
            'fragment' => 'comments'
          );
marcopanichi’s picture

in D7 use $node->comment_count