From bd76632b96a7608df7157f6dc8dc1cdcd600cbf5 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Mon, 14 May 2001 23:27:41 +0000 Subject: This is a major rewrite of the Goofy-theme.... the major problem with it was that it required a *lot* of overhead for a simple box, due to the fancy borders. To counter this, I've added simple functions in JavaScript to output the actual boxes, while the PHP functions themselves output simple function calls to them. The result is an incredible loss of size, especially on larger pages.... on a typical drupal page (header/footer, 1 story box, 1 comment mod box, 4 comments and 1 side box) the difference was 23K vs 15K, which I find quite good. You should also notice how big some pages were in the old version, which are still tiny in the new version. There are a few problems though: - You can't use it in some parts of the admin section (preview a story), since admin.php leaves out the header(), so the html-generating functions are not included there. - Because drop can occasionally insert HTML directly, without going through themes, I have to wrap each box in its own - - - - - - - - - - - - - - - - - - - - - - - - -

- linksbar(); ?> +linksbar(); ?>
- + + + function linksbar() { // helper function to prevent double code +?> +
@@ -85,201 +91,68 @@
- title\" -->\n"; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
title); ?>
format_username($story->userid), "%b" => format_date($story->timestamp, "large"))); ?>
cid) ." / ". topic_name($story->tid); ?>

- abstract, 1) . "
"; - if (!$main && $story->body) - echo "
" . check_output($story->body, 1); - ?> -
-

-title\" -->\n"; + $title = check_output($story->title); + $subleft = strtr(t("Submitted by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp, "large"))); + $subright = category_name($story->cid) ." / ". topic_name($story->tid); + $body = check_output($story->abstract, 1) . "
" . ((!$main && $story->body)?"
" . check_output($story->body, 1):"") . "
" . ($main?theme_morelink($this, $story):""); + print "\n"; } // close story function + + function comment($comment, $link = "") { echo "cid\">\n"; - ?> - - - - - - - - - "; - echo " "; - - // Moderation: - echo " "; - echo " "; - - // Author: - echo " "; - echo " "; - echo " "; - - // Date - echo " "; - - echo "
"; - - // Subject: - echo "
" . t("Subject") . ": 
" . check_output($comment->subject) . "
" . comment_moderation($comment) . "
" . t("Author") . ": 
" . format_username($comment->userid) . ""; - if ($comment->userid) { - // Display extra information line: - if ($comment->fake_email) $info .= format_email($comment->fake_email); - if (eregi("http://",$comment->url)) $info .= ($info?" | ":"") . format_url($comment->url); - if ($info) echo "
[ $info ]"; - } - echo "
" . t("Date:") . " 
". format_date($comment->timestamp) ."
"; - - ?>
comment, 1); - echo "

[ $link ]
"; - ?>

- " . format_username($comment->userid) . ""; + if ($comment->userid) { + if ($comment->fake_email) $info[] = format_email($comment->fake_email); + if (eregi("http://",$comment->url)) $info[] = format_url($comment->url); + if ($info) $author .= "
[ ". implode(" | ",$info) . "]"; + } + $body = check_output($comment->comment, 1) . "

[ $link ]
"; + print "\n"; } // close comment function - + + + + function stripbreaks($a) { // helper function for generating the javascripted boxes + return str_replace("\n","\\n",str_replace("\r","\\r",$a)); + } // close stripbreaks function + + function box($subject, $content, $options = "") { - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- -\n\n"; } // close box function + + + + function footer() { ?> - linksbar(); ?> + +linksbar(); ?> + -- cgit v1.2.3