example.theme 4.64 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
<?php

  class Theme {

    function header() {
      global $site_name;

?>

      <HTML>
Dries's avatar
 
Dries committed
11

12 13 14
        <HEAD>
          <TITLE><? echo $site_name; ?></TITLE>
        </HEAD>
Dries's avatar
 
Dries committed
15

16 17 18 19 20
        <BODY>
          <TABLE BORDER="1">
            <TR>
              <TD>
                Logo? <!-- I left a TD to add a logo of some kind -->
Dries's avatar
 
Dries committed
21 22 23 24 25 26 27
              </TD>
              <TD ALIGN="right" COLSPAN="2">

<?php
               print theme_link(" | ");
?>

Dries's avatar
 
Dries committed
28
              </TD>
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
            </TR>
            <TR>
              <TD VALIGN="top">

<?php
                theme_blocks("left", $this);

?>

              </TD>
              <TD>

<?php

    } // close header function

    function story($story, $reply = 0) {
?>

Dries's avatar
 
Dries committed
48
              <TABLE BORDER="1" WIDTH="100%">
49
                <TR>
Dries's avatar
 
Dries committed
50
                  <TD COLSPAN="2">
Dries's avatar
 
Dries committed
51
                    <?php echo check_output($story->title); ?>
52 53 54 55 56 57 58
                  </TD>
                </TR>
                <TR>
                  <TD>

<?php

Dries's avatar
 
Dries committed
59 60 61
                     echo strtr(t("$how by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp, "large")));
?>

62 63
                   </TD>
                   <TD>
Dries's avatar
 
Dries committed
64 65

<?php
Dries's avatar
 
Dries committed
66
                     echo "<A HREF=\"search.php?category=". urlencode($story->section) ."\">". check_output($story->section) ."</A>";
67 68 69 70 71 72

?>

                   </TD>
                 </TR>
                 <TR>
Dries's avatar
 
Dries committed
73
                   <TD COLSPAN="2">
74 75

<?php
Dries's avatar
 
Dries committed
76

77 78
                        echo "<P>". check_output($story->abstract, 1) ."</P>";
                        if ($reply)
Dries's avatar
 
Dries committed
79
                          echo "<P>". check_output($story->article, 1) ."</P>";
80 81 82 83 84

?>
                   </TD>
                 </TR>
                 <TR>
Dries's avatar
 
Dries committed
85
                   <TD COLSPAN="2">
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

<?php


                     if (!$reply)
                       echo theme_morelink($this, $story);
                     else
                       echo $reply;

?>

                   </TD>
                </TR>
              </TABLE>
              <BR>

<?php

    } // close story function

    function controls() {
      echo comment_controls();
    }

Dries's avatar
 
Dries committed
110
    function comment($comment, $link = "") {
111 112 113
      echo "<A NAME=\"$comment->cid\"></A>\n";

      // Create comment header:
Dries's avatar
 
Dries committed
114
      echo "  <TABLE BORDER=\"1\" WIDTH=\"100%\">";
115 116
      echo "    <TR>";
      echo "      <TD>";
Dries's avatar
 
Dries committed
117 118 119 120 121
      echo          t("Subject") .":";
      echo "      </TD>";
      echo "      <TD>";
      echo "       ". check_output($comment->subject);
      echo "      </TD>";
Dries's avatar
 
Dries committed
122

123
      // Moderation:
Dries's avatar
 
Dries committed
124 125
      echo "      <TD>";
      echo          comment_moderation($comment);
126 127
      echo "      </TD>";
      echo "    </TR>";
Dries's avatar
 
Dries committed
128

Dries's avatar
 
Dries committed
129 130
      // Author and date:
      echo "    <TR>";
Dries's avatar
 
Dries committed
131
      echo "      <TD>";
Dries's avatar
 
Dries committed
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
      echo         t("Author") .":";
      echo "      </TD>";
      echo "      <TD COLSPAN=\"2\">";
      echo          format_username($comment->userid) ." on ". format_date($comment->timestamp);
      echo "      </TD>";
      echo "    </TR>";

      // Body of comment:
      echo "    <TR>";
      echo "      <TD COLSPAN=\"3\">";
      echo         check_output($comment->comment, 1);

      // Print navigation / control links:
      echo "       <P>$link</P>";
      echo "      </TD>";
      echo "    </TR>";
      echo "  </TABLE>";
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
    } // close comment function

    function box($subject, $content, $options = "") {

?>

              <TABLE>
                <TR>
                  <TD></TD>
                  <TD></TD>
                  <TD></TD>
                  <TD></TD>
                  <TD></TD>
                </TR>
                <TR>
                  <TD></TD>
                  <TD>
                    <? echo $subject; ?>
                  </TD>
                  <TD></TD>
                </TR>
                <TR>
                  <TD></TD>
                  <TD>
                    <TABLE>
                      <TR>
                        <TD>
                          <?php echo $content; ?>
                        </TD>
                      </TR>
                    </TABLE>
                  </TD>
                  <TD></TD>
                </TR>
                <TR>
                  <TD></TD>
                  <TD></TD>
                  <TD></TD>
                </TR>
              </TABLE>
              <BR>

<?php

    } // close box function

    function footer() {

?>

            </TD>
            <TD VALIGN="top">

<?php

         global $PHP_SELF;

           theme_account($this);
           theme_blocks("right", $this);

?>

            </TD>
          </TR>
          <TR>
Dries's avatar
 
Dries committed
214 215 216 217
            <TD ALIGN="center" COLSPAN="3">
<?php
                   print theme_link(" | ");
?>
218 219 220 221 222 223 224 225 226 227
            </TD>
          </TR>
        </TABLE>
      </BODY>
   </HTML>
<?
    }
  }

?>