marvin.theme 8.4 KB
Newer Older
1
<?
Dries's avatar
 
Dries committed
2

3
 class Theme {
4 5
   var $link = "#666699";

Dries's avatar
 
Dries committed
6
   function header() {
Dries's avatar
 
Dries committed
7
     global $site_name;
8
    ?>
Dries's avatar
 
Dries committed
9
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
10 11
     <HTML>
     <HEAD>
Dries's avatar
 
Dries committed
12
      <TITLE><? print $site_name; ?></TITLE>
13
     </HEAD>
Dries's avatar
 
Dries committed
14
     <STYLE type="text/css">
15 16
      <!--
       BODY,TD,P,UL,LI,DIV,FORM,EM,BLOCKQUOTE { font-size: 10pt; font-family: Lucida,Verdana,Helvetica,Arial; }
Dries's avatar
 
Dries committed
17
       TH { font-size: 10pt; font-family: Lucida,Verdana,Helvetica,Arial; }
18 19 20 21 22
      -->
     </STYLE>
     <BODY TEXT="#000000" BGCOLOR="#FFFFFF" ALINK="#CCCCCC" LINK="#665555" VLINK="#665555">
      <TABLE BORDER="0" CELLPADDING="8" CELLSPACING="0">
       <TR>
Dries's avatar
 
Dries committed
23
        <TD WIDTH="30" ROWSPAN="3">&nbsp;</TD>
Dries's avatar
 
Dries committed
24
        <TD><A HREF="index.php"><IMG SRC="themes/marvin/images/logo.gif" ALT="" BORDER="0"></A></TD>
Dries's avatar
Dries committed
25
        <TD>&nbsp;</TD>
26 27
       </TR>
       <TR>
Dries's avatar
 
Dries committed
28 29 30 31 32
        <TD ALIGN="right" COLSPAN="2">
         <?
           print "<SMALL><A HREF=\"index.php\">". t("home") ."</A> | <A HREF=\"module.php?mod=faq\">". t("faq") ."</A> | <A HREF=\"module.php?mod=diary\">". t("diary") ."</A> | <A HREF=\"search.php\">". t("search") ."</A> | <A HREF=\"submit.php\">". t("submit news") ."</A> | <A HREF=\"account.php\">". t("user account") ."</A></SMALL>\n";
         ?>
        </TD>
33 34
       </TR>
       <TR>
Dries's avatar
 
Dries committed
35
        <TD VALIGN="top" WIDTH="85%">
36 37 38 39
    <?
   }

   function abstract($story) {
Dries's avatar
 
Dries committed
40
     print "\n<!-- story: \"$story->subject\" -->\n";
41
     print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">\n";
Dries's avatar
 
Dries committed
42
     print " <TR><TD COLSPAN=\"2\"><IMG SRC=\"themes/marvin/images/drop.gif\" ALT=\"\"> &nbsp; <B>". check_output($story->subject) ."</B></TD></TR>\n";
43 44 45
     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";
Dries's avatar
 
Dries committed
46
     print "   <FONT COLOR=\"#7C7C7C\"><SMALL>". strtr(t("Submitted by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp, "large"))); ?><? if ($story->department) print "<BR>from the $story->department dept."; ?><? print "</SMALL></FONT></TD><TD ALIGN=\"right\" VALIGN=\"top\" NOWRAP><SMALL><A HREF=\"?section=". urlencode($story->section) ."\"><FONT COLOR=\"#83997A\">$story->section</FONT></A></SMALL>\n";
47 48 49 50 51
     print "  </TD>\n";
     print " </TR>\n";
     print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
     print " <TR>\n";
     print "  <TD COLSPAN=\"2\">\n";
Dries's avatar
 
Dries committed
52 53
     if ($story->abstract) print "<P>". check_output($story->abstract, 1) ."</P>\n";
     if ($story->updates) print "<P><FONT COLOR=\"#666699\">". t("Editor's note") .":</FONT> ". check_output($story->updates, 1) ."</P>\n";
54 55 56
     print "  </TD>\n";
     print " </TR>\n";
     print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
Dries's avatar
 
Dries committed
57
     print " <TR><TD COLSPAN=\"2\">". theme_morelink($this, $story) ."</TD></TR>\n";
58 59 60 61
     print "</TABLE>\n";
     print "<BR><BR>\n\n";
   }

Dries's avatar
 
Dries committed
62
   function article($story, $reply = "") {
Dries's avatar
 
Dries committed
63
     print "\n<!-- story: \"$story->subject\" -->\n";
64
     print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">\n";
Dries's avatar
 
Dries committed
65
     print " <TR><TD COLSPAN=\"2\"><IMG SRC=\"themes/marvin/images/drop.gif\" ALT=\"\"> &nbsp; <B>". check_output($story->subject) ."</B></TD></TR>\n";
66
     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";
Dries's avatar
 
Dries committed
67
     print " <TR><TD><FONT COLOR=\"#7C7C7C\"><SMALL>". strtr(t("Submitted by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp, "large"))); ?><? if ($story->department) print "<BR>from the $story->department dept."; ?><? print "</SMALL></FONT></TD><TD ALIGN=\"right\" VALIGN=\"top\" NOWRAP><SMALL><A HREF=\"index.php?section=". urlencode($story->section) ."\"><FONT COLOR=\"#83997A\">$story->section</FONT></A></SMALL></TD></TR>\n";
68 69 70
     print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
     print " <TR>\n";
     print "  <TD COLSPAN=\"2\">\n";
Dries's avatar
 
Dries committed
71
     if ($story->abstract) print "   <P>". check_output($story->abstract, 1) ."</P>\n";
Dries's avatar
 
Dries committed
72
     if ($story->updates) print "   <P><FONT COLOR=\"#666699\">". t("Editor's note") .":</FONT>". check_output($story->updates, 1) ."</P>\n";
Dries's avatar
 
Dries committed
73
     if ($story->article) print "   <P>". check_output($story->article, 1) ."</P>\n";
74 75 76 77 78 79 80 81
     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";
   }

Dries's avatar
 
Dries committed
82
   function controls() {
Dries's avatar
 
Dries committed
83 84
     print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">\n";
     print " <TR><TD BGCOLOR=\"#000000\"><IMG SRC=\"themes/marvin/images/pixel.gif\" WIDTH=\"100%\" HEIGHT=\"0\" ALT=\"\"></TD></TR>\n";
Dries's avatar
 
Dries committed
85 86
     print " <TR><TD>&nbsp;</TD></TR>\n";
     print " <TR><TD>". comment_controls() ."</TD></TR>\n";
Dries's avatar
 
Dries committed
87 88
     print " <TR><TD BGCOLOR=\"#000000\"><IMG SRC=\"themes/marvin/images/pixel.gif\" WIDTH=\"100%\" HEIGHT=\"0\" ALT=\"\"></TD></TR>\n";
     print "</TABLE>";
89 90
   }

Dries's avatar
 
Dries committed
91
   function comment($comment, $link = "") {
Dries's avatar
Dries committed
92
     print "<A NAME=\"$comment->cid\">\n";
93

Dries's avatar
 
Dries committed
94
     // Create comment header:
95 96 97 98 99
     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";
Dries's avatar
 
Dries committed
100
     print "     <TD BGCOLOR=\"#EAEAEA\">\n";
101 102 103
     print "      <TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
     print "       <TR>\n";

Dries's avatar
 
Dries committed
104
     // Subject:
Dries's avatar
 
Dries committed
105
     print "        <TD ALIGN=\"right\" WIDTH=\"5%\"><B>". t("Subject") .":</FONT></TD>\n";
Dries's avatar
 
Dries committed
106
     print "        <TD WIDTH=\"80%\"><B><FONT COLOR=\"#666699\">". check_output($comment->subject) ."</FONT></B></TD>\n";
107

Dries's avatar
 
Dries committed
108
     // Moderation:
109
     print "        <TD ALIGN=\"right\" ROWSPAN=\"3\" VALIGN=\"middle\" WIDTH=\"15%\">\n";
Dries's avatar
 
Dries committed
110
     print comment_moderation($comment);
111 112 113
     print "        </TD>\n";
     print "       </TR>\n";

Dries's avatar
 
Dries committed
114
     // Author:
115
     print "       <TR>\n";
Dries's avatar
 
Dries committed
116
     print "        <TD ALIGN=\"right\" VALIGN=\"top\">". t("Author") .":</TD><TD>". format_username($comment->userid) ."</TD>\n";
117 118
     print "       </TR>\n";

Dries's avatar
 
Dries committed
119
     // Date
120
     print "       <TR>\n";
Dries's avatar
 
Dries committed
121
     print "        <TD ALIGN=\"right\">". t("Date") .":</TD><TD>". format_date($comment->timestamp) ."</TD>\n";
122 123 124 125 126 127
     print "       </TR>\n";

     print "      </TABLE>\n";
     print "     </TD>\n";
     print "    </TR>\n";

Dries's avatar
 
Dries committed
128
     // Print body of comment:
Dries's avatar
Dries committed
129
     if ($comment->comment) print "    <TR><TD BGCOLOR=\"#FFFFFF\">". check_output($comment->comment, 1) ."</TD></TR>\n";
130

Dries's avatar
 
Dries committed
131
     // Print bottom link(s):
Dries's avatar
 
Dries committed
132
     print "    <TR><TD ALIGN=\"right\" BGCOLOR=\"#EAEAEA\">[ $link ]</TD></TR>\n";
133 134 135 136 137 138 139
     print "   </TABLE>\n";
     print "  </TD>\n";
     print " </TR>\n";
     print "</TABLE>\n";
     print "<BR>\n\n";
   }

Dries's avatar
 
Dries committed
140
   function box($subject, $content, $options = "") {
141 142 143
     print "\n<!-- box: \"$subject\" -->\n";
     print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" BGCOLOR=\"#000000\" WIDTH=\"100%\">\n";
     print " <TR>\n";
Dries's avatar
 
Dries committed
144
     print "  <TD>\n";
145
     print "   <TABLE BORDER=\"0\" CELLPADDING=\"5\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
Dries's avatar
 
Dries committed
146
     print "    <TR><TD ALIGN=\"center\" BGCOLOR=\"#EAEAEA\" NOWRAP><FONT COLOR=\"#404040\"><B>$subject</B></FONT></TD></TR>\n";
Dries's avatar
 
Dries committed
147
     print "    <TR><TD BGCOLOR=\"#FFFFFF\">$content</TD></TR>\n";
148 149 150 151 152 153 154 155 156 157
     print "   </TABLE>\n";
     print "  </TD>\n";
     print " </TR>\n";
     print "</TABLE>\n";
     print "<BR>\n\n";
   }

   function footer() {
     ?>
       </TD>
Dries's avatar
 
Dries committed
158
       <TD VALIGN="top" WIDTH=\"200\">
159
         <?
Dries's avatar
 
Dries committed
160
          theme_account($this);
Dries's avatar
 
Dries committed
161
          theme_blocks("all", $this);
Dries's avatar
 
Dries committed
162
         ?>
163 164 165 166
       </TD>
      </TR>
      <TR>
       <TD ALIGN="center" COLSPAN="3">
Dries's avatar
 
Dries committed
167
        <?
Dries's avatar
 
Dries committed
168
          print "<SMALL>[ <A HREF=\"index.php\">". t("home") ."</A> | <A HREF=\"module.php?mod=faq\">". t("faq") ."</A> | <A HREF=\"module.php?mod=diary\">". t("diary") ."</A> | <A HREF=\"search.php\">". t("search") ."</A> | <A HREF=\"submit.php\">". t("submit news") ."</A> | <A HREF=\"account.php\">". t("user account") ."</A> ]</SMALL><P>\n";
Dries's avatar
 
Dries committed
169
        ?>
Dries's avatar
 
Dries committed
170
        <CENTER><SMALL><I><FONT COLOR="#7C7C7C">Powered by <A HREF="http://drop.org/module.php?mod=drupal">drupal</A>.</FONT></I></SMALL></CENTER>
171 172 173
       </TD>
      </TR>
     </TABLE>
Dries's avatar
 
Dries committed
174
    </BODY>
175 176 177 178 179
    </HTML>
    <?
   }
 }

Dries's avatar
 
Dries committed
180
?>