summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-10-16 14:22:00 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-10-16 14:22:00 +0000
commit6417a6ade4192b8dd16d8fe822e6bbf21fe536a8 (patch)
tree3092778b46438c4588fd2a3addf8ee62a4b587e3
parent8a9ba77275935bf0e5ab90ed4370f9416d787a08 (diff)
downloadbrdo-6417a6ade4192b8dd16d8fe822e6bbf21fe536a8.tar.gz
brdo-6417a6ade4192b8dd16d8fe822e6bbf21fe536a8.tar.bz2
#55277 by catch and JirkaRybka: when flat comment view is used, order comments by cid (ie. original submission order) instead of timestamp (ie. last editing time order) to avoid comments jumping around when being edited
-rw-r--r--modules/comment/comment.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index de4216f84..7e3ddb751 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -315,7 +315,7 @@ function comment_get_recent($number = 10) {
if (!empty($nids)) {
// From among the comments on the nodes selected in the first query,
// find the $number most recent comments.
- $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', COMMENT_PUBLISHED, 0, $number);
+ $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.cid DESC', COMMENT_PUBLISHED, 0, $number);
while ($comment = db_fetch_object($result)) {
$comments[] = $comment;
}
@@ -1026,7 +1026,7 @@ function comment_render($node, $cid = 0) {
if ($order == COMMENT_ORDER_NEWEST_FIRST) {
if ($mode == COMMENT_MODE_FLAT_COLLAPSED || $mode == COMMENT_MODE_FLAT_EXPANDED) {
- $query .= ' ORDER BY c.timestamp DESC';
+ $query .= ' ORDER BY c.cid DESC';
}
else {
$query .= ' ORDER BY c.thread DESC';
@@ -1034,7 +1034,7 @@ function comment_render($node, $cid = 0) {
}
else if ($order == COMMENT_ORDER_OLDEST_FIRST) {
if ($mode == COMMENT_MODE_FLAT_COLLAPSED || $mode == COMMENT_MODE_FLAT_EXPANDED) {
- $query .= ' ORDER BY c.timestamp';
+ $query .= ' ORDER BY c.cid';
}
else {