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
Comment #1
thinkyhead commentedCheck 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))Comment #2
thinkyhead commentedAha, never mind the SQL. You can use
$count = comment_num_all($node->nid)instead!Comment #3
neclimdulcomment_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:
Comment #4
marcopanichi commentedin D7 use $node->comment_count