Same name and namespace in other branches
- 4.6.x modules/node.module \node_comment_mode()
- 4.7.x modules/node.module \node_comment_mode()
- 5.x modules/node/node.module \node_comment_mode()
Retrieve the comment mode for the given node ID (none, read, or read/write).
File
- modules/
node/ node.module, line 1364 - The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
Code
function node_comment_mode($nid) {
static $comment_mode;
if (!isset($comment_mode[$nid])) {
$comment_mode[$nid] = db_result(db_query('SELECT comment FROM {node} WHERE nid = %d', $nid));
}
return $comment_mode[$nid];
}