diff --git a/CHANGELOG b/CHANGELOG index e246057f500049aaa9585ac0986b5d460c6836de..598d0f5e2281bb34ef4437f6abf54cbf94260d24 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,29 +1,23 @@ drupal 1.xx, xx/xx/2001 ----------------------- - rewrote the comment/discussion code: - * comment navigation should be less confusing now additional/alternative - display and order methods have been added. - * modules can be extended with a "comment system" as they can embed the - existing comment code without having to write duplicate code. + * comment navigation should be less confusing now additional/alternative display and order methods have been added. + * modules can be extended with a "comment system" as they can embed the existing comment code without having to write duplicate code. - added section manager: * story sections can be maintained from the administration pages. - * makes the open submission more adaptive in that you can set individual - post, dump and expiration thresholds for each section according to the - story type and urgency level: some section do not really "expire" and - stay interesting and active as time passes by, whereas news-related - stories are only considered "hot" over a short period of time. + * makes the open submission more adaptive in that you can set individual post, dump and expiration thresholds for each section according to the + story type and urgency level: some section do not really "expire" and stay interesting and active as time passes by, whereas news-related stories are only considered "hot" over a short period of time. - multiple vhosts + multiple directories: - * you can setup multiple drupal sites on top of the same physical source - tree either by using vhosts or sub-directories + * you can setup multiple drupal sites on top of the same physical source tree either by using vhosts or sub-directories - added "user ratings" similar to SlashCode's karma or Scoop's mojo. - added "search infractructure": - * improved search page and integrated search functionality in the - administration pages. + * improved search page and integrated search functionality in the administration pages. +- changed the "open submission queue" into an optional module - various updates: * improved cron-module * improved module-module - * revised documentation +- revised documentation drupal 1.00, 15/01/2001 ----------------------- -- initial release \ No newline at end of file +- initial release diff --git a/includes/submission.inc b/includes/submission.inc deleted file mode 100644 index 78027c1099a7a3d3de4288012d45a2e199bd164c..0000000000000000000000000000000000000000 --- 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 5791ed04903b09f520b0e4906316a20664560795..1bdff7b410c4fca0bb40b5bfb3673a445fe2fac5 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -44,11 +44,8 @@ function menu($name, $module) { $content .= "
\n"; } - $content .= "
\n"; - - if ($menu && ksort($menu)) { - foreach ($menu as $link=>$url) $content .= "
\n"; } diff --git a/includes/watchdog.inc b/includes/watchdog.inc index fd72d35127677b700253b7f4edda73a7333c2e54..2eb0baf2c1ec1e6673b8b0b85ddd59a2cdf9b9b8 100644 --- a/includes/watchdog.inc +++ b/includes/watchdog.inc @@ -9,7 +9,7 @@ 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")) ."')"); } diff --git a/modules/diary.module b/modules/diary.module index 381afc887abdbab6c0e55b2287fb4bfba9438561..c8e93c6be900c0352a53a418c7d6dd61ee534d22 100644 --- a/modules/diary.module +++ b/modules/diary.module @@ -227,8 +227,7 @@ function diary_user($username, $section, $operation) { } function diary_menu() { - global $user; - return array("edit your diary" => "module.php?mod=diary&op=add", "view your diary" => "module.php?mod=diary&op=view"); + return array("". t("edit your diary") ."", "". t("view your diary") .""); } function diary_block() { diff --git a/submission.php b/submission.php deleted file mode 100644 index a00f4abf6771b584a80406e96f7589a9eaee9e41..0000000000000000000000000000000000000000 --- a/submission.php +++ /dev/null @@ -1,82 +0,0 @@ - - -include_once "includes/submission.inc"; -include_once "includes/common.inc"; - -function submission_display_main() { - global $theme, $user; - - // Perform query: - $result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.status = 1 ORDER BY s.id"); - - $content .= "
". t("Anyone who happens by, and has some news or some thoughts they'd like to share, can submit new content for consideration. After someone has submitted something, their story is added to a queue. All registered users can access this list of pending stories, that is, stories that have been submitted, but do not yet appear on the public front page. Those registered users can vote whether they think the story should be posted or not. When enough people vote to post a story, the story is pushed over the threshold and up it goes on the public page. On the other hand, when too many people voted to drop a story, the story will get trashed."). "
"; - $content .= "". t("Basically, this means that you, the community, are truly the editors of this site as you have the final decision on the content of this site. It's you judging the overall quality of a story. But remember, vote on whether the story is interesting, not on whether you agree with it or not. If the story goes up, you can disagree all you want, but don't vote `no' because you think the ideas expressed are wrong. Instead, vote `no' when you think the story is plain boring.") ."
"; - $content .= "". t("Subject") ." | ". t("Section") ." | ". t("Date") ." | ". t("Author") ." | ". t("Score") ." |
---|---|---|---|---|
id\">". check_output($submission->subject) ." | $submission->section | ". date("Y-m-d", $submission->timestamp) ." ". date("H:m:s", $submission->timestamp) ." | ". format_username($submission->userid) ." | ". submission_score($submission->id) ." |
id\">". check_output($submission->subject) ." | $submission->section | ". date("Y-m-d", $submission->timestamp) ." ". date("H:m:s", $submission->timestamp) ." | ". format_username($submission->userid) ." | id\">". t("vote") ." |
";
$output .= "". t("Subject") .":
\n";
- $output .= "
\n"; + $output .= "
\n";
$output .= "". t("Section") .":
\n";
foreach ($sections = section_get() as $value) $options .= " \n";
@@ -66,6 +66,8 @@ function submit_preview($subject, $abstract, $article, $section) {
$output .= "
\n";
$output .= "". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".
\n"; + $duplicate = db_result(db_query("SELECT COUNT(id) FROM stories WHERE subject = '$subject'")); + if (empty($subject)) { $output .= "". t("Warning: you did not supply a subject.") ."
\n"; $output .= "\n"; @@ -74,6 +76,10 @@ function submit_preview($subject, $abstract, $article, $section) { $output .= "". t("Warning: you did not supply an abstract.") ."
\n"; $output .= "\n"; } + else if ($duplicate) { + $output .= "". t("Warning: there is already a story with that subject.") ."
\n"; + $output .= "\n"; + } else { $output .= "\n"; $output .= "\n";