diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-04-20 20:33:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-04-20 20:33:28 +0000 |
commit | 3c2dc18c82fd6fc19d5e2e26bc1f28b0048f89a8 (patch) | |
tree | e8895044a66e4a2d330daa1844f8e74aba6a3025 /modules/node.module | |
parent | b85cf71962c7b0231994131258053916b9ed73cb (diff) | |
download | brdo-3c2dc18c82fd6fc19d5e2e26bc1f28b0048f89a8.tar.gz brdo-3c2dc18c82fd6fc19d5e2e26bc1f28b0048f89a8.tar.bz2 |
- Fixed bug #1545: incorrect sequence tables on PostgreSQL. Patch by Neil.
In addition, I have updated update.php so it makes the corresponding
changes for MySQL users.
Diffstat (limited to 'modules/node.module')
-rw-r--r-- | modules/node.module | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/node.module b/modules/node.module index 846b9dfff..66e083846 100644 --- a/modules/node.module +++ b/modules/node.module @@ -44,12 +44,12 @@ function node_tag_new($nid) { if ($user->uid) { $nid = check_query($nid); - $result = db_query("SELECT timestamp FROM history WHERE uid = '%d' AND nid = '%d'", $user->uid, $nid); + $result = db_query("SELECT timestamp FROM history WHERE uid = %d AND nid = %d", $user->uid, $nid); if (db_fetch_object($result)) { - db_query("UPDATE history SET timestamp = '%d' WHERE uid = '%d' AND nid = '%d'", time(), $user->uid, $nid); + db_query("UPDATE history SET timestamp = %d WHERE uid = %d AND nid = %d", time(), $user->uid, $nid); } else { - db_query("INSERT INTO history (uid, nid, timestamp) VALUES ('%d', '%d', '%d')", $user->uid, $nid, time()); + db_query("INSERT INTO history (uid, nid, timestamp) VALUES (%d, %d, %d)", $user->uid, $nid, time()); } } } @@ -61,7 +61,7 @@ function node_tag_new($nid) { function node_last_viewed($nid) { global $user; - $history = db_fetch_object(db_query("SELECT timestamp FROM history WHERE uid = '$user->uid' AND nid = '%d'", $nid)); + $history = db_fetch_object(db_query("SELECT timestamp FROM history WHERE uid = '$user->uid' AND nid = %d", $nid)); return ($history->timestamp ? $history->timestamp : 0); } @@ -77,7 +77,7 @@ function node_is_new($nid, $timestamp) { if (!isset($cache[$nid])) { if ($user->uid) { - $history = db_fetch_object(db_query("SELECT timestamp FROM history WHERE uid = '%d' AND nid = '%d'", $user->uid, $nid)); + $history = db_fetch_object(db_query("SELECT timestamp FROM history WHERE uid = %d AND nid = %d", $user->uid, $nid)); $cache[$nid] = $history->timestamp ? $history->timestamp : 0; } else { @@ -269,7 +269,7 @@ function node_save($node) { $node->created = time(); } $node->changed = time(); - $node->nid = db_next_id("node"); + $node->nid = db_next_id("node_nid"); // Prepare the query: foreach ($node as $key => $value) { @@ -472,7 +472,7 @@ function node_filter_link($text) { 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)); + $comment_mode[$nid] = db_result(db_query("SELECT comment FROM node WHERE nid = %d", $nid)); } return $comment_mode[$nid]; } |