diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-02-17 15:38:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-02-17 15:38:37 +0000 |
commit | a60edc750826432facb57759b8d9e205f672ed8d (patch) | |
tree | 5a687d2fa165ece2dd92417614266c242c5f41b5 /includes/submission.inc | |
parent | 52a1d1bbe80422ca7a8c79dde6fd92db542b9b2d (diff) | |
download | brdo-a60edc750826432facb57759b8d9e205f672ed8d.tar.gz brdo-a60edc750826432facb57759b8d9e205f672ed8d.tar.bz2 |
- improved the "menu" hook
- replaced the "open submission queue" (submission.php and submission.inc)
with an optional module (submission.module).
- tidied up the HTML code of some files
Diffstat (limited to 'includes/submission.inc')
-rw-r--r-- | includes/submission.inc | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/includes/submission.inc b/includes/submission.inc deleted file mode 100644 index 78027c109..000000000 --- a/includes/submission.inc +++ /dev/null @@ -1,48 +0,0 @@ -<? - -function submission_count() { - $result = db_query("SELECT COUNT(id) FROM stories WHERE status = 1"); - return ($result) ? db_result($result, 0) : 0; -} - -function submission_score($id) { - $result = db_query("SELECT score FROM stories WHERE id = $id"); - return ($result) ? db_result($result, 0) : 0; -} - -function submission_vote($id, $vote, $comment) { - global $user; - - if (!user_get_history($user->history, "s$id")) { - // Update submission's score- and votes-field: - db_query("UPDATE stories SET score = score $vote, votes = votes + 1 WHERE id = $id"); - - // Update the comments (if required): - if ($comment) { - db_query("INSERT INTO comments (lid, link, author, subject, comment, hostname, timestamp, score) VALUES($id, 'story', $user->id, '". check_input(substr($comment, 0, 29)) ." ...', '". check_input($comment) ."', '". getenv("REMOTE_ADDR") ."', '". time() ."', '1')"); - watchdog("comment", "moderation: added comment with subject '$subject'"); - } - - // Update user's history record: - user_set_history("s$id", $vote); - - // Update story table (if required): - $result = db_query("SELECT * FROM stories WHERE id = $id"); - if ($submission = db_fetch_object($result)) { - if (section_post_threshold($submission->section) <= $submission->score) { - db_query("UPDATE stories SET status = 2, timestamp = '". time() ."' WHERE id = $id"); - watchdog("message", "posted story '$submission->subject'"); - } - else if (section_dump_threshold($submission->section) >= $submission->score) { - db_query("UPDATE stories SET status = 0, timestamp = '". time() ."' WHERE id = $id"); - watchdog("message", "dumped story '$submission->subject'"); - } - else if (section_timout_threshold($submission->section) <= $submission->votes) { - db_query("UPDATE stories SET status = 0, timestamp = '". time() ."' WHERE id = $id"); - watchdog("message", "expired story '$submission->subject'"); - } - } - } -} - -?>
\ No newline at end of file |