I'm creating a custom theme and module for one of my content types. I want to show the comments link in a specific content type only if comments are turned on for the node or even globally for the content type specifically. I had originally used the following, simplified for example, in my tpl.php, which shows the link if the user has the privilege to comment. However, in my case, while I allow comments all over the site, I don't allow them on this particular content type. I want to leave the option open in case we do allow comments in the future.
<?php
if (user_access('post comments')) {
print '<a href="#">Comment</a>';
}
?>
I was hoping that the system would recognize that a user that has privilege to comment every else still doesn't have privileges to comment on this node, and the link would not show, but it seems to show to anyone that has comment privileges, regardless of node.
What should replace user_access()
?