drupal/themes/jeroen/jeroen.theme

419 lines
19 KiB
Plaintext

<?PHP
class Theme {
/*
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() {
global $site_name;
PHP?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML>
<HEAD>
<TITLE><? echo $site_name; ?> - Tears of technology</TITLE>
<META NAME="description" CONTENT="drop.org">
<META NAME="keywords" CONTENT="drop, weblog, portal, community, news, article, announcements, stories, story, computer, science, space, hype, cult, geek, nerd, foo, bar">
<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: 8pt;}
TD img.pipe {display: block}
-->
</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";PHP ?>
<IMG SRC="themes/jeroen/images/<? echo $img; ?>" ALT="drop.org logo"><BR><BR>
</TD>
<TD WIDTH="20%">
<?PHP
$this->box("Drop where?", "<TR>
<TD ALIGN=\"left\" VALIGN=\"top\">
<A HREF=\"index.php\">home</A><BR>
<A HREF=\"module.php?mod=faq\">faq</A><BR>
<A HREF=\"search.php\">search</A>
</TD>
<TD ALIGN=\"right\" VALIGN=\"top\">
<A HREF=\"module.php?mod=diary\">diary</A><BR>
<A HREF=\"submit.php\">submit news</A><BR>
<A HREF=\"account.php\">account</A>
</TD>
</TR>");
PHP?>
</TD>
</TR>
<TR>
<TD VALIGN="top" ALIGN="right">
<?PHP
theme_blocks("left", $this);
PHP?>
</TD>
<TD WIDTH="80%" VALIGN="top" ALIGN="left">
<?PHP
} // close header function
function abstract($story) {
$timestamp = format_date($story->timestamp);
PHP?>
<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"); PHP?>" NOWRAP>&nbsp;</TD>
<TD ALIGN="center" VALIGN="top" WIDTH="100%" BACKGROUND="themes/jeroen/images/newsmiddle.gif" NOWRAP>
<B><?PHP echo "". check_output($story->subject) .""; PHP?></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"; PHP?>" 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%">
<TR>
<TD ALIGN="left" BACKGROUND="themes/jeroen/images/menutitle.gif" NOWRAP>
<FONT COLOR="#FEFEFE">
<?PHP
switch (rand(0,13)) {
case 0: $how = "Yelled at us"; 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 at us"; break; case 7: $how = "Morsed"; break;
case 8: $how = "Flagged"; break; case 9: $how = "Written to us"; 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($story->userid), "%b" => $timestamp, "large")) ."
</FONT>
</TD>
<TD ALIGN=\"right\" BACKGROUND=\"themes/jeroen/images/menutitle.gif\" NOWRAP>
<B><A HREF=\"search.php?category=". urlencode($story->section) ."\"><FONT COLOR=\"<? $this->fgc3; ?>\">$story->section</FONT></A></B>";
PHP?>
</TD>
</TR>
<TR>
<TD COLSPAN="2" VALIGN="top" WIDTH="100%" BGCOLOR="#E7E7E7" BACKGROUND="themes/jeroen/images/sketch.gif">
<TABLE WIDTH="100%">
<TR>
<TD>
<?PHP
if ($story->updates)
echo "<P><FONT COLOR=\"#E09226\">". t("Editor's note") .":</FONT>". check_output($story->updates, 1) ."</P>";
if ($story->abstract)
echo "<P>". check_output($story->abstract, 1) ."</P>";
PHP?>
</TD>
</TR>
<TR>
<TD ALIGN="right">
<FONT COLOR="#E09226"><? echo theme_morelink($this, $story); ?></FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<BR>
<?PHP
} // close abstract function
function article($story, $reply) {
$timestamp = format_date($story->timestamp);
PHP?>
<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");PHP ?>" NOWRAP>&nbsp;</TD>
<TD ALIGN="center" VALIGN="top" WIDTH="100%" BACKGROUND="themes/jeroen/images/newsmiddle.gif" NOWRAP>
<B><?PHP echo "". check_output($story->subject) .""; PHP?></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) $img = "news5.gif"; PHP?>" 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%">
<TR>
<TD ALIGN="left" BACKGROUND="themes/jeroen/images/menutitle.gif" NOWRAP>
<FONT COLOR="#FEFEFE">
<?PHP
switch (rand(0,13)) {
case 0: $how = "Yelled at us"; 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 at us"; break; case 7: $how = "Morsed"; break;
case 8: $how = "Flagged"; break; case 9: $how = "Written to us"; break;
case 10: $how = "Made up"; break; case 11: $how = "Uploaded"; break;
case 12: $how = "Forged"; break;
default: $how = "Sneaked through";
}
if ($story->userid) {
echo "<FONT SIZE=\"-1\">". strtr(t("$how by %a on %b"), array("%a" => format_username($story->userid), "%b" => $timestamp, "large")) ."
</FONT>
</TD>
<TD ALIGN=\"right\" BACKGROUND=\"themes/jeroen/images/menutitle.gif\" NOWRAP>
<B><A HREF=\"search.php?category=". urlencode($story->section) ."\"><FONT COLOR=\"<? $this->fgc3; ?>\">$story->section</FONT></A></B>";
}
else {
echo "<FONT SIZE=\"-1\">Reported to us by $anonymous on $story->timestamp"; ?><? print "</FONT>
</TD>
<TD ALIGN=\"right\" BACKGROUND=\"themes/jeroen/images/menutitle.gif\" NOWRAP>
<A HREF=\"search.php?category=". urlencode($story->section) ."\"><FONT COLOR=\"<? $this->fgc3; ?>\">$story->section</FONT></A>";
}
PHP?>
</FONT>
</TD>
</TR>
<TR>
<TD COLSPAN="2" VALIGN="top" WIDTH="100%" BGCOLOR="#E7E7E7" BACKGROUND="themes/jeroen/images/sketch.gif">
<TABLE WIDTH="100%">
<TR>
<TD>
<?PHP
if ($story->updates)
echo "<P>check_output($story->abstract, 1)</P><P><FONT COLOR=\"#E09226\">Editor's note by <A HREF=\"account.php?op=userinfo&uname=$story->editor\">$story->editor</A>:</FONT>$story->updates</P>";
else
echo check_output($story->abstract, 1);
if ($story->article)
echo "<P>". check_output($story->article, 1) ."</P>";
PHP?>
</TD>
</TR>
<TR>
<TD ALIGN="right">
<FONT COLOR="#E09226"><? echo $reply; ?></FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<BR>
<?PHP
} // close article function
function controls() {
echo comment_controls();
}
function comment($comment, $link = "", $thread = "") {
echo "<A NAME=\"$comment->cid\"></A>\n";
// 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%\">";
// 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>";
// 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>";
// Author:
echo " <TR>";
echo " <TD ALIGN=\"right\"><FONT COLOR=\"#FEFEFE\">". t("Author") .":</FONT></TD><TD><B>" .format_username($comment->userid) . "</B> ";
if ($comment->userid != $anonymous) {
// Display extra information line:
if ($comment->fake_email) $info .= format_email($comment->fake_email);
if (eregi("http://",$comment->url)) $info .= " | " . format_url($comment->url);
}
// Date:
echo " <FONT COLOR=\"#FEFEFE\">on ". format_date($comment->timestamp) ."</FONT>";
echo " </TD>";
echo " </TR>";
echo " </TABLE>";
echo " </TD>";
echo " </TR>";
// Print body of comment:
if ($comment) echo " <TR><TD BGCOLOR=\"#E7E7E7\" BACKGROUND=\"themes/jeroen/images/sketch.gif\">" . check_output($comment->comment, 1) ."</TD></TR>";
// Print thread (if any):
if ($thread) echo " <TR><TD BGCOLOR=\"#E7E7E7\" BACKGROUND=\"themes/jeroen/images/sketch.gif\">$thread</TD></TR>";
// 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>";
} // close comment function
function box($subject, $content, $options = "") {
$img = (rand(0, 50) == 25) ? "boxbottomright2.gif" : "boxbottomright1.gif";
$width = rand(10, 200);
$img2 = (rand(0, 100) == 50) ? "boxtopleftside2.gif" : "boxtopleftside1.gif";
PHP?>
<TABLE WIDTH="100%" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD WIDTH="20" HEIGHT="20" BACKGROUND="themes/jeroen/images/boxtopleft.gif" NOWRAP>&nbsp;</TD>
<TD WIDTH="<? echo $width; ?>" BACKGROUND="themes/jeroen/images/boxtop.gif">&nbsp;</TD>
<TD BACKGROUND="themes/jeroen/images/boxtopmiddle.gif">&nbsp;</TD>
<TD BACKGROUND="themes/jeroen/images/boxtop.gif">&nbsp;</TD>
<TD WIDTH="20" BACKGROUND="themes/jeroen/images/boxtopright.gif" NOWRAP>&nbsp;</TD>
</TR>
<TR>
<TD BACKGROUND="themes/jeroen/images/<? echo $img2; ?>" HEIGHT="20">&nbsp;</TD>
<TD ALIGN="center" WIDTH="100%" COLSPAN="3" BACKGROUND="themes/jeroen/images/menutitle.gif" NOWRAP>
<FONT COLOR="#FEFEFE"><? 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>
<TR>
<TD>
<?PHP echo $content; PHP?>
</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/<? echo $img; ?>" NOWRAP>&nbsp;</TD>
</TR>
</TABLE>
<BR>
<?PHP
} // close box function
function footer() {
PHP?>
</TD>
<TD WIDTH="20%" VALIGN="top" ALIGN="right">
<?PHP
global $PHP_SELF;
theme_account($this);
theme_blocks("right", $this);
PHP?>
</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">[ <A HREF="">Home</A> | <A HREF="module.php?mod=faq">Faq</A> | <A HREF="search.php">Search</A> | <A HREF="module.php?mod=diary">Diary</A>| <A HREF="submit.php">Submit news</A> | <A HREF="account.php">Account</A> ] </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>
<?
}
}
?>