193 lines
4.4 KiB
Plaintext
193 lines
4.4 KiB
Plaintext
<?php
|
|
|
|
/*********************************************************************
|
|
|
|
Theme: Example
|
|
Author: Jeroen Bensch (Jeroen)
|
|
Email: jeroen@drop.org
|
|
Description: Very basic theme for demonstration purposes.
|
|
|
|
*********************************************************************/
|
|
|
|
class Theme {
|
|
|
|
function header() {
|
|
?>
|
|
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE><? echo variable_get(site_name, "drupal"); ?></TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<TABLE BORDER="0">
|
|
<TR>
|
|
<TD>
|
|
<BIG><A HREF="index.php"><?php print variable_get(site_name, "drupal"); ?></A></BIG>
|
|
</TD>
|
|
<TD ALIGN="right" COLSPAN="2">
|
|
|
|
<?php
|
|
print theme_link(" | ");
|
|
?>
|
|
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD VALIGN="top">
|
|
|
|
<?php
|
|
theme_blocks("left", $this);
|
|
|
|
?>
|
|
|
|
</TD>
|
|
<TD VALIGN="top">
|
|
|
|
<?php
|
|
|
|
} // close header function
|
|
|
|
function story($story, $main = 0) {
|
|
?>
|
|
|
|
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="3" WIDTH="100%">
|
|
<TR>
|
|
<TD COLSPAN="2">
|
|
<BIG><?php echo check_output($story->title); ?></BIG>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>
|
|
|
|
<?php
|
|
echo strtr(t("by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp, "small")));
|
|
?>
|
|
|
|
</TD>
|
|
<TD ALIGN="right">
|
|
<?php
|
|
echo category_name($story->cid) ." / ". topic_name($story->tid);
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD COLSPAN="2">
|
|
<?php
|
|
echo "<P>". check_output($story->abstract, 1) ."</P>";
|
|
if (!$main && $story->body)
|
|
echo "<P>". check_output($story->body, 1) ."</P>";
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD COLSPAN="2">
|
|
<?php
|
|
if ($main)
|
|
echo theme_morelink($this, $story);
|
|
?>
|
|
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
<BR>
|
|
|
|
<?php
|
|
|
|
} // close story function
|
|
|
|
function comment($comment, $link = "") {
|
|
echo "<A NAME=\"$comment->cid\"></A>\n";
|
|
|
|
// Create comment header:
|
|
echo "<TABLE BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"3\" WIDTH=\"100%\">";
|
|
echo " <TR>";
|
|
echo " <TD>";
|
|
echo t("Subject") .":";
|
|
echo " </TD>";
|
|
echo " <TD>";
|
|
echo " ". check_output($comment->subject);
|
|
echo " </TD>";
|
|
|
|
// Moderation:
|
|
echo " <TD>";
|
|
echo comment_moderation($comment);
|
|
echo " </TD>";
|
|
echo " </TR>";
|
|
|
|
// Author and date:
|
|
echo " <TR>";
|
|
echo " <TD>";
|
|
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>";
|
|
} // close comment function
|
|
|
|
function box($subject, $content, $options = "") {
|
|
|
|
?>
|
|
|
|
<TABLE>
|
|
<TR>
|
|
<TD>
|
|
<DIV ALIGN="center"><BIG><? echo $subject; ?></BIG></DIV><HR>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>
|
|
<?php echo $content; ?>
|
|
</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>
|
|
<TD ALIGN="center" COLSPAN="3">
|
|
<P><?php print theme_link(" | "); ?></P>
|
|
<P><SMALL><?php print variable_get(site_footer, ""); ?></SMALL></P>
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</BODY>
|
|
</HTML>
|
|
<?
|
|
}
|
|
}
|
|
|
|
?>
|