summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/submission.inc48
-rw-r--r--includes/theme.inc7
-rw-r--r--includes/watchdog.inc4
3 files changed, 4 insertions, 55 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
diff --git a/includes/theme.inc b/includes/theme.inc
index 5791ed049..1bdff7b41 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -44,11 +44,8 @@ function theme_account($theme) {
$content .= "<P>\n";
}
- $content .= "<LI><A HREF=\"submission.php\">". t("submission queue") ."</A> (<FONT COLOR=\"red\">". submission_number() ."</FONT>)</LI>\n";
- $content .= "<P>\n";
-
- if ($menu && ksort($menu)) {
- foreach ($menu as $link=>$url) $content .= "<LI><A HREF=\"$url\">". t($link) ."</A></LI>\n";
+ if ($menu) {
+ foreach ($menu as $link) $content .= "<LI>$link</LI>\n";
$content .= "<P>\n";
}
diff --git a/includes/watchdog.inc b/includes/watchdog.inc
index fd72d3512..2eb0baf2c 100644
--- a/includes/watchdog.inc
+++ b/includes/watchdog.inc
@@ -9,7 +9,7 @@ $watchdog = array("comment" => array("0", $submission_rate["comment"]),
function watchdog($id, $message) {
global $user, $watchdog, $watchdog_history;
-
+/*
if ($watchdog[$id][1] && !user_permission($user)) {
if ($log = db_fetch_object(db_query("SELECT * FROM watchdog WHERE hostname = '". getenv("REMOTE_ADDR") ."' AND level = '". $watchdog[$id][0] ."'"))) {
if (time() - $log->timestamp < $watchdog[$id][1]) {
@@ -19,7 +19,7 @@ function watchdog($id, $message) {
}
}
}
-
+*/
// Perform query to add new watchdog entry:
db_query("INSERT INTO watchdog (level, timestamp, user, message, location, hostname) VALUES ('". $watchdog[$id][0] ."', '". time() ."', '". check_input($user->id) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."')");
}