summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-09-18 00:04:24 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-09-18 00:04:24 +0000
commite18feedfdb429e35173b85fc7182aadabee0a166 (patch)
tree20c8e64d4db97378fad2bc27689b9b88e9390f1f /modules/comment
parent6a1217aff08d3380658ef47e0e9d9d693683c66a (diff)
downloadbrdo-e18feedfdb429e35173b85fc7182aadabee0a166.tar.gz
brdo-e18feedfdb429e35173b85fc7182aadabee0a166.tar.bz2
#564394 by Berdir and Crell: Removed database BC layer. nah nah nah nah... hey hey hey... gooood byeeee...
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.install15
-rw-r--r--modules/comment/comment.module6
2 files changed, 3 insertions, 18 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 84111ce1e..1b63d4aa3 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -46,21 +46,6 @@ function comment_enable() {
}
/**
- * Changed node_comment_statistics to use node->changed to avoid future timestamps.
- */
-function comment_update_1() {
- // Change any future last comment timestamps to current time.
- db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d', REQUEST_TIME, REQUEST_TIME);
-
- // Unstuck node indexing timestamp if needed.
- if (($last = variable_get('node_cron_last', FALSE)) !== FALSE) {
- variable_set('node_cron_last', min(REQUEST_TIME, $last));
- }
-
- return array();
-}
-
-/**
* @defgroup updates-6.x-to-7.x Comment updates from 6.x to 7.x
* @{
*/
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 164ef195b..e02f964f4 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -435,7 +435,7 @@ function comment_new_page_count($num_comments, $new_replies, $node) {
WHERE nid = :nid
AND status = 0
ORDER BY timestamp DESC) AS thread
- ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1))', array(':nid' => $node->nid), 0, $new_replies)->fetchField();
+ ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1))', 0, $new_replies, array(':nid' => $node->nid))->fetchField();
$thread = substr($result, 0, -1);
$count = db_query('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < :thread', array(
':nid' => $node->nid,
@@ -2240,10 +2240,10 @@ function _comment_update_node_statistics($nid) {
if ($count > 0) {
// Comments exist.
- $last_reply = db_query_range('SELECT cid, name, timestamp, uid FROM {comment} WHERE nid = :nid AND status = :status ORDER BY cid DESC', array(
+ $last_reply = db_query_range('SELECT cid, name, timestamp, uid FROM {comment} WHERE nid = :nid AND status = :status ORDER BY cid DESC', 0, 1, array(
':nid' => $nid,
':status' => COMMENT_PUBLISHED,
- ), 0, 1)->fetchObject();
+ ))->fetchObject();
db_update('node_comment_statistics')
->fields( array(
'comment_count' => $count,