Commit a45fc1a2 authored by Dries's avatar Dries
Browse files

- themes now get there header/footer links through theme_link();
- tidied up example.theme
parent 8b6e7807
......@@ -12,6 +12,16 @@ function theme_init() {
return new Theme();
}
function theme_link($separator = " | ") {
$links = array("<A HREF=\"index.php\">". t("home") ."</A>",
"<A HREF=\"search.php\">". t("search") ."</A>",
"<A HREF=\"submit.php\">". t("submit") ."</A>",
"<A HREF=\"module.php?mod=diary\">". t("diary") ."</A>",
"<A HREF=\"account.php\">". t("account") ."</A>",
"<A HREF=\"module.php?mod=book\">". t("help") ."</A>");
return implode($separator, $links);
}
function theme_menu($name, $module) {
global $menu;
if ($module["menu"]) $menu = ($menu) ? array_merge($menu, $module["menu"]()) : $module["menu"]();
......
......@@ -17,9 +17,14 @@ function header() {
<TABLE BORDER="1">
<TR>
<TD>
</TD>
Logo? <!-- I left a TD to add a logo of some kind -->
<TD>
</TD>
<TD ALIGN="right" COLSPAN="2">
<?php
print theme_link(" | ");
?>
</TD>
</TR>
<TR>
......@@ -40,7 +45,7 @@ function header() {
function story($story, $reply = 0) {
?>
<TABLE BORDER="1">
<TABLE BORDER="1" WIDTH="100%">
<TR>
<TD COLSPAN="2">
<?php echo check_output($story->title); ?>
......@@ -106,59 +111,41 @@ function comment($comment, $link = "") {
echo "<A NAME=\"$comment->cid\"></A>\n";
// Create comment header:
echo " <TABLE>";
echo " <TABLE BORDER=\"1\" WIDTH=\"100%\">";
echo " <TR>";
echo " <TD>";
echo " <TABLE BORDER=\"1\">";
echo " <TR>";
echo " <TD>";
echo " <TABLE>";
echo " <TR>";
echo " <TD>";
echo " <TABLE BORDER=\"1\">";
// Subject:
echo " <TR>";
echo " <TD>";
echo " ". t("Subject") .":";
echo " </TD>";
echo " <TD >";
echo " ". check_output($comment->subject);
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:
echo " <TR>";
echo " <TD>". t("Author") .":</FONT></TD><TD>". format_username($comment->userid);
// Date:
echo " on ". format_date($comment->timestamp);
echo " </TD>";
echo " </TR>";
echo " </TABLE>";
echo " </TD>";
echo " </TR>";
// Print body of comment:
if ($comment) echo " <TR><TD>" . check_output($comment->comment, 1) ."</TD></TR>";
// Print bottom link(s):
echo " <TR><TD>$link</TD></TR>";
echo " </TABLE>";
echo " </TD>";
echo " </TR>";
echo " </TABLE>";
echo " <TD>";
echo comment_moderation($comment);
echo " </TD>";
echo " </TR>";
echo " </TABLE>";
echo " <BR>";
// 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 = "") {
......@@ -224,20 +211,11 @@ function footer() {
</TD>
</TR>
<TR>
<TD></TD>
<TD>
<TABLE BORDER="1">
<TR>
<TD></TD>
<TD>
<!-- These are just some links from my theme as an example. -->
<A HREF="index.php">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>
</TD>
<TD></TD>
</TR>
</TABLE>
<TD ALIGN="center" COLSPAN="3">
<?php
print theme_link(" | ");
?>
</TD>
<TD></TD>
</TR>
</TABLE>
</BODY>
......
......@@ -77,7 +77,7 @@ function linksbar() {
</tr>
<tr>
<td class="lgl"><img src="themes/goofy/images/null.gif" alt=""></td>
<td class="lgcnt" width="100%" valign="top"><div align="center"><big><a href="index.php">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></big></div></td>
<td class="lgcnt" width="100%" valign="top"><div align="center"><big><?php print theme_link(" | "); ?></big></div></td>
<td class="lgr"><img src="themes/goofy/images/null.gif" alt=""></td>
</tr>
<tr>
......
......@@ -46,12 +46,12 @@ function header() {
<tr>
<td align=\"left\" valign=\"top\">
<a href=\"index.php\">home</A><br />
<a href=\"module.php?mod=faq\">faq</A><br />
<a href=\"module.php?mod=book\">help</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=\"submit.php\">submit</A><br />
<a href=\"account.php\">account</A>
</td>
</tr>
......@@ -307,7 +307,7 @@ function footer() {
<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="index.php">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>
<FONT COLOR="#E09226" SIZE="2">[ <?php print theme_link(" | "); ?> ] </FONT>
</td>
<td align="right" width="20" background="themes/jeroen/images/footerright.gif" nowrap>&nbsp;</td>
</tr>
......
......@@ -26,7 +26,7 @@ function header() {
<TR>
<TD ALIGN="right" COLSPAN="2">
<?php
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") ."</A> | <A HREF=\"module.php?mod=wiki\">". t("wiki") ."</A> | <A HREF=\"account.php\">". t("user account") ."</A></SMALL>\n";
print "<SMALL>". theme_link(" | ") ."</SMALL>\n";
?>
</TD>
</TR>
......@@ -145,7 +145,7 @@ function footer() {
<TR>
<TD ALIGN="center" COLSPAN="3">
<?php
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";
print "<SMALL>[ ". theme_link(" | ") ." ]</SMALL><P>\n";
?>
</TD>
</TR>
......
......@@ -62,7 +62,7 @@ function header() {
</TR>
<TR>
<TD COLSPAN="2" ALIGN="CENTER">
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BGCOLOR="<?php echo $this->brcolor1; ?>"><TR><TD ALIGN="CENTER"><TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="4"><TR><TD ALIGN="CENTER" BGCOLOR="<?php echo $this->bgcolor2; ?>"><BIG><A HREF="index.php">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></BIG></TD></TR></TABLE></TD></TR></TABLE>
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BGCOLOR="<?php echo $this->brcolor1; ?>"><TR><TD ALIGN="CENTER"><TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="4"><TR><TD ALIGN="CENTER" BGCOLOR="<?php echo $this->bgcolor2; ?>"><BIG><?php print theme_link(" | "); ?></BIG></TD></TR></TABLE></TD></TR></TABLE>
</TD>
</TR>
<TR><TD COLSPAN="2"><?php
......@@ -215,7 +215,7 @@ function footer() {
?></TD></TR>
<TR>
<TD COLSPAN="2">
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BGCOLOR="<?php echo $this->brcolor1; ?>"><TR><TD ALIGN="CENTER"><TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="4"><TR><TD ALIGN="CENTER" BGCOLOR="<?php echo $this->bgcolor2; ?>"><BIG><A HREF="index.php">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></BIG></TD></TR></TABLE></TD></TR></TABLE>
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BGCOLOR="<?php echo $this->brcolor1; ?>"><TR><TD ALIGN="CENTER"><TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="4"><TR><TD ALIGN="CENTER" BGCOLOR="<?php echo $this->bgcolor2; ?>"><BIG><?php print theme_link(" | "); ?></BIG></TD></TR></TABLE></TD></TR></TABLE>
</TD>
</TR>
</TABLE>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment