drupal/themes/jeroen/jeroen.theme

331 lines
14 KiB
Plaintext
Raw Normal View History

<?php
2001-02-27 16:23:34 +00:00
/*********************************************************************
Theme: Jeroen
Author: Jeroen Bensch (Jeroen)
Email: jeroen@drop.org
Description: Very graphical theme using a cool pipe-design.
*********************************************************************/
class Theme extends BaseTheme {
This a rather large commit that needs a lot of fine-tuning. If you update, you'll break your site as you need switching from structure to index.module: so this can be considered an intermediate commit. If you upgrade, and you are welcome to, just create a collection called "section" (for now) and assign your nodes some attributes in the described format. Feedback and bugreports are welcomed. Questions will be answered. CHANGES: - comment system: + when replying to a node (rather then to a comment), that node is displayed above the reply form. + when replying to a comment (rather then to a node), that comment is displayd above the reply form. - removed structure.inc, removed structure.module. - node.inc: + added 2 new node functions called 'node_attribute_edit()' and 'node_attribute_save()' used to 'hook in' any indexing system including your home-brewed stuff if you'd want to. Currently, index.module is the facto default index system. See story.module for usage. - book.module, story.module, poll.module, page.module, forum.module: + added preview functionality to administration section (via node module). + removed all references to structure.inc (category, topic). - moderate.module: + removed all references to structure.inc (category, topic). - book.module, story.module, page.module, forum.module: + increased the sizes of some textareas. - submit.php: + removed all references to structure.inc (category, topic). - marvin.theme: + removed dead code: function story() was depricated. - unconed.theme: + removed hardcoded references to drop.org. - marvin.theme, unconed.theme, jeroen.theme, yaroon.theme, example.theme: + removed all references to structure.inc (category, topic). TODO: - file.module, trip_link.module: + update preview functionality: see story.module for example. + remove references to 'cid' and 'tid', use 'attribute' instead: see story.module for example. - extend and build upon index.module as well as making it configurable
2001-06-10 15:01:20 +00:00
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#E7E7E7";
This a rather large commit that needs a lot of fine-tuning. If you update, you'll break your site as you need switching from structure to index.module: so this can be considered an intermediate commit. If you upgrade, and you are welcome to, just create a collection called "section" (for now) and assign your nodes some attributes in the described format. Feedback and bugreports are welcomed. Questions will be answered. CHANGES: - comment system: + when replying to a node (rather then to a comment), that node is displayed above the reply form. + when replying to a comment (rather then to a node), that comment is displayd above the reply form. - removed structure.inc, removed structure.module. - node.inc: + added 2 new node functions called 'node_attribute_edit()' and 'node_attribute_save()' used to 'hook in' any indexing system including your home-brewed stuff if you'd want to. Currently, index.module is the facto default index system. See story.module for usage. - book.module, story.module, poll.module, page.module, forum.module: + added preview functionality to administration section (via node module). + removed all references to structure.inc (category, topic). - moderate.module: + removed all references to structure.inc (category, topic). - book.module, story.module, page.module, forum.module: + increased the sizes of some textareas. - submit.php: + removed all references to structure.inc (category, topic). - marvin.theme: + removed dead code: function story() was depricated. - unconed.theme: + removed hardcoded references to drop.org. - marvin.theme, unconed.theme, jeroen.theme, yaroon.theme, example.theme: + removed all references to structure.inc (category, topic). TODO: - file.module, trip_link.module: + update preview functionality: see story.module for example. + remove references to 'cid' and 'tid', use 'attribute' instead: see story.module for example. - extend and build upon index.module as well as making it configurable
2001-06-10 15:01:20 +00:00
/*
I am going to use some colors throughout this theme:
#000000 : black used for all links and the table in every box you'll see, I use it to create the thin black border around each.
#E7E7E7 : light grey bgcolor for every box you'll see before the background gets drawn over it.
#6C6C6C : grey used as bgcolor before the articles' and abstacts' background is drawn.
#202020 : dark grey text used on the headers in abstract and article.
#FEFEFE : white text on the dark grey headers of all boxes with the drop.org background in it.
#E09226 : orange-brown rust color used to give some finishing touches around links, you'll see. :)
*/
function header() {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php echo variable_get(site_name, "drupal"); ?> - Tears of technology</title>
<style type="text/css">
<!--
body,p,div,li,ul,td,em,FONT,BLOCKQUOTE,FORM{ font-size: 10pt; font-family: Helvetica,Lucida,sans-serif; }
SMALL { font-size: 10pt; }
-->
</style>
</head>
<body text="#202020" bgcolor="#FEFEFE" background="themes/jeroen/images/background.gif" alink="#000000" link="#000000" vlink="#000000">
<table width="100%" align="left" cellpadding="0" cellspacing="6" border="0">
<tr>
<td colspan="2" width="80%">
<?php $img = (rand(0,150) == 75) ? "logo2.gif" : "logo.gif"; ?>
<img src="themes/jeroen/images/<?php echo $img; ?>" alt=""><br /><br />
</td>
<td width="20%">
<?php
2001-02-27 16:23:34 +00:00
$mybox = 1;
$this->box("Drop where?", "<td align=\"left\" valign=\"top\">
<a href=\"index.php\">home</a><br />
<a href=\"module.php?mod=book\">handbook</a><br />
<a href=\"module.php?mod=search\">search</a>
</td>
<td align=\"right\" valign=\"top\">
<a href=\"module.php?mod=diary\">diary</a><br />
<a href=\"submit.php\">submit</a><br />
<a href=\"account.php\">account</a>
</td>");
?>
2001-02-27 16:23:34 +00:00
</td>
</tr>
<tr>
<td valign="top" align="right">
2001-02-27 16:23:34 +00:00
<?php
theme_blocks("left", $this);
2001-02-27 16:23:34 +00:00
?>
2001-02-27 16:23:34 +00:00
</td>
<td width="80%" valign="top" align="left">
<?php
2001-02-27 16:23:34 +00:00
} // close header function
function node($node, $main = 0) {
2001-02-27 16:23:34 +00:00
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="bottom" width="20" height="20" background="themes/jeroen/images/<?php echo (rand(0, 1) ? "news1.gif" : "news3.gif"); ?>" nowrap>&nbsp;</td>
<td align="center" valign="top" width="100%" background="themes/jeroen/images/newsmiddle.gif" nowrap>
<B><?php echo "". check_output($node->title) .""; ?></B>
</td>
<td align="right" valign="bottom" width="20" background="themes/jeroen/images/<?php echo (rand(0, 1) == 0) ? "news2.gif" : "news4.gif"; if (rand(0,100) == 50) "news5.gif"; ?>" nowrap>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>
<table border="0" cellpadding="1" cellspacing="0" BGCOLOR="#000000" width="100%">
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0" width="100%" BGCOLOR="#E7E7E7" background="themes/jeroen/images/sketch.gif">
<tr>
<td align="left" background="themes/jeroen/images/menutitle.gif" nowrap>
<FONT COLOR="#FEFEFE">
<?php
switch (rand(0,13)) {
case 0: $how = "Yelled"; break; case 1: $how = "Whispered"; break;
case 2: $how = "Reported"; break; case 3: $how = "Posted"; break;
case 4: $how = "Beamed through"; break; case 5: $how = "Faxed"; break;
case 6: $how = "Tossed"; break; case 7: $how = "Morsed"; break;
case 8: $how = "Flagged"; break; case 9: $how = "Written"; break;
case 10: $how = "Made up"; break; case 11: $how = "Uploaded"; break;
case 12: $how = "Forged"; break;
default: $how = "Sneaked through";
}
echo "<FONT SIZE=\"-1\">". strtr(t("$how by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp), "large")) ."</FONT>";
?>
</FONT>
</td>
<?php
echo "<td align=\"right\" background=\"themes/jeroen/images/menutitle.gif\" nowrap><b>". node_index($node) ."</b>";
?>
</td>
</tr>
<tr>
<td colspan="2" valign="top" width="100%">
2001-02-27 16:23:34 +00:00
<?php
echo "<br />". check_output($node->body, 1) ."<br />";
?>
2001-02-27 16:23:34 +00:00
</td>
</tr>
<tr>
<td colspan="2" align="right">
<?php
if ($main)
echo $this->links(node_link($node));
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<?php
} // close node function
2001-01-26 13:38:46 +00:00
function comment($comment, $link = "") {
echo "<A NAME=\"$comment->cid\"></a>\n";
2001-02-27 16:23:34 +00:00
// Create comment header:
echo " <table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" width=\"100%\">";
echo " <tr>";
echo " <td>";
echo " <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" BGCOLOR=\"#000000\" width=\"100%\">";
echo " <tr>";
echo " <td>";
echo " <table background=\"themes/jeroen/images/menutitle.gif\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">";
echo " <tr>";
echo " <td>";
echo " <table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">";
2001-02-27 16:23:34 +00:00
// Subject:
echo " <tr>";
echo " <td align=\"right\" width=\"5%\">";
echo " <FONT COLOR=\"#FEFEFE\"><B>". t("Subject") .":</B>";
echo " </td>";
echo " <td width=\"80%\">";
echo " <B>". check_output($comment->subject) ."</B>";
echo " </FONT>";
echo " </td>";
2001-02-27 16:23:34 +00:00
// Moderation:
echo " <td BGCOLOR=\"#6C6C6C\" background=\"themes/jeroen/images/menutitle.gif\" align=\"right\" ROWSPAN=\"2\" valign=\"middle\" width=\"15%\">";
echo " <FONT COLOR=\"#000000\">";
echo comment_moderation($comment);
echo " </FONT>";
echo " </td>";
echo " </tr>";
2001-02-27 16:23:34 +00:00
// Author:
echo " <tr>";
echo " <td align=\"right\"><FONT COLOR=\"#FEFEFE\">". t("Author") .":</FONT></td><td><B>". format_username($comment->userid) ."</B> ";
if ($comment->userid) {
2001-02-27 16:23:34 +00:00
// Display extra information line:
if ($comment->fake_email) $info .= format_email($comment->fake_email);
if (eregi("http://",$comment->url)) $info .= " | " . format_url($comment->url);
}
2001-02-27 16:23:34 +00:00
// Date:
echo " <FONT COLOR=\"#FEFEFE\">on ". format_date($comment->timestamp) ."</FONT>";
echo " </td>";
echo " </tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
2001-02-27 16:23:34 +00:00
// Print body of comment:
if ($comment) echo "
<tr>
<td BGCOLOR=\"#E7E7E7\" background=\"themes/jeroen/images/sketch.gif\">". check_output($comment->comment, 1) ."</td>
</tr>";
2001-02-27 16:23:34 +00:00
// Print bottom link(s):
echo " <tr><td align=\"right\" BGCOLOR=\"#E7E7E7\" background=\"themes/jeroen/images/sketch.gif\"><FONT COLOR=\"#E09226\">[</FONT> $link <FONT COLOR=\"#E09226\">]</FONT></td></tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
echo " </table>";
echo " <br />";
2001-02-27 16:23:34 +00:00
} // close comment function
function box($subject, $content, $region = "main") {
$img = (rand(0, 50) == 25) ? "boxbottomright2.gif" : "boxbottomright1.gif";
2001-02-27 16:23:34 +00:00
$width = rand(10, 200);
$img2 = (rand(0, 100) == 50) ? "boxtopleftside2.gif" : "boxtopleftside1.gif";
?>
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td background="themes/jeroen/images/boxtopleft.gif" width="20" height="20" border="0" nowrap>&nbsp;</td>
<td width="<?php echo $width; ?>" background="themes/jeroen/images/boxtop.gif">&nbsp;</td>
<td background="themes/jeroen/images/boxtopmiddle.gif" nowrap>&nbsp;</td>
<td background="themes/jeroen/images/boxtop.gif"nowrap>&nbsp;</td>
<td width="20" background="themes/jeroen/images/boxtopright.gif" nowrap>&nbsp;</td>
</tr>
<tr>
<td background="themes/jeroen/images/<?php echo $img2; ?>" height="20">&nbsp;</td>
<td align="center" width="100%" colspan="3" background="themes/jeroen/images/menutitle.gif" nowrap>
<FONT COLOR="#FEFEFE"><?php echo $subject; ?></FONT>
</td>
<td background="themes/jeroen/images/boxtoprightside.gif">&nbsp;</td>
</tr>
<tr>
<td background="themes/jeroen/images/boxleft.gif" nowrap>&nbsp;</td>
<td colspan="3" align="center" BGCOLOR="#E7E7E7" background="themes/jeroen/images/sketch.gif">
<table width="100%" border="0">
<tr>
<?php
if ($mybox == 1) {
echo $content;
$mybox = 0;
}
else {
echo "<td>";
echo $content;
echo "</td>";
}
?>
</tr>
</table>
</td>
<td background="themes/jeroen/images/boxright.gif" nowrap>&nbsp;</td>
</tr>
<tr>
<td background="themes/jeroen/images/boxbottomleft.gif" height="20" nowrap>&nbsp;</td>
<td colspan="3" background="themes/jeroen/images/boxbottom.gif">&nbsp;</td>
<td background="themes/jeroen/images/<?php echo $img; ?>" nowrap>&nbsp;</td>
</tr>
</table>
<br />
<?php
2001-02-27 16:23:34 +00:00
} // close box function
function footer() {
2001-02-27 16:23:34 +00:00
?>
</td>
<td width="20%" valign="top" align="right">
2001-02-27 16:23:34 +00:00
<?php
2001-02-27 16:23:34 +00:00
global $PHP_SELF;
theme_account("right", $this);
theme_blocks("right", $this);
2001-02-27 16:23:34 +00:00
?>
2001-02-27 16:23:34 +00:00
</td>
</tr>
<tr>
<td></td>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left" width="20" height="20" background="themes/jeroen/images/footerleft.gif" nowrap>&nbsp;</td>
<td width="100%" background="themes/jeroen/images/footer.gif" align="center" valign="middle">
<FONT COLOR="#E09226" SIZE="2">[ <?php print $this->links(link_page()); ?> ] </FONT>
</td>
<td align="right" width="20" background="themes/jeroen/images/footerright.gif" nowrap>&nbsp;</td>
</tr>
</table>
</td>
<td></td>
</tr>
</table>
</body>
</html>
<?php
}
}
?>