From f055cf11e09d324739ede0a04cd957e2de438ad1 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 31 Dec 2000 08:24:16 +0000 Subject: - fixed PHP4.0.4 problem in discussion.php. - some improvements to account.php and theme.inc. - updated the documentation (again, again and again) - added INSTALL file - removed redundant files --- includes/widget.inc | 154 ---------------------------------------------------- 1 file changed, 154 deletions(-) delete mode 100644 includes/widget.inc (limited to 'includes/widget.inc') diff --git a/includes/widget.inc b/includes/widget.inc deleted file mode 100644 index a42b11e54..000000000 --- a/includes/widget.inc +++ /dev/null @@ -1,154 +0,0 @@ -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 .= "
  • track your comments
  • \n"; - $content .= "
  • track your stories
  • \n"; - $content .= "
  • track $site_name
  • \n"; - $content .= "

    \n"; - $content .= "

  • submission queue (". submission_number() .")
  • \n"; - $content .= "

    \n"; - $content .= "

  • edit your diary
  • \n"; - $content .= "
  • edit your information
  • \n"; - $content .= "
  • edit your settings
  • \n"; - $content .= "
  • edit your blocks
  • \n"; - $content .= "

    \n"; - $content .= "

  • view your diary
  • \n"; - $content .= "
  • view your information
  • \n"; - $content .= "

    \n"; - $content .= "

  • logout
  • \n"; - - $theme->box("$user->userid's configuration", "$content"); - } - else { - $output .= "
    \n"; - $output .= "
    \n"; - $output .= "

    Username:

    \n"; - $output .= "

    Password:

    \n"; - $output .= "

    \n"; - $output .= "

    REGISTER

    \n"; - $output .= "
    \n"; - $output .= "
    \n"; - - $theme->box("Login", $output); - } -} - - -function display_main_blocks($theme) { - global $PHP_SELF, $user, $id; - - switch (strtok($PHP_SELF, ".")) { - case "/discussion": - if ($user->id) $story = db_fetch_object(db_query("SELECT * FROM stories WHERE id = '$id'")); - if ($story->status == 1) display_moderation_results($theme, $story); - else display_new_headlines($theme); - break; - default: - display_account($theme); - } -} - -function display_user_blocks($theme) { - global $repository, $user; - if ($user->id) { - $result = db_query("SELECT * FROM layout l LEFT JOIN blocks b ON l.block = b.name WHERE l.user = '$user->id' AND l.weight > 0 AND b.status = '1' ORDER BY weight DESC"); - while ($block = db_fetch_object($result)) { - $blocks = module_execute($block->module, "block"); - $theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]); - } - } -} - -function display_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") ." ]"; -} - -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) ."
    "; - } - - return $output; -} - -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); -} - -?> -- cgit v1.2.3