From 524773f6da48277ba951505b77d125e573e8ab03 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 23 Dec 2000 23:25:28 +0000 Subject: [PATCH] Yet another large batch of updates: - I rearranged some of the code and clean-up some of the mess. - Added "blocks" which can be user defined/controlled: check to see. The positioning of blocks is rather basic for the moment, so I'm all open for input on that. --- account.php | 108 +++++++++++++++++------- admin.php | 3 +- cron.php | 2 +- discussion.php | 4 +- error.php | 2 +- includes/common.inc | 16 ++++ includes/theme.inc | 158 ++++++++++++++++++++++++++++++++--- includes/widget.inc | 105 ++++++++++++++--------- index.php | 2 +- module.php | 2 +- modules/backend.module | 2 +- modules/diary.module | 3 +- modules/faq.module | 2 +- modules/wishlist.module | 4 +- search.php | 2 +- submission.php | 2 +- submit.php | 2 +- themes/marvin/marvin.theme | 121 +++++---------------------- themes/unconed/unconed.theme | 129 +++++----------------------- 19 files changed, 365 insertions(+), 304 deletions(-) create mode 100644 includes/common.inc diff --git a/account.php b/account.php index e1df7c2c6c5..c17d7a4b966 100644 --- a/account.php +++ b/account.php @@ -1,24 +1,12 @@ \n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; - $output .= "
Username:
Password:
\n"; - $output .= "\n"; - - return $output; -} - function account_email() { $output .= "

Lost your password? Fill out your username and e-mail address, and your password will be mailed to you.

\n"; $output .= "
\n"; @@ -36,7 +24,7 @@ function account_create($user = "", $error = "") { global $theme; if ($error) $output .= "Failed to register.$error\n"; - else $output .= "

Registering allows you to comment on stories, to moderate comments and pending stories, to maintain an online diary, to customize the look and feel of the site and generally helps you interact with the site more efficiently.

To create an account, simply fill out this form an click the `Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.

\n"; + else $output .= "

Registering allows you to comment on stories, to moderate comments and pending stories, to customize the look and feel of the site and generally helps you interact with the site more efficiently.

To create an account, simply fill out this form an click the `Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.

\n"; $output .= "\n"; $output .= "

\n"; @@ -119,15 +107,15 @@ function account_user_edit() { } else { $theme->header(); - $theme->box("Login", account_login()); + $theme->box("Create user account", account_create()); $theme->box("E-mail password", account_email()); - $theme->box("Create new account", account_create()); $theme->footer(); } } function account_user_save($edit) { global $user; + if ($user->id) { $data[name] = $edit[name]; $data[fake_email] = $edit[fake_email]; @@ -141,7 +129,7 @@ function account_user_save($edit) { } } -function account_page_edit() { +function account_site_edit() { global $theme, $themes, $user; if ($user->id) { @@ -164,7 +152,12 @@ function account_page_edit() { $output .= "
\n"; $output .= "Select what time you currently have and your timezone settings will be set appropriate.

\n"; $output .= "Maximum number of stories:
\n"; - $output .= "stories\">

\n"; + + for ($stories = 10; $stories <= 30; $stories += 5) { + $options3 .= "\n"; + } + + $output .= "
\n"; $output .= "The maximum number of stories that will be displayed on the main page.

\n"; $options = ""; $options .= ""; @@ -186,7 +179,9 @@ function account_page_edit() { $output .= "Comment threshold:
\n"; $output .= "
\n"; $output .= "Comments that scored less than this setting will be ignored. Anonymous comments start at 0, comments of people logged on start at 1 and moderators can add and subtract points.

\n"; - $output .= "
\n"; + + + $output .= "
\n"; $output .= "

