diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-06-23 13:42:29 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-06-23 13:42:29 +0000 |
commit | 0544d005f5afa7eabfba3629c27b4981b6d0ebdc (patch) | |
tree | ce9e95fbe2b311545d8260c691b328906a3d2b26 /modules/node | |
parent | d1b2125be4ccf89e4ade72a890db902be3ec3051 (diff) | |
download | brdo-0544d005f5afa7eabfba3629c27b4981b6d0ebdc.tar.gz brdo-0544d005f5afa7eabfba3629c27b4981b6d0ebdc.tar.bz2 |
- Made node_comment_mode() cache the mode when possible. Patch from Marco's
sandbox.
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.module | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index f70e2173f..d575c6eb9 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -363,7 +363,11 @@ function node_filter_line($text) { } function node_comment_mode($nid) { - return db_result(db_query("SELECT comment FROM node WHERE nid = '%s'", $nid)); + static $comment_mode; + if (!isset($comment_mode[$nid])) { + $comment_mode[$nid] = db_result(db_query("SELECT comment FROM node WHERE nid = '%s'", $nid)); + } + return $comment_mode[$nid]; } function node_filter($text) { |