diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-07-08 10:47:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-07-08 10:47:26 +0000 |
commit | 3d1f760d9727d620abe9d69806e31e47e2a712f5 (patch) | |
tree | 0f16afd655074f241adfe3c6a456147997162a62 | |
parent | 448506a85a8d7386c61ce4d28332c97119d12d4a (diff) | |
download | brdo-3d1f760d9727d620abe9d69806e31e47e2a712f5.tar.gz brdo-3d1f760d9727d620abe9d69806e31e47e2a712f5.tar.bz2 |
* 2 small bugfixes
* I'll try to update my 2nd theme later this weekend
-- Dries
-rw-r--r-- | submission.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/submission.inc b/submission.inc index 8dc60e3c8..34e45844b 100644 --- a/submission.inc +++ b/submission.inc @@ -20,7 +20,7 @@ function submission_vote($id, $vote, $comment) { db_query("UPDATE stories SET score = score $vote, votes = votes + 1 WHERE id = $id"); ### Update the comments (if required): - db_query("INSERT INTO comments (sid, subject, comment, hostname, timestamp) VALUES($id, '". addslashes(substr($comment, 0, 29)) ." ...', '". addslashes($comment) ."', '". getenv("REMOTE_ADDR") ."', '". time() ."')"); + if ($comment) db_query("INSERT INTO comments (sid, subject, comment, hostname, timestamp) VALUES($id, '". addslashes(substr($comment, 0, 29)) ." ...', '". addslashes($comment) ."', '". getenv("REMOTE_ADDR") ."', '". time() ."')"); ### Update user's history record: $user->setHistory("s$id", "$vote"); // s = submission @@ -29,8 +29,8 @@ function submission_vote($id, $vote, $comment) { ### Update story table (if required): $result = db_query("SELECT * FROM stories WHERE id = $id"); if ($submission = db_fetch_object($result)) { -# if ($submission->score >= $submission_post_threshold) db_query("UPDATE stories SET status = 2, timestamp = '". time() ."' WHERE id = $id"); -# if ($submission->score <= $submission_dump_threshold) db_query("UPDATE stories SET status = 0, timestamp = '". time() ."' WHERE id = $id"); + if ($submission->score >= $submission_post_threshold) db_query("UPDATE stories SET status = 2, timestamp = '". time() ."' WHERE id = $id"); + if ($submission->score <= $submission_dump_threshold) db_query("UPDATE stories SET status = 0, timestamp = '". time() ."' WHERE id = $id"); } } } |