\n"; $theme->header(); @@ -195,15 +190,15 @@ function account_page_edit() { } else { $theme->header(); - $theme->box("Login", account_login()); + $theme->box("Create user account", account_create()); $theme->box("E-mail password", account_email()); - $theme->box("E-mail password", account_create()); $theme->footer(); } } -function account_page_save($edit) { +function account_site_save($edit) { global $user; + if ($user->id) { $data[theme] = $edit[theme]; $data[timezone] = $edit[timezone]; @@ -215,6 +210,53 @@ function account_page_save($edit) { } } +function account_block_edit() { + global $theme, $user; + + if ($user->id) { + $output .= "
\n"; + + $output .= "Blocks:
\n"; + + $result = db_query("SELECT * FROM blocks WHERE status = 1"); + while ($block = db_fetch_object($result)) { + $entry = db_fetch_object(db_query("SELECT * FROM layout WHERE block = '$block->name' AND user = '$user->id'")); + + $options = ""; + for ($weight = 0; $weight < 10; $weight++) { + $options .= "\n"; + } + + $output .= ""; + $output .= "$block->name
"; + } + + $output .= "You can more or less position your blocks by assigning them weights. The heavy blocks sink down whereas the light blocks will be positioned on top.

\n"; + $output .= "
\n"; + $output .= "

