Commit 540fdfc0 authored by Dries's avatar Dries

- Replaced $theme->story() by a more generic $theme->node().  All themes
  required an update (and so will your custom themes).
parent b0288a46
......@@ -25,39 +25,44 @@ function book_location($node, $nodes = array()) {
function book_view($node, $main = 0) {
global $status, $theme;
if ($node->nid && $node->parent) {
$list = book_parent_query($node->parent);
$next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight > '$node->weight' ORDER BY b.weight ASC"));
$prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight < '$node->weight' ORDER BY b.weight DESC"));
if ($main) {
$theme->node($node, $main);
}
else {
if ($node->nid && $node->parent) {
$list = book_parent_query($node->parent);
$next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight > '$node->weight' ORDER BY b.weight ASC"));
$prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight < '$node->weight' ORDER BY b.weight DESC"));
}
$output .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\n";
$output .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\n";
if ($node->title) {
foreach (book_location($node) as $level) {
$location .= "$indent <A HREF=\"node.php?id=$level->nid\">$level->title</A><BR>";
$indent .= "-";
}
if ($node->title) {
foreach (book_location($node) as $level) {
$location .= "$indent <A HREF=\"node.php?id=$level->nid\">$level->title</A><BR>";
$indent .= "-";
}
$output .= " <TR><TD COLSPAN=\"2\">$location</TD><TD ALIGN=\"right\">". node_control($node) ."</TD></TR>\n";
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD COLSPAN=\"3\"><B><BIG>". check_output($node->title) ."</BIG></B>". ($node->body ? "<BR><SMALL><I>Last updated by ". format_username($node->userid) ." on ". format_date($node->timestamp) ."</I></SMALL> " : "") ."</TD></TR>\n";
}
$output .= " <TR><TD COLSPAN=\"2\">$location</TD><TD ALIGN=\"right\">". node_control($node) ."</TD></TR>\n";
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD COLSPAN=\"3\"><B><BIG>". check_output($node->title) ."</BIG></B>". ($node->body ? "<BR><SMALL><I>Last updated by ". format_username($node->userid) ." on ". format_date($node->timestamp) ."</I></SMALL> " : "") ."</TD></TR>\n";
}
if ($node->body) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". check_output($node->body, 1) ."</TD></TR>";
}
if ($node->body) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". check_output($node->body, 1) ."</TD></TR>";
}
if ($node->nid) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". book_tree($node->nid) ."</TD></TR>";
}
if ($node->nid) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". book_tree($node->nid) ."</TD></TR>";
}
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<A HREF=\"node.php?id=$prev->nid\">". t("previous") ."</A>" : t("previous")) ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\"><A HREF=\"module.php?mod=book\">index</A></TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<A HREF=\"node.php?id=$next->nid\">". t("next") ."</A>" : t("next")) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<SMALL>". check_output($prev->title) ."</SMALL>" : "&nbsp;") ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\">". ($node->parent ? "<A HREF=\"node.php?id=$node->parent\">". t("up") ."</A>" : t("up")) ."</TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<SMALL>". check_output($next->title) ."</SMALL>" : "&nbsp;") ."</TD></TR>\n";
$output .= "</TABLE>\n";
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<A HREF=\"node.php?id=$prev->nid\">". t("previous") ."</A>" : t("previous")) ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\"><A HREF=\"module.php?mod=book\">index</A></TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<A HREF=\"node.php?id=$next->nid\">". t("next") ."</A>" : t("next")) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<SMALL>". check_output($prev->title) ."</SMALL>" : "&nbsp;") ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\">". ($node->parent ? "<A HREF=\"node.php?id=$node->parent\">". t("up") ."</A>" : t("up")) ."</TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<SMALL>". check_output($next->title) ."</SMALL>" : "&nbsp;") ."</TD></TR>\n";
$output .= "</TABLE>\n";
$theme->box(t("Handbook"), $output);
$theme->box(t("Handbook"), $output);
}
}
function book_search($keys) {
......
......@@ -25,39 +25,44 @@ function book_location($node, $nodes = array()) {
function book_view($node, $main = 0) {
global $status, $theme;
if ($node->nid && $node->parent) {
$list = book_parent_query($node->parent);
$next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight > '$node->weight' ORDER BY b.weight ASC"));
$prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight < '$node->weight' ORDER BY b.weight DESC"));
if ($main) {
$theme->node($node, $main);
}
else {
if ($node->nid && $node->parent) {
$list = book_parent_query($node->parent);
$next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight > '$node->weight' ORDER BY b.weight ASC"));
$prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight < '$node->weight' ORDER BY b.weight DESC"));
}
$output .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\n";
$output .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\n";
if ($node->title) {
foreach (book_location($node) as $level) {
$location .= "$indent <A HREF=\"node.php?id=$level->nid\">$level->title</A><BR>";
$indent .= "-";
}
if ($node->title) {
foreach (book_location($node) as $level) {
$location .= "$indent <A HREF=\"node.php?id=$level->nid\">$level->title</A><BR>";
$indent .= "-";
}
$output .= " <TR><TD COLSPAN=\"2\">$location</TD><TD ALIGN=\"right\">". node_control($node) ."</TD></TR>\n";
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD COLSPAN=\"3\"><B><BIG>". check_output($node->title) ."</BIG></B>". ($node->body ? "<BR><SMALL><I>Last updated by ". format_username($node->userid) ." on ". format_date($node->timestamp) ."</I></SMALL> " : "") ."</TD></TR>\n";
}
$output .= " <TR><TD COLSPAN=\"2\">$location</TD><TD ALIGN=\"right\">". node_control($node) ."</TD></TR>\n";
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD COLSPAN=\"3\"><B><BIG>". check_output($node->title) ."</BIG></B>". ($node->body ? "<BR><SMALL><I>Last updated by ". format_username($node->userid) ." on ". format_date($node->timestamp) ."</I></SMALL> " : "") ."</TD></TR>\n";
}
if ($node->body) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". check_output($node->body, 1) ."</TD></TR>";
}
if ($node->body) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". check_output($node->body, 1) ."</TD></TR>";
}
if ($node->nid) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". book_tree($node->nid) ."</TD></TR>";
}
if ($node->nid) {
$output .= " <TR><TD COLSPAN=\"3\"><BR>". book_tree($node->nid) ."</TD></TR>";
}
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<A HREF=\"node.php?id=$prev->nid\">". t("previous") ."</A>" : t("previous")) ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\"><A HREF=\"module.php?mod=book\">index</A></TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<A HREF=\"node.php?id=$next->nid\">". t("next") ."</A>" : t("next")) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<SMALL>". check_output($prev->title) ."</SMALL>" : "&nbsp;") ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\">". ($node->parent ? "<A HREF=\"node.php?id=$node->parent\">". t("up") ."</A>" : t("up")) ."</TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<SMALL>". check_output($next->title) ."</SMALL>" : "&nbsp;") ."</TD></TR>\n";
$output .= "</TABLE>\n";
$output .= " <TR><TD COLSPAN=\"3\"><HR></TD></TR>";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<A HREF=\"node.php?id=$prev->nid\">". t("previous") ."</A>" : t("previous")) ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\"><A HREF=\"module.php?mod=book\">index</A></TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<A HREF=\"node.php?id=$next->nid\">". t("next") ."</A>" : t("next")) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"left\" WIDTH=\"33%\">". ($prev ? "<SMALL>". check_output($prev->title) ."</SMALL>" : "&nbsp;") ."</TD><TD ALIGN=\"center\" WIDTH=\"34%\">". ($node->parent ? "<A HREF=\"node.php?id=$node->parent\">". t("up") ."</A>" : t("up")) ."</TD><TD ALIGN=\"right\" WIDTH=\"33%\">". ($next ? "<SMALL>". check_output($next->title) ."</SMALL>" : "&nbsp;") ."</TD></TR>\n";
$output .= "</TABLE>\n";
$theme->box(t("Handbook"), $output);
$theme->box(t("Handbook"), $output);
}
}
function book_search($keys) {
......
......@@ -113,7 +113,6 @@ function poll_view($node, $main = 0, $block = 0) {
$node->totalvotes = max(1, $node->totalvotes);
if (!$block) $output .= "<small>Posted by " . format_username($node->userid) . " on " . format_date($node->timestamp, "large") . "</small><br>\r\n";
foreach ($node->choice as $key => $value) {
if ($value) {
if ($main) {
......@@ -135,7 +134,6 @@ function poll_view($node, $main = 0, $block = 0) {
$node->totalvotes = max(1, $node->totalvotes);
if (!$block) $output .= "<small>Posted by " . format_username($node->userid) . " on " . format_date($node->timestamp, "large") . "</small><br><br>\r\n";
$output .= "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"left\">";
foreach ($node->choice as $key => $value) {
if ($value) {
......@@ -147,7 +145,11 @@ function poll_view($node, $main = 0, $block = 0) {
$output = form($REQUEST_URI, $output);
}
if (!$block) $theme->box($title, $output);
if (!$block) {
$node->body = $output;
$theme->node($node, 1);
}
return array("title" => $title, "content" => $output);
}
......
......@@ -113,7 +113,6 @@ function poll_view($node, $main = 0, $block = 0) {
$node->totalvotes = max(1, $node->totalvotes);
if (!$block) $output .= "<small>Posted by " . format_username($node->userid) . " on " . format_date($node->timestamp, "large") . "</small><br>\r\n";
foreach ($node->choice as $key => $value) {
if ($value) {
if ($main) {
......@@ -135,7 +134,6 @@ function poll_view($node, $main = 0, $block = 0) {
$node->totalvotes = max(1, $node->totalvotes);
if (!$block) $output .= "<small>Posted by " . format_username($node->userid) . " on " . format_date($node->timestamp, "large") . "</small><br><br>\r\n";
$output .= "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"left\">";
foreach ($node->choice as $key => $value) {
if ($value) {
......@@ -147,7 +145,11 @@ function poll_view($node, $main = 0, $block = 0) {
$output = form($REQUEST_URI, $output);
}
if (!$block) $theme->box($title, $output);
if (!$block) {
$node->body = $output;
$theme->node($node, 1);
}
return array("title" => $title, "content" => $output);
}
......
......@@ -31,7 +31,8 @@ function story_help() {
function story_view($node, $main = 0) {
global $theme;
$theme->story($node, $main);
$node->body = ($main ? $node->abstract : "$node->abstract<HR>$node->body");
$theme->node($node, $main);
}
function story_form($edit = array()) {
......
......@@ -31,7 +31,8 @@ function story_help() {
function story_view($node, $main = 0) {
global $theme;
$theme->story($node, $main);
$node->body = ($main ? $node->abstract : "$node->abstract<HR>$node->body");
$theme->node($node, $main);
}
function story_form($edit = array()) {
......
......@@ -47,35 +47,33 @@ function header() {
} // close header function
function story($story, $main = 0) {
function node($node, $main = 0) {
?>
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="3" WIDTH="100%">
<TR>
<TD COLSPAN="2">
<BIG><?php echo check_output($story->title); ?></BIG>
<BIG><?php echo check_output($node->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")));
echo strtr(t("by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp, "small")));
?>
</TD>
<TD ALIGN="right">
<?php
echo category_name($story->cid) ." / ". topic_name($story->tid);
echo category_name($node->cid) ." / ". topic_name($node->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>";
echo "<P>". check_output($node->body, 1) ."</P>";
?>
</TD>
</TR>
......@@ -83,7 +81,7 @@ function story($story, $main = 0) {
<TD COLSPAN="2">
<?php
if ($main)
echo theme_morelink($this, $story);
echo theme_morelink($this, $node);
?>
</TD>
......@@ -93,7 +91,7 @@ function story($story, $main = 0) {
<?php
} // close story function
} // close node function
function comment($comment, $link = "") {
echo "<A NAME=\"$comment->cid\"></A>\n";
......
......@@ -95,14 +95,14 @@ function linksbar() { // helper function to prevent double code
} // close linksbar function
function story($story, $main = 0) {
echo "\n<!-- story: \"$story->title\" -->\n";
$title = check_output($story->title);
$subleft = strtr(t("Submitted by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp, "large")));
$subright = category_name($story->cid) ." / ". topic_name($story->tid);
$body = check_output($story->abstract, 1) . "<br>" . ((!$main && $story->body)?"<br>" . check_output($story->body, 1):"") . "<hr color=\"#404040\" size=\"1\"><div align=\"right\">" . ($main?theme_morelink($this, $story):"");
function node($node, $main = 0) {
echo "\n<!-- node: \"$node->title\" -->\n";
$title = check_output($node->title);
$subleft = strtr(t("Submitted by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp, "large")));
$subright = category_name($node->cid) ." / ". topic_name($node->tid);
$body = check_output($node->body, 1) . "<hr color=\"#404040\" size=\"1\"><div align=\"right\">" . ($main?theme_morelink($this, $node):"");
print "<script language=\"JavaScript\"><!--\ns(\"". $this->stripbreaks(addslashes($title)) ."\",\"". $this->stripbreaks(addslashes($subleft)) ."\",\"". $this->stripbreaks(addslashes($subright)) ."\",\"". $this->stripbreaks(addslashes($body)) ."\"); // -->\n</script>\n";
} // close story function
} // close node function
......
......@@ -81,7 +81,7 @@ function header() {
} // close header function
function story($story, $main = 0) {
function node($node, $main = 0) {
?>
......@@ -89,7 +89,7 @@ function story($story, $main = 0) {
<tr>
<td align="left" valign="bottom" width="20" height="20" background="themes/jeroen/images/<?php echo (rand(0, 1) ? "news1.gif" : "news3.gif"); ?>" nowrap>&nbsp;</td>
<td align="center" valign="top" width="100%" background="themes/jeroen/images/newsmiddle.gif" nowrap>
<B><?php echo "". check_output($story->title) .""; ?></B>
<B><?php echo "". check_output($node->title) .""; ?></B>
</td>
<td align="right" valign="bottom" width="20" background="themes/jeroen/images/<?php echo (rand(0, 1) == 0) ? "news2.gif" : "news4.gif"; if (rand(0,100) == 50) "news5.gif"; ?>" nowrap>&nbsp;</td>
</tr>
......@@ -114,12 +114,12 @@ function story($story, $main = 0) {
case 12: $how = "Forged"; break;
default: $how = "Sneaked through";
}
echo "<FONT SIZE=\"-1\">". strtr(t("$how by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp), "large")) ."</FONT>";
echo "<FONT SIZE=\"-1\">". strtr(t("$how by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp), "large")) ."</FONT>";
?>
</FONT>
</td>
<?php
echo "<td align=\"right\" background=\"themes/jeroen/images/menutitle.gif\" nowrap><b>". category_name($story->cid) ." / ". topic_name($story->tid) ."</b>";
echo "<td align=\"right\" background=\"themes/jeroen/images/menutitle.gif\" nowrap><b>". category_name($node->cid) ." / ". topic_name($node->tid) ."</b>";
?>
</td>
</tr>
......@@ -127,11 +127,7 @@ function story($story, $main = 0) {
<td colspan="2" valign="top" width="100%">
<?php
echo "<br />". check_output($story->abstract, 1) ."<br />";
if (!$main && $story->body)
echo "<br />". check_output($story->body, 1) ."<br />";
echo "<br />". check_output($node->body, 1) ."<br />";
?>
</td>
......@@ -140,7 +136,7 @@ function story($story, $main = 0) {
<td colspan="2" align="right">
<?php
if ($main)
echo "<FONT COLOR=\"#E09226\">". theme_morelink($this, $story) ."</FONT>";
echo "<FONT COLOR=\"#E09226\">". theme_morelink($this, $node) ."</FONT>";
?>
......@@ -157,7 +153,7 @@ function story($story, $main = 0) {
<?php
} // close story function
} // close node function
function comment($comment, $link = "") {
echo "<A NAME=\"$comment->cid\"></a>\n";
......
......@@ -67,6 +67,26 @@ function story($story, $main = 0) {
print "<BR><BR>\n\n";
}
function node($node, $main = 0) {
print "\n<!-- node: \"$node->title\" -->\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>". check_output($node->title) ."</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>". strtr(t("Submitted by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp, "large"))); ?><?php print "</SMALL></FONT></TD><TD ALIGN=\"right\" VALIGN=\"top\" NOWRAP><SMALL>". category_name($node->cid) ." / ". topic_name($node->tid) ."</SMALL>\n";
print " </TD>\n";
print " </TR>\n";
print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
print " <TR>\n";
print " <TD COLSPAN=\"2\"><P>". check_output($node->body, 1) ."</P></TD>\n";
print " </TR>\n";
print " <TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
if ($main) print " <TR><TD COLSPAN=\"2\">". theme_morelink($this, $node) ."</TD></TR>\n";
print "</TABLE>\n";
print "<BR><BR>\n\n";
}
function comment($comment, $link = "") {
print "<A NAME=\"$comment->cid\">\n";
......
......@@ -78,31 +78,30 @@ function header() {
<?php
}
function story($story, $main = 0) {
function node($node, $main = 0) {
print "\n<!-- story: \"$story->title\" -->\n";
print "\n<!-- node: \"$node->title\" -->\n";
?>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="<?php echo $this->brcolor1; ?>" WIDTH="100%">
<TR><TD>
<TABLE BORDER="0" CELLPADDING="4" CELLSPACING="1" WIDTH="100%">
<TR><TD COLSPAN="2" BGCOLOR="<?php echo $this->bgcolor1; ?>" WIDTH="100%"><table width="100%" cellpadding="0" cellspacing="0"><tr><td width="100%"><FONT COLOR="<?php echo $this->fgcolor1; ?>"><B><?php echo "". check_output($story->title) .""; ?></B></FONT></td><td valign="middle" align="center"><IMG SRC="themes/<?php print $this->themename; ?>/images/icon.gif" valign="middle"></td></tr></table></TD></TR>
<TR><TD COLSPAN="2" BGCOLOR="<?php echo $this->bgcolor1; ?>" WIDTH="100%"><table width="100%" cellpadding="0" cellspacing="0"><tr><td width="100%"><FONT COLOR="<?php echo $this->fgcolor1; ?>"><B><?php echo "". check_output($node->title) .""; ?></B></FONT></td><td valign="middle" align="center"><IMG SRC="themes/<?php print $this->themename; ?>/images/icon.gif" valign="middle"></td></tr></table></TD></TR>
<TR BGCOLOR="<?php echo $this->bgcolor2; ?>">
<?php
print "<TD WIDTH=\"70%\" BGCOLOR=\"$this->bgcolor2\"><SMALL>" . strtr(t("Submitted by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp, "large"))) . "</TD><TD WIDTH=\"30%\" BGCOLOR=\"$this->bgcolor2\" ALIGN=\"center\" NOWRAP><B>". category_name($story->cid) ." / ". topic_name($story->tid) ."</B>";
print "<TD WIDTH=\"70%\" BGCOLOR=\"$this->bgcolor2\"><SMALL>" . strtr(t("Submitted by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp, "large"))) . "</TD><TD WIDTH=\"30%\" BGCOLOR=\"$this->bgcolor2\" ALIGN=\"center\" NOWRAP><B>". category_name($node->cid) ." / ". topic_name($node->tid) ."</B>";
?>
</TD>
</TR>
<TR BGCOLOR="<?php echo $this->bgcolor2; ?>">
<TD BGCOLOR="<?php echo $this->bgcolor2 ?>" COLSPAN="2">
<?php
echo "<P>". check_output($story->abstract, 1) ."</P>";
if (!$main && $story->body) print "<P>". check_output($story->body, 1) ."</P>\n";
echo "<P>". check_output($node->body, 1) ."</P>";
?>
</TD>
</TR>
<?php
if ($main)
echo "<TR BGCOLOR=\"". $this->bgcolor3 ."\"><TD BGCOLOR=\"". $this->bgcolor3 ."\" ALIGN=\"right\" COLSPAN=\"2\">". theme_morelink($this, $story) ."</TD></TR>";
echo "<TR BGCOLOR=\"". $this->bgcolor3 ."\"><TD BGCOLOR=\"". $this->bgcolor3 ."\" ALIGN=\"right\" COLSPAN=\"2\">". theme_morelink($this, $node) ."</TD></TR>";
?>
</TABLE></TD></TR></TABLE><BR>
<?php
......
......@@ -109,9 +109,9 @@ function do_nav() {
} // close header function
function story($story, $main = 0) {
function node($node, $main = 0) {
switch ($story->tid) {
switch ($node->tid) {
case 0: $color = "#c4a2a2"; $img = "square2.gif"; break;
case 1: $color = "#a2c4a7"; $img = "square3.gif"; break;
case 2: $color = "#c2c4a2"; $img = "square4.gif"; break;
......@@ -127,8 +127,8 @@ function story($story, $main = 0) {
<table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr>
<td>
<a href="index.php?topic=<?php echo $story->tid; ?>"><img src="themes/yaroon/images/<?php echo $img; ?>" border="0" /></a>&nbsp;<b style="font-size: 12pt"><?php echo check_output($story->title); ?></b>
<?php echo strtr(t("by %a on %b"), array("%a" => format_username($story->userid), "%b" => format_date($story->timestamp), "small")); ?>
<a href="index.php?topic=<?php echo $node->tid; ?>"><img src="themes/yaroon/images/<?php echo $img; ?>" border="0" /></a>&nbsp;<b style="font-size: 12pt"><?php echo check_output($node->title); ?></b>
<?php echo strtr(t("by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp), "small")); ?>
</td>
</tr>
<tr><td bgcolor="<?php echo $color; ?>"><img src="themes/yaroon/images/pixel.gif" width="1" height="1" alt="" border="0" /></td></tr>
......@@ -136,17 +136,14 @@ function story($story, $main = 0) {
<td>
<?php
echo "<br />". check_output($story->abstract, 1) ."<br />";
if (!$main && $story->body)
echo "<br />". check_output($story->body, 1) ."<br />";
echo "<br />". check_output($node->body, 1) ."<br />";
echo" </td>
</tr>
<tr>
<td align=\"right\">
<font color=\"". $color ."\">";
if ($main)
echo "". theme_morelink($this, $story) ."";
echo "". theme_morelink($this, $node) ."";
echo"</font>";
?>
......@@ -157,7 +154,7 @@ function story($story, $main = 0) {
</table>
<?php
} // close story function
} // close node function
function comment($comment, $link = "") {
echo "<a name=\"$comment->cid\"></a>\n";
......
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