Impossible to disable comments posting to specific node by anonymous via hook_nodeapi
edhel - December 19, 2006 - 11:37
| Project: | Drupal |
| Version: | 5.0-rc1 |
| Component: | comment.module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I want to create node where only "admins" can posts, but all visitors may read these comments. I've created node and set option read/write (else admins can't post comments). Then I write such nodeapi handler:
<?php
function mymodule_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
if ($op == 'load' && $node->nid == 32 /*&& !user_access('administer comments')*/) { // commented for debug
return array('comment' => COMMENT_NODE_READ_ONLY);
}
?>Such hook hide link "add comment", but "reply" function is visible. Bug/feature? Is it impossible to make such page by standard comment.module?

#1
Closed, time out..