\n"; + + $theme->header(); + $theme->box("Edit your blocks", $output); + $theme->footer(); + } + else { + $theme->header(); + $theme->box("Create user account", account_create()); + $theme->box("E-mail password", account_email()); + $theme->footer(); + } +} + +function account_block_save($edit) { + global $user; + if ($user->id) { + db_query("DELETE FROM layout WHERE user = $user->id"); + foreach ($edit as $block=>$weight) { + db_query("INSERT INTO layout (user, block, weight) VALUES ('". check_input($user->id) ."', '". check_input($block) ."', '". check_input($weight) ."')"); + } + } +} + function account_user($uname) { global $user, $theme; @@ -268,9 +310,8 @@ function account_user($uname) { else { ### Display login form: $theme->header(); - $theme->box("Login", account_login()); + $theme->box("Create user account", account_create()); $theme->box("E-mail password", account_email()); - $theme->box("Create new account", account_create()); $theme->footer(); } } @@ -333,7 +374,7 @@ function account_create_submit($userid, $email) { if ($rval = account_validate($new)) { $theme->header(); - $theme->box("Create new account", account_create($new, $rval)); + $theme->box("Create user account", account_create($new, $rval)); $theme->footer(); } else { @@ -351,7 +392,7 @@ function account_create_submit($userid, $email) { mail($new[real_email], "Account details for $site_name", $message, "From: noreply"); $theme->header(); - $theme->box("Create new account", "Congratulations! Your member account has been sucessfully created and further instructions on how to activate your account have been sent to your e-mail address."); + $theme->box("Create user account", "Congratulations! Your member account has been sucessfully created and further instructions on how to activate your account have been sent to your e-mail address."); $theme->footer(); } } @@ -514,10 +555,14 @@ switch ($op) { account_user_save($edit); account_user($user->userid); break; - case "Save page settings": - account_page_save($edit); + case "Save site settings": + account_site_save($edit); header("Location: account.php?op=info"); break; + case "Save block settings": + account_block_save($edit); + account_user($user->userid); + break; case "logout": account_session_close(); header("Location: account.php?op=info"); @@ -551,8 +596,11 @@ switch ($op) { case "user": account_user_edit(); break; - case "page": - account_page_edit(); + case "site": + account_site_edit(); + break; + case "block": + account_block_edit(); break; default: header("Location: module.php?mod=diary&op=add&name=$user->userid"); diff --git a/admin.php b/admin.php index 7fb758535bd..7d3f0f3f9a9 100644 --- a/admin.php +++ b/admin.php @@ -3,8 +3,7 @@ // validate user permission: if (!$user->id || ($user->permissions != 1 && $user->id > 1)) exit(); -include_once "includes/theme.inc"; -include_once "includes/cron.inc"; +include "includes/common.inc"; function admin_page($mod) { global $repository, $menu, $modules; diff --git a/cron.php b/cron.php index 3cb6abfcb09..1c01362db9b 100644 --- a/cron.php +++ b/cron.php @@ -1,6 +1,6 @@ footer(); } -?> +?> \ No newline at end of file diff --git a/error.php b/error.php index c75e55edb15..9c259fb9683 100644 --- a/error.php +++ b/error.php @@ -39,7 +39,7 @@ function error_httpd() { print "\n"; } -include "includes/theme.inc"; +include "includes/common.inc"; switch ($op) { case "flood": diff --git a/includes/common.inc b/includes/common.inc new file mode 100644 index 00000000000..7886b9b654d --- /dev/null +++ b/includes/common.inc @@ -0,0 +1,16 @@ + diff --git a/includes/theme.inc b/includes/theme.inc index 583bc0044cb..63024432cb1 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1,16 +1,154 @@ id) { -global $user; + function submission_number() { + $result = db_query("SELECT COUNT(id) FROM stories WHERE status = 1"); + return ($result) ? db_result($result, 0) : 0; + } -$theme = load_theme(); + ### 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 theme_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) theme_moderation_results($theme, $story); + else theme_new_headlines($theme); + break; + default: + theme_account($theme); + } +} + +function theme_user_blocks($theme) { + global $PHP_SELF, $repository, $user; + if ($user->id && strstr($PHP_SELF, "index.php")) { + $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 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") ." ]"; +} + +function theme_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 theme_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 theme_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 theme_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 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\">$story->subject
  • \n"; + $content .= "

    [ hlcolor2\">more ]

    "; + $theme->box("Latest headlines", $content); +} ?> diff --git a/includes/widget.inc b/includes/widget.inc index 96fe68ab4b0..ffb8833349d 100644 --- a/includes/widget.inc +++ b/includes/widget.inc @@ -1,19 +1,72 @@ id) { - function display_block($name, $module) { - global $theme; - - if ($blocks = module_execute($name, "block")) { - foreach ($blocks as $id=>$block) { - $theme->box($block["subject"], $block["content"]); - } + 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"]); } } - - module_iterate("display_block"); } function display_morelink($theme, $story) { @@ -98,34 +151,4 @@ function display_new_headlines($theme, $num = 10) { $theme->box("Latest headlines", $content); } -function display_account($theme) { - global $user, $site_name; - - 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 .= "
  • 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 .= "

    \n"; - $content .= "

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

    \n"; - $content .= "

  • logout
  • \n"; - - $theme->box("$user->userid's account", "$content", "NOWRAP"); - } -} - ?> diff --git a/index.php b/index.php index a893d4753bf..519a9477931 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ diff --git a/modules/backend.module b/modules/backend.module index 217762ac746..ab8c6ab9e7f 100644 --- a/modules/backend.module +++ b/modules/backend.module @@ -5,7 +5,7 @@ $module = array("page" => "backend_page", "block" => "backend_block", "admin" => "backend_admin"); -include "includes/theme.inc"; +include "includes/common.inc"; include "modules/backend.class"; function backend_page() { diff --git a/modules/diary.module b/modules/diary.module index 7e49e03e69d..29d8af1f2e9 100644 --- a/modules/diary.module +++ b/modules/diary.module @@ -4,8 +4,7 @@ $module = array("page" => "diary_page", "block" => "diary_block", "admin" => "diary_admin"); - -include "includes/theme.inc"; +include "includes/common.inc"; function diary_page_overview($num = 20) { global $theme, $user; diff --git a/modules/faq.module b/modules/faq.module index 31ea797cf02..e50231c6764 100644 --- a/modules/faq.module +++ b/modules/faq.module @@ -2,7 +2,7 @@ $module = array("page" => "faq_page"); -include "includes/theme.inc"; +include "includes/common.inc"; function faq_page() { global $theme; diff --git a/modules/wishlist.module b/modules/wishlist.module index 661e9897340..c11bf51def0 100644 --- a/modules/wishlist.module +++ b/modules/wishlist.module @@ -4,7 +4,6 @@ $module = array("page" => "wishlist_page"); function wishlist_page() { ?> -

    Whislist

    $Id$ @@ -74,5 +73,4 @@ function wishlist_page() { - +?> \ No newline at end of file diff --git a/search.php b/search.php index da3b70d2abc..83ac91511af 100644 --- a/search.php +++ b/search.php @@ -1,5 +1,5 @@ header(); diff --git a/submission.php b/submission.php index ad1767ed07c..a34ef6a7d1a 100644 --- a/submission.php +++ b/submission.php @@ -1,7 +1,7 @@ footer(); } -include "includes/theme.inc"; +include "includes/common.inc"; switch($op) { case "Preview submission": diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme index b8e6710838a..929fcc4949c 100644 --- a/themes/marvin/marvin.theme +++ b/themes/marvin/marvin.theme @@ -1,24 +1,21 @@ @@ -53,10 +50,6 @@ subject\" -->\n"; print "\n"; @@ -75,16 +68,11 @@ print " \n"; print " \n"; print " \n"; - print " \n"; + print " \n"; print "
     
    ". display_morelink($this, $story) ."
    ". theme_morelink($this, $story) ."
    \n"; print "

    \n\n"; } - ###### - # Syntax.......: article(...); - # Description..: a function to dispay a complete article (without user - # comments). It's what you get when you followed for - # instance one of read-more links on the main page. function article($story, $reply) { print "\n\n"; print "\n"; @@ -109,9 +97,6 @@ print "

    \n\n"; } - ###### - # Syntax.......: commentControl(...); - # Description..: this function is used to theme the comment control box. function commentControl($sid, $title, $threshold, $mode, $order) { global $user; @@ -167,13 +152,10 @@ cid\">\n"; - ### Create comment header: + // Create comment header: print "
    \n"; print " \n"; print " \n"; @@ -222,17 +204,14 @@ print "
    \n\n"; } - ###### - # Syntax.......: box($subject, $body, $options = ""); - # Description..: a function to draw a box/block. function box($subject, $content, $options = "") { print "\n\n"; print "
    \n"; @@ -183,22 +165,22 @@ print " \n"; print " \n"; - ### Subject: + // Subject: print " \n"; print " \n"; - ### Moderation: + // Moderation: print " \n"; print " \n"; - ### Author: + // Author: print " \n"; print " \n"; print " \n"; - ### Date + // Date print " \n"; print " \n"; print " \n"; @@ -207,13 +189,13 @@ print " \n"; print " \n"; - ### Print body of comment: + // Print body of comment: if ($comment->comment) print " \n"; - ### Print thread (if any): + // Print thread (if any): if ($thread) print " \n"; - ### Print bottom link(s): + // Print bottom link(s): print " \n"; print "
    Subject:hlcolor1\">". check_output($comment->subject) ."\n"; - display_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes); + theme_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes); print "
    Author:". format_username($comment->userid) ."
    Date:". format_date($comment->timestamp) ."
    ". check_output($comment->comment, 1) ."
    bgcolor1\">$thread
    bgcolor1\">[ $link ]
    \n"; print "
    \n"; print " \n"; - print " \n"; print " \n"; @@ -240,73 +219,17 @@ print "
    \n\n"; } - ###### - # Syntax.......: footer(); - # Description..: a function to draw the page footer. function footer() { ?> @@ -321,4 +244,4 @@ } } -?> +?> \ No newline at end of file diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme index 50c3166192b..6727b32ef5a 100644 --- a/themes/unconed/unconed.theme +++ b/themes/unconed/unconed.theme @@ -7,26 +7,23 @@ var $clc0 = "#c8c8d0"; var $cl00 = "#000000"; - ### color set #1: + // color set #1: var $brcolor1 = "#000000"; // border color var $bgcolor1 = "#B5BECE"; var $fgcolor1 = "#000000"; // table body color var $hlcolor1 = "#000000"; // high-light color var $categorycolor = "#202020"; - ### color set #2: + // color set #2: var $bgcolor2 = "#EEEEEE"; var $fgcolor2 = "#000000"; var $hlcolor2 = "#000000"; - ### color set #3: + // color set #3: var $bgcolor3 = "#D7D7D7"; var $fgcolor3 = "#000000"; var $hlcolor3 = "yellow"; - ###### - # Syntax.......: header($title); - # Description..: a function to draw the page header. function header($title) { global $site_name; srand((double)microtime()*1000000); @@ -73,10 +70,6 @@ timestamp); @@ -108,16 +101,11 @@ ?> - +
    \n"; + print " \n"; print " \n"; - print " \n"; - print " \n"; + print " \n"; + print " \n"; print "
    bgcolor1\" WIDTH=\"100%\">fgcolor1\">$subject
    $content
    bgcolor1\" NOWRAP>fgcolor1\">$subject
    $content
    \n"; print "
    status == 2) { - ### Display new headlines: - display_new_headlines($this); - } - else { - ### Display results of moderation: - display_moderation_results($this, $story); - } - } - else { - ### Display account: - display_account($this); - - ### Display new headlines: - display_new_headlines($this); - } - } - else { - ### Display account: - display_account($this); - - ### Display new headlines: - display_new_headlines($this); - } - ?> + // Display user-defined blocks: + theme_user_blocks($this); + ?>

    timestamp); @@ -152,9 +140,6 @@ cid\">\n"; @@ -228,29 +210,29 @@ "; echo " bgcolor1\">"; echo " bgcolor1\">"; echo " "; - ### Subject: + // Subject: echo " "; echo " "; - ### Moderation: + // Moderation: echo " "; echo " "; - ### Author: + // Author: echo " "; echo " "; echo " "; - ### Date + // Date echo " "; echo "
    hlcolor1\">Subject:"; echo " fgcolor1\">" . check_output($comment->subject) . ""; echo " "; - display_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes); + theme_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes); echo "
    Author:" . format_username($comment->userid) . " "; if ($comment->userid != $anonymous) { - ### Display extra information line: + // Display extra information line: if ($comment->fake_email) $info .= format_email($comment->fake_email); if (eregi("http://",$comment->url)) $info .= " | " . format_url($comment->url); if ($info) echo "
    [ $info ]"; @@ -258,38 +240,34 @@ echo "
    Date:". format_date($comment->timestamp) ."
    "; echo " "; echo " "; - ### Print body of comment: + // Print body of comment: if ($comment) echo " bgcolor2\">". check_output($comment->comment, 1) .""; - ### Print thread (if any): + // Print thread (if any): if ($thread) echo " bgcolor3\">$thread"; - ### Print bottom link(s): + // Print bottom link(s): echo " bgcolor3\">[ $link ]"; echo " "; ?>
    "; - print " "; + print " "; + print " "; print "
    "; - print "
    bgcolor1\">fgcolor1\">$subject
    bgcolor2\" $options>$content
    bgcolor1\" NOWRAP>fgcolor1\">$subject
    bgcolor2\">$content
    "; ?> @@ -299,77 +277,16 @@ } - ###### - # Syntax.......: footer(); - # Description..: a function to draw the page footer. function footer() { ?> - box("Browse archives", droplet_get("calendar")); - - ### Display calendar: - display_old_headlines($this); - } - elseif (strstr($PHP_SELF, "account.php")) { - ### Display account: - display_account($this); - } - elseif (strstr($PHP_SELF, "submission.php")) { - ### Display account: - display_account($this); - } - elseif (strstr($PHP_SELF, "submit.php")) { - ### Display account: - display_account($this); - - ### Display new headlines: - display_new_headlines($this); - } - elseif (strstr($PHP_SELF, "discussion.php")) { - global $id; - - if ($id && $story = id2story($id)) { - if ($story->status == 2) { - ### Display account: - display_account($this); - - ### Display related links: - display_related_links($this, $story); - - ### Display new headlines: - display_new_headlines($this); - } - else { - ### Display results of moderation: - display_moderation_results($this, $story); - } - } - else { - ### Display account: - display_account($this); - - ### Display new headlines: - display_new_headlines($this); - } - } - else { - ### Display account: - display_account($this); - - ### Display new headlines: - display_new_headlines($this); - } +