drupal/themes/marvin/marvin.theme

325 lines
14 KiB
Plaintext
Raw Normal View History

<?
class Theme {
### color set #1:
var $bgcolor1 = "#EAEAEA"; // background color
var $fgcolor1 = "#404040"; // table body color
var $hlcolor1 = "#666699"; // high-light color
### color set #2:
var $bgcolor2 = "#666699";
var $fgcolor2 = "#666699";
var $hlcolor2 = "#666699";
### color set #3:
var $bgcolor3 = "#EFEFEF";
var $fgcolor3 = "yellow";
var $hlcolor3 = "yellow";
######
# Syntax.......: header($title);
# Description..: a function to draw the page header.
function header($title) {
global $site_name;
?>
2000-10-21 13:34:28 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML>
<HEAD>
<TITLE><? print $site_name; ?></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">
</HEAD>
<STYLE type="text/css">
<!--
BODY,TD,P,UL,LI,DIV,FORM,EM,BLOCKQUOTE { font-size: 10pt; font-family: Lucida,Verdana,Helvetica,Arial; }
TH { font-size: 10pt; font-family: Lucida,Verdana,Helvetica,Arial; }
-->
</STYLE>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" ALINK="#CCCCCC" LINK="#665555" VLINK="#665555">
<TABLE BORDER="0" CELLPADDING="8" CELLSPACING="0">
<TR>
<TD WIDTH="30" ROWSPAN="3">&nbsp;</TD>
<TD><A HREF=""><IMG SRC="themes/marvin/images/logo.gif" ALT="drop.org" BORDER="0"></A></TD>
<TD>
<LI>Create an <A HREF="account.php?op=register">account</A> and <A HREF="submit.php">submit</A> new stories.</LI>
<LI>Send your questions, feedback and bug reports to <A HREF="mailto:info@drop.org">info@drop.org</A>.</LI>
</TD>
</TR>
<TR>
<TD ALIGN="right" COLSPAN="2"><SMALL><A HREF="/">home</A> | <A HREF="module.php?mod=faq">faq</A> | <A HREF="module.php?mod=diary">diary</A> | <A HREF="search.php">search</A> | <A HREF="submit.php">submit news</A> | <A HREF="account.php">user account</A></SMALL></TD>
</TR>
<TR>
<TD VALIGN="top" WIDTH="100%">
<?
}
######
# Syntax.......: abstract(...);
# Description..: a function to draw an abstract story box, that is the
# boxes displayed on the main page.
function abstract($story) {
print "\n<!-- story: \"$story->subject\" -->\n";
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">\n";
print " <TR><TD COLSPAN=\"2\"><IMG SRC=\"themes/marvin/images/drop.gif\" ALT=\"\"> &nbsp; <B>$story->subject</B></TD></TR>\n";
print " <TR VALIGN=\"bottom\"><TD COLSPAN=\"2\" BGCOLOR=\"#000000\" WIDTH=\"100%\"><IMG SRC=\"themes/marvin/images/pixel.gif\" WIDTH=\"1\" HEIGHT=\"0\" ALT=\"\"></TD></TR>\n";
print " <TR>\n";
print " <TD>\n";
print " <FONT COLOR=\"#7C7C7C\"><SMALL>Submitted by ". format_username($story->userid) ." on ". format_date($story->timestamp, "extra large"). ""; ?><? if ($story->department) print "<BR>from the $story->department dept."; ?><? print "</SMALL></FONT></TD><TD ALIGN=\"right\" VALIGN=\"top\" NOWRAP><SMALL><A HREF=\"search.php?category=". urlencode($story->category) ."\"><FONT COLOR=\"#83997A\">$story->category</FONT></A></SMALL>\n";
print " </TD>\n";
print " </TR>\n";
print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
print " <TR>\n";
print " <TD COLSPAN=\"2\">\n";
if ($story->abstract) print " <P>". check_output($story->abstract, 1) ."</P>\n";
if ($story->updates) print " <P><FONT COLOR=\"$this->bgcolor2\">Editor's note:</FONT> ". check_output($story->updates, 1) ."</P>\n";
print " </TD>\n";
print " </TR>\n";
print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
print " <TR><TD COLSPAN=\"2\">". display_morelink($this, $story) ."</TD></TR>\n";
print "</TABLE>\n";
print "<BR><BR>\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<!-- story: \"$story->subject\" -->\n";
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">\n";
print " <TR><TD COLSPAN=\"2\"><IMG SRC=\"themes/marvin/images/drop.gif\" ALT=\"\"> &nbsp; <B>$story->subject</B></TD></TR>\n";
print " <TR VALIGN=\"bottom\"><TD COLSPAN=\"2\" BGCOLOR=\"#000000\" WIDTH=\"100%\"><IMG SRC=\"themes/marvin/images/pixel.gif\" WIDTH=\"1\" HEIGHT=\"0\" ALT=\"\"></TD></TR>\n";
print " <TR>\n";
print " <TD>\n";
print " <FONT COLOR=\"#7C7C7C\"><SMALL>Submitted by ". format_username($story->userid) ." on ". format_date($story->timestamp, "extra large") .""; ?><? if ($story->department) print "<BR>from the $story->department dept."; ?><? print "</SMALL></FONT></TD><TD ALIGN=\"right\" VALIGN=\"top\" NOWRAP><SMALL><A HREF=\"search.php?category=". urlencode($story->category) ."\"><FONT COLOR=\"#83997A\">$story->category</FONT></A></SMALL>\n";
print " </TD>\n";
print " </TR>\n";
print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
print " <TR>\n";
print " <TD COLSPAN=\"2\">\n";
if ($story->abstract) print " <P>". check_output($story->abstract, 1) ."</P>\n";
if ($story->updates) print " <P><FONT COLOR=\"$this->bgcolor2\">Editor's note:</FONT>". check_output($story->updates, 1) ."</P>\n";
if ($story->article) print " <P>". check_output($story->article, 1) ."</P>\n";
print " </TD>\n";
print " </TR>\n";
print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
print " <TR><TD ALIGN=\"right\" COLSPAN=\"2\">". $reply ."</TD></TR>\n";
print "</TABLE>\n";
print "<BR><BR>\n\n";
}
######
# Syntax.......: commentControl(...);
# Description..: this function is used to theme the comment control box.
function commentControl($sid, $title, $threshold, $mode, $order) {
global $user;
$query = db_query("SELECT sid FROM comments WHERE sid = $sid");
if (!$query) $count = 0; else $count = db_num_rows($query);
if (!isset($threshold)) $threshold = 0;
?>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="#000000" WIDTH="100%">
<TR>
<TD>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD ALIGN="center" BGCOLOR="<? echo "$this->bgcolor2"; ?>"><FONT COLOR="<? echo "$this->bgcolor1" ?>"><B>Comment control</B></FONT></TD>
</TR>
<TR>
<TD ALIGN="center" BGCOLOR="<? echo "$this->bgcolor1"; ?>">
<FORM METHOD="post" ACTION="discussion.php">
<SMALL>
<INPUT TYPE="hidden" NAME="id" VALUE="<? echo "$sid"; ?>">
<SELECT NAME="threshold">
<OPTION VALUE="-1" <? if ($threshold == -1) { echo "SELECTED"; } ?>>Threshold: -1
<OPTION VALUE="0" <? if ($threshold == 0) { echo "SELECTED"; } ?>>Threshold: 0
<OPTION VALUE="1" <? if ($threshold == 1) { echo "SELECTED"; } ?>>Threshold: 1
<OPTION VALUE="2" <? if ($threshold == 2) { echo "SELECTED"; } ?>>Threshold: 2
<OPTION VALUE="3" <? if ($threshold == 3) { echo "SELECTED"; } ?>>Threshold: 3
<OPTION VALUE="4" <? if ($threshold == 4) { echo "SELECTED"; } ?>>Threshold: 4
<OPTION VALUE="5" <? if ($threshold == 5) { echo "SELECTED"; } ?>>Threshold: 5
</SELECT>
<SELECT NAME="mode">
<OPTION VALUE="nested" <? if ($mode == "nested") { echo "SELECTED"; } ?>>Nested
<OPTION VALUE="flat" <? if ($mode == "flat") { echo "SELECTED"; } ?>>Flat
<OPTION VALUE="threaded" <? if (!isset($mode) || $mode=='threaded' || $mode=="") { echo "SELECTED"; } ?>>Threaded
</SELECT>
<SELECT NAME="order">
<OPTION VALUE="0" <? if (!$order) { echo "SELECTED"; } ?>>Oldest first
<OPTION VALUE="1" <? if ($order==1) { echo "SELECTED"; } ?>>Newest first
<OPTION VALUE="2" <? if ($order==2) { echo "SELECTED"; } ?>>Highest scoring first
</SELECT>
<INPUT TYPE="submit" NAME="op" VALUE="Save">
</SMALL>
</FORM>
</TD>
</TR>
<TR>
<TD ALIGN="center" BGCOLOR="<? echo "$this->bgcolor2"; ?>"><SMALL><FONT COLOR="#C0C0C0">At least <? echo format_plural(discussion_num_filtered($sid, $pid), "comment", "comments"); ?> below your threshold.</FONT></SMALL></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<BR><BR>
<?
}
######
# Syntax.......: comment(...);
# Description..: this function is used to theme user comments.
function comment($comment, $link, $thread = "") {
print "<A NAME=\"$comment->cid\">\n";
### Create comment header:
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" BGCOLOR=\"#000000\" WIDTH=\"100%\">\n";
print " <TR BGCOLOR=\"#000000\">\n";
print " <TD>\n";
print " <TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
print " <TR>\n";
print " <TD BGCOLOR=\"$this->bgcolor1\">\n";
print " <TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
print " <TR>\n";
### Subject:
print " <TD ALIGN=\"right\" WIDTH=\"5%\"><B>Subject:</FONT></TD>\n";
print " <TD WIDTH=\"80%\"><B><FONT COLOR=\"$this->hlcolor1\">". check_output($comment->subject) ."</FONT></B></TD>\n";
### Moderation:
print " <TD ALIGN=\"right\" ROWSPAN=\"3\" VALIGN=\"middle\" WIDTH=\"15%\">\n";
display_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes);
print " </TD>\n";
print " </TR>\n";
### Author:
print " <TR>\n";
print " <TD ALIGN=\"right\" VALIGN=\"top\">Author:</TD><TD>". format_username($comment->userid) ."</TD>\n";
print " </TR>\n";
### Date
print " <TR>\n";
print " <TD ALIGN=\"right\">Date:</TD><TD>". format_date($comment->timestamp) ."</TD>\n";
print " </TR>\n";
print " </TABLE>\n";
print " </TD>\n";
print " </TR>\n";
### Print body of comment:
if ($comment->comment) print " <TR><TD BGCOLOR=\"#FFFFFF\">". check_output($comment->comment, 1) ."</TD></TR>\n";
### Print thread (if any):
if ($thread) print " <TR><TD BGCOLOR=\"$this->bgcolor1\">$thread</TD></TR>\n";
### Print bottom link(s):
print " <TR><TD ALIGN=\"right\" BGCOLOR=\"$this->bgcolor1\">[ $link ]</TD></TR>\n";
print " </TABLE>\n";
print " </TD>\n";
print " </TR>\n";
print "</TABLE>\n";
print "<BR>\n\n";
}
######
# Syntax.......: box($subject, $body, $options = "");
# Description..: a function to draw a box/block.
function box($subject, $content, $options = "") {
print "\n<!-- box: \"$subject\" -->\n";
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" BGCOLOR=\"#000000\" WIDTH=\"100%\">\n";
print " <TR>\n";
print " <TD $wrap>\n";
print " <TABLE BORDER=\"0\" CELLPADDING=\"5\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor1\" WIDTH=\"100%\"><FONT COLOR=\"$this->fgcolor1\"><B>$subject</B></FONT></TD></TR>\n";
print " <TR><TD BGCOLOR=\"#FFFFFF\" $options>$content</TD></TR>\n";
print " </TABLE>\n";
print " </TD>\n";
print " </TR>\n";
print "</TABLE>\n";
print "<BR>\n\n";
}
######
# Syntax.......: footer();
# Description..: a function to draw the page footer.
function footer() {
?>
</TD>
<TD VALIGN="top">
<?
global $PHP_SELF;
if (strstr($PHP_SELF, "index.php")) {
global $user, $date;
### Display account:
display_account($this);
### Display old headlines:
display_old_headlines($this);
### Display module blocks:
display_module_blocks();
}
elseif (strstr($PHP_SELF, "account.php")) {
### Display account:
display_account($this);
}
elseif (strstr($PHP_SELF, "module.php")) {
### Display account:
display_account($this);
}
elseif (strstr($PHP_SELF, "submission.php")) {
### Display account:
display_account($this);
}
elseif (strstr($PHP_SELF, "submit.php")) {
### 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 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);
}
?>
</TD>
</TR>
<TR>
<TD ALIGN="center" COLSPAN="3">
<SMALL>[ <A HREF="/">home</A> | <A HREF="module.php?mod=faq">faq</A> | <A HREF="module.php?mod=diary">diary</A> | <A HREF="search.php">search</A> | <A HREF="submit.php">submit news</A> | <A HREF="account.php">user account</A> ]</SMALL>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<?
}
}
?>