summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-01-16 18:44:49 +0000
committerDries Buytaert <dries@buytaert.net>2005-01-16 18:44:49 +0000
commit971a0e24aa6344da7ae07f476ed3fb371bd744d0 (patch)
tree130b8c7e3e374b5edb7fa9ed91a80b890ab4275e /modules/comment/comment.module
parentb04d46df4dfae84eab09f3f8a7f06cf462452711 (diff)
downloadbrdo-971a0e24aa6344da7ae07f476ed3fb371bd744d0.tar.gz
brdo-971a0e24aa6344da7ae07f476ed3fb371bd744d0.tar.bz2
- Patch #14731 by chx: made it possible to rewrite node queries.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index e7529b411..521cf8b08 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -157,7 +157,7 @@ function comment_block($op = 'list', $delta = 0) {
return $blocks;
}
else if ($op == 'view' && user_access('access comments')) {
- $result = db_query_range('SELECT * FROM {comments} WHERE status = 0 ORDER BY timestamp DESC', 0, 10);
+ $result = db_query_range(node_rewrite_sql('SELECT c.nid,c.* FROM {comments} c WHERE status = 0 ORDER BY timestamp DESC', 'c'), 0, 10);
$items = array();
while ($comment = db_fetch_object($result)) {
$items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp)));
@@ -1286,7 +1286,6 @@ function comment_save_settings() {
global $user;
$edit = $_POST['edit'];
-
// this functions perform doubletime: it either saves the
// user's comment viewing options, or it handles comment
// moderation. let's figure out which one we're using, eh?
@@ -1302,7 +1301,6 @@ function comment_save_settings() {
$_SESSION['comment_threshold'] = $threshold;
$_SESSION['comment_comments_per_page'] = $comments_per_page;
}
-
drupal_goto('node/'. $edit['nid'] .'#comment');
}