Skip to content
Snippets Groups Projects
Commit 3d1f760d authored by Dries Buytaert's avatar Dries Buytaert
Browse files

* 2 small bugfixes
* I'll try to update my 2nd theme later this weekend

-- Dries
parent 448506a8
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -20,7 +20,7 @@ function submission_vote($id, $vote, $comment) { ...@@ -20,7 +20,7 @@ function submission_vote($id, $vote, $comment) {
db_query("UPDATE stories SET score = score $vote, votes = votes + 1 WHERE id = $id"); db_query("UPDATE stories SET score = score $vote, votes = votes + 1 WHERE id = $id");
### Update the comments (if required): ### 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: ### Update user's history record:
$user->setHistory("s$id", "$vote"); // s = submission $user->setHistory("s$id", "$vote"); // s = submission
...@@ -29,8 +29,8 @@ function submission_vote($id, $vote, $comment) { ...@@ -29,8 +29,8 @@ function submission_vote($id, $vote, $comment) {
### Update story table (if required): ### Update story table (if required):
$result = db_query("SELECT * FROM stories WHERE id = $id"); $result = db_query("SELECT * FROM stories WHERE id = $id");
if ($submission = db_fetch_object($result)) { 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_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_dump_threshold) db_query("UPDATE stories SET status = 0, timestamp = '". time() ."' WHERE id = $id");
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment