Commit dcf8e14a authored by natrak's avatar natrak
Browse files

- modified node_save so that revisions are not validated using check_input,

  as this breaks revisions.
- modified link_node() to take a third parameter $main, which will be passed on
  to _link hooks. This lets modules decide which links a node will get when
  shown on the main page, or when not.
- updated themes to use the new syntax.
parent 7c7b7252
......@@ -194,9 +194,9 @@ function node_save($node, $filter) {
// prepare the query:
foreach ($node as $key => $value) {
if (in_array($key, $fields)) {
$q[] = check_query($key) ." = '". check_input($value) ."'";
$q[] = check_query($key) ." = '". ($key != "revisions" ? check_input($value) : $value) ."'";
// NOTE: for the values we use 'check_input()' such that we apply
// the filters
// the filters, except revisions
}
}
......
......@@ -117,8 +117,8 @@ function node($node, $main = 0) {
$body = check_output($node->body, 1);
}
if ($main) {
$body .= "<hr color=\"#404040\" size=\"1\"><div align=\"right\">[ " . $this->links(link_node($node)) . " ]</div>";
if ($links = link_node($node, $main)) {
$body .= "<hr color=\"#404040\" size=\"1\"><div align=\"right\">[ " . $this->links($links) . " ]</div>";
}
print "<script language=\"JavaScript\"><!--\ns(\"". $this->stripbreaks(addslashes($title)) ."\",\"". $this->stripbreaks(addslashes($subleft)) ."\",\"". $this->stripbreaks(addslashes($subright)) ."\",\"". $this->stripbreaks(addslashes($body)) ."\"); // -->\n</script>\n";
......
<?php
// $Id$
class Theme extends BaseTheme {
// General colorset that can be used for this theme
......@@ -55,7 +56,7 @@ function node($node, $main = 0) {
<div style="margin-left: 25px;"><?php echo check_output($node->body, 1); ?></div>
<div style="margin-left: 20px; padding-top: 5px; padding-bottom: 12px; color: #7c7c7c;">&gt;&gt;&gt;
<?php
$links = link_node($node);
$links = link_node($node, $main);
array_unshift($links, t("posted by") ." ". format_name($node));
echo $this->links($links);
?>
......@@ -67,6 +68,14 @@ function node($node, $main = 0) {
<div style="text-transform: capitalize; font-size: 120%; font-weight: bold;"><?php echo check_output($node->title); ?></div>
<div style="padding-left: 20px; padding-top: 10px; padding-bottom: 10px;"><?php echo sprintf(t("by %s on %s"), format_name($node), format_date($node->created)); ?></div>
<div style="margin-left: 10px;"><?php echo check_output($node->body, 1); ?></div>
<div style="margin-left: 20px; padding-top: 5px; padding-bottom: 12px; color: #7c7c7c;">&gt;&gt;&gt;
<?php
if ($links = link_node($node, $main)) {
//array_unshift($links, t("posted by") ." ". format_name($node));
echo $this->links($links);
}
?>
</div>
<?php
}
}
......
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