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 display_moderation_results($theme, $story) { global $user; if ($user->id && $story->id && $vote = user_getHistory($user->history, "s$story->id")) { $output .= "

You voted `$vote'.

\n"; $output .= "

\n"; $output .= "Other people voted:
\n"; $result = db_query("SELECT * FROM users WHERE id != $user->id AND history LIKE '%s$story->id%'"); while ($account = db_fetch_object($result)) { $output .= "". format_username($account->userid) ." voted `". user_getHistory($account->history, "s$story->id") ."'.
"; } $theme->box("Moderation results", $output); } } function display_related_links($theme, $story) { ### Parse story for -tags: $text = stripslashes("$story->abstract $story->updates $story->article"); while ($text = stristr($text, "") + 4); $text = stristr($text, ""); if (!stristr($link, "mailto:")) $content .= "

  • $link
  • "; } ### Stories in the same category: $content .= "
  • More about category) ."\">$story->category.
  • "; ### Stories from the same author: if ($story->userid) $content .= "
  • Also by userid) ."\">$story->userid.
  • "; $theme->box("Related links", $content); } function display_old_headlines($theme, $num = 10) { global $user; if ($user->stories) $result = db_query("SELECT id, subject, timestamp FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT $user->stories, $num"); else $result = db_query("SELECT id, subject, timestamp FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT $num, $num"); while ($story = db_fetch_object($result)) { if ($time != date("F jS", $story->timestamp)) { $content .= "

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

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

    [ hlcolor2\">more ]

    "; $theme->box("Older headlines", $content); } function display_comment_moderation($id, $author, $score, $votes) { global $user, $comment_votes; if ($user->id && $user->userid != $author && !user_getHistory($user->history, "c$id")) { $output .= "\n"; } else { $output .= "
    score:". format_data($score) ."
    votes:". format_data($votes) ."
    "; } print $output; } function display_new_diaries($theme, $num = 20) { $result = db_query("SELECT u.userid, d.timestamp FROM diaries d LEFT JOIN users u ON d.author = u.id ORDER BY timestamp DESC LIMIT $num"); while ($diary = db_fetch_object($result)) { if ($time != date("F jS", $diary->timestamp)) { $content .= "

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

    \n"; $time = date("F jS", $diary->timestamp); } $content .= "
  • userid\">$diary->userid
  • \n"; } $content .= "

    [ hlcolor2\">more ]

    "; $theme->box("Recent diary entries", $content); } function display_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\">$story->subject
  • \n"; $content .= "

    [ hlcolor2\">more ]

    "; $theme->box("Latest headlines", $content); } function display_calendar($theme, $date) { include "includes/calendar.inc"; $calendar = new Calendar($date); $theme->box("Browse archives", $calendar->display()); } function display_account($theme) { global $user; if ($user->id) { function submission_number() { $result = db_query("SELECT COUNT(id) FROM stories WHERE status = 1"); return ($result) ? db_result($result, 0) : 0; } ### Display account settings: $content = "
  • view your information
  • "; $content .= "
  • edit your information
  • "; $content .= "
  • customize your page
  • "; $content .= "
  • track your comments
  • "; $content .= "
  • moderate submissions (". submission_number() .")
  • "; $content .= "
  • userid\">update your diary
  • "; $content .= "
  • logout
  • "; $theme->box("$user->userid's account", "$content"); } } ?>