From 2952d16f78eea91724760f526504010cb8f796a9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Jan 2001 12:20:31 +0000 Subject: - updated/improved discussion engine: it needs additional fine-tuning though but I think this is stable enough for public consumption and real-life testing. ==> a first big step towards a flexible comment engine. IMPORTANT: - Required theme updatins: UnConeD: check your $theme->controls() as I added a very, very dummy implementation - Required database updates: alter table users modify mode tinyint(1) DEFAULT '' NOT NULL; alter table comments change sid lid int(6) DEFAULT '0' NOT NULL; alter table comments add link varchar(16) DEFAULT '' NOT NULL; update comments set link = 'story'; --- includes/theme.inc | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'includes/theme.inc') diff --git a/includes/theme.inc b/includes/theme.inc index 33e11731c..da6f22797 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -79,7 +79,7 @@ function theme_blocks($region, $theme) { } function theme_morelink($theme, $story) { - return ($story->article) ? "[ id\">hlcolor2\">read more | ". strlen($story->article) ." bytes | id\">hlcolor2\">". format_plural($story->comments, "comment", "comments") ." ]" : "[ id\">hlcolor2\">". format_plural($story->comments, "comment", "comments") ." ]"; + return ($story->article) ? "[ id\">hlcolor2\">read more | ". strlen($story->article) ." bytes | id\">hlcolor2\">". format_plural($story->comments, "comment", "comments") ." ]" : "[ id\">hlcolor2\">". format_plural($story->comments, "comment", "comments") ." ]"; } function theme_moderation_results($theme, $story) { @@ -113,27 +113,12 @@ function theme_related_links($theme, $story) { $theme->box("Related links", $content); } -function theme_comment_moderation($comment) { - global $user, $comment_votes; - - if ($user->id && $user->userid != $comment->userid && !user_getHistory($user->history, "c$comment->cid")) { - $output .= "\n"; - } - else { - $output .= "
score:". format_data($comment->score) ."
votes:". format_data($comment->votes) ."
"; - } - - return $output; -} - function theme_new_headlines($theme, $num = 10) { global $user; $content = ""; $result = db_query("SELECT id, subject FROM stories WHERE status = 2 ORDER BY id DESC LIMIT $num"); - while ($story = db_fetch_object($result)) $content .= "
  • id\">". check_output($story->subject) ."
  • \n"; + while ($story = db_fetch_object($result)) $content .= "
  • id\">". check_output($story->subject) ."
  • \n"; $content .= "

    [ hlcolor2\">more ]

    "; $theme->box("Latest headlines", $content); } @@ -149,12 +134,11 @@ function theme_old_headlines($theme, $num = 10) { $content .= "

    ". date("l, M jS", $story->timestamp) ."

    \n"; $time = date("F jS", $story->timestamp); } - $content .= "
  • id\">". check_output($story->subject) ."
  • \n"; + $content .= "
  • id\">". check_output($story->subject) ."
  • \n"; } $content .= "

    [ hlcolor2\">more ]

    "; $theme->box("Older headlines", $content); } - ?> -- cgit v1.2.3