diff options
-rw-r--r-- | includes/common.inc | 16 | ||||
-rw-r--r-- | includes/module.inc | 4 | ||||
-rw-r--r-- | includes/theme.inc | 4 | ||||
-rw-r--r-- | modules/blog.module | 135 | ||||
-rw-r--r-- | modules/blog/blog.module | 135 | ||||
-rw-r--r-- | modules/node.module | 7 | ||||
-rw-r--r-- | modules/node/node.module | 7 | ||||
-rw-r--r-- | themes/marvin/marvin.theme | 6 |
8 files changed, 133 insertions, 181 deletions
diff --git a/includes/common.inc b/includes/common.inc index 8eca80048..aeb04a8ee 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -76,7 +76,9 @@ function check_query($text) { } function check_input($text) { - foreach (module_list() as $module) $text = module_invoke($module, "filter", $text); + foreach (module_list() as $name) { + if (module_hook($name, "filter")) $text = module_invoke($name, "filter", $text); + } return addslashes(stripslashes(substr($text, 0, variable_get("max_input_size", 10000)))); } @@ -84,6 +86,10 @@ function check_output($text, $nl2br = 0) { return ($text) ? ($nl2br ? nl2br(stripslashes($text)) : stripslashes($text)) : message_na(); } +function format_info($body, $block) { + return "<table><tr><td><table align=\"right\" border=\"1\" width=\"180\"><tr><td>$block</td></tr></table>$body</td></tr></table>\n"; +} + function format_plural($count, $singular, $plural) { return ($count == 1) ? "$count ". t($singular) : "$count ". t($plural); } @@ -252,7 +258,13 @@ function link_page() { } function link_node($node) { - return module_invoke("node", "link", array("node", $node)); + foreach (module_list() as $name) { + if (module_hook($name, "link")) { + $links = array_merge($links, module_invoke($name, "link", "node", $node)); + } + } + + return $links ? $links : array(); } function timer_start() { diff --git a/includes/module.inc b/includes/module.inc index bca406068..475fe8370 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -11,9 +11,9 @@ function module_iterate($function, $argument = "") { } // invoke hook $hook of module $name with optional arguments: -function module_invoke($name, $hook, $argument = 0) { +function module_invoke($name, $hook, $a1 = 0, $a2 = 0) { $function = $name ."_". $hook; - return function_exists($function) ? $function($argument) : $argument; + return function_exists($function) ? $function($a1, $a2) : 0; } // return array of module names (includes lazy module loading): diff --git a/includes/theme.inc b/includes/theme.inc index e78f313c1..580de21b6 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -4,6 +4,10 @@ class BaseTheme { function links($links, $delimiter = " | ") { return implode($delimiter, $links); } + + function images($name) { + return $name; + } } function theme_init() { diff --git a/modules/blog.module b/modules/blog.module index 5106da1f2..60fd9bb5d 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -22,86 +22,60 @@ function blog_perm() { return array("administer blogs", "access blogs", "post blogs"); } -function blog_page_all($num = 20) { - global $theme, $user; - - $result = db_query("SELECT n.timestamp, n.title, u.userid, n.nid, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id ORDER BY b.lid DESC LIMIT $num"); - - while ($blog = db_fetch_object($result)) { - $output .= blog_format_link($blog) ." "; - $output .= "<a href=\"module.php?mod=blog&name=". urlencode($blog->userid) ."\"><img src=\"misc/earth.gif\" border= \"0\" width=\"11\" height=\"11\" alt=\"". t("This blog") ."\" /></a> "; - $output .= format_username($blog->userid) .", ". format_date($blog->timestamp, "small") .":<br />"; - $output .= "<blockquote><b>". check_input($blog->title) ."</b><br />" . check_output($blog->body, 1) ."</blockquote>\n"; - } - - $theme->header(); - $theme->box(t("Latest blogs"), $output); - $theme->footer(); +function blog_status() { + return array(dumped, posted); } -function blog_page_user($userid = 0, $date = 0) { +function blog_page_user($name = 0, $date = 0) { global $theme, $user; - $userid = $userid ? $userid : $user->userid; + $name = check_input($name ? $name : $user->userid); + $date = check_input($date ? $date : time()); - $theme->header(); - - if ($date) { - - /* - ** Displays today's blogs for this user: - */ - - blog_page_day($userid, $date); - } - else { - - /* - ** Display the last blogs for this user: - */ + $result = db_query("SELECT n.nid, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id WHERE u.userid = '$name' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 30"); - $result = db_query("SELECT n.nid, n.timestamp FROM node n LEFT JOIN users u ON u.id = n.author WHERE n.type = 'blog' AND u.userid = '". check_input($userid) ."' AND n.timestamp > ". (time() - 2592000) ." ORDER BY n.timestamp DESC LIMIT 20"); - while ($blog = db_fetch_object($result)) { - if ($date != date("ndy", $blog->timestamp)) { - $date = date("ndy", $blog->timestamp); - blog_page_day($userid, $blog->timestamp); + $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; + while ($blog = db_fetch_object($result)) { + if ($date != date("dny", $blog->timestamp)) { + $date = date("dny", $blog->timestamp); + if ($user->id && $user->userid == $name) { + $links = array("<a href=\"submit.php?mod=blog&op=edit&id=$blog->nid\">". t("edit") ."</a>"); + $output .= "<tr><td><b>". format_date($blog->timestamp, custom, "d M Y") .":</b></td><td align=\"right\">". $theme->links($links) ."</td></tr>"; + } + else { + $output .= "<tr><td colspan=\"2\"><b>". format_date($blog->timestamp, custom, "d M Y") .":</b></td></tr>"; } } + $output .= "<tr><td colspan=\"2\" style=\"margin-left: 20px;\">". check_output($blog->body, 1) ."</td></tr>"; } + $output .= "</table>"; + + $theme->header(); + $theme->box(strtr(t("%a's blog"), array("%a" => $name)), $output, "main"); $theme->footer(); } - -function blog_page_day($userid = 0, $date = 0) { +function blog_page_view($num = 20) { global $theme, $user; - $header .= "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"; - $header .= " <tr>\n"; - $header .= " <td><b><a href=\"module.php?mod=blog&op=view&name=". urlencode($userid) ."\">". check_output($userid) ."'s ". t("blog") ."</a></b></td>\n"; - $header .= " <td align=\"right\"><b><a href=\"module.php?mod=blog&op=view&name=". urlencode($userid) ."&date=$date\">". format_date($date, custom, "d-M-Y") ."</a></b></td>\n"; - $header .= " </tr>\n"; - $header .= "</table>\n"; - - $sdate = mktime(0, 0, 0, date("m", $date), date("d", $date), date("Y", $date)); - $edate = mktime(23, 59, 59, date("m", $date), date("d", $date), date("Y", $date)); - - $result = db_query("SELECT b.body, n.timestamp, n.nid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id WHERE u.userid = '". check_input($userid) ."' AND n.timestamp > '$sdate' AND n.timestamp < '$edate' ORDER BY b.lid DESC LIMIT 50"); + $result = db_query("SELECT n.timestamp, n.title, u.userid, n.nid, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id ORDER BY b.lid DESC LIMIT $num"); + $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; while ($blog = db_fetch_object($result)) { - if (!$first) $first = $blog->nid; - $output .= "<p>". blog_format_link($blog) . check_output($blog->body, 1) ."</p>\n"; - } + $links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($blog->userid) ."\">". strtr(t("%a's blog"), array("%a" => $blog->userid)) ."</a>"; + $links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog") ."</a>"; + $links[] = "<a href=\"node.php?id=$blog->nid\">". t("discuss") ."</a>"; - if ($user->id && $user->userid == $userid) { - $output .= "<p>[ <a href=\"submit.php?mod=blog&op=edit&id=$first\">". t("edit") ."</a> ]</p>"; + $output .= "<tr><td><b>$blog->title</b></td><td align=\"right\">". $theme->links($links) ."</td></tr>"; + $output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px; margin-bottom: 2px;\">$blog->body</div></td></tr>"; + unset($links); } + $output .= "</table>"; - $theme->box($header, $output); -} - -function blog_status() { - return array(dumped, posted); + $theme->header(); + $theme->box(t("User blogs"), $output, "main"); + $theme->footer(); } function blog_remove($nid) { @@ -124,20 +98,9 @@ function blog_format_link($blog) { } function blog_view($node, $main = 0) { - global $status, $theme; - - $userid = urlencode($node->userid); + global $theme; - $header .= "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">"; - $header .= " <tr>"; - $header .= " <td><b><a href=\"module.php?mod=blog&op=view&name=$userid\">". $node->userid ."'s ". t("blog") ."</a></b></td>"; - $header .= " <td align=\"right\"><b><a href=\"module.php?mod=blog&op=view&name=$userid&date=$node->timestamp\">". format_date($node->timestamp, custom, "d-M-Y") ."</a></b></td>"; - $header .= " </tr>"; - $header .= "</table>"; - - $output .= check_output($node->body, 1) ."<p>[ ". implode(" | ", link_node($node)) ." ]</p>"; - - $theme->box($header, $output); + $theme->node($node, $main); } function blog_form($edit = array()) { @@ -151,12 +114,12 @@ function blog_form($edit = array()) { else if ($type == "blog") { $item = node_get_object(array(type => "blog", nid => $id)); $edit["title"] = $item->title; - $edit["body"] = $item->body ." [<a href=\"module.php?mod=blog&name=". urlencode($item->userid) ."&date=$item->timestamp\">$item->userid</a>]"; + $edit["body"] = "<i>". $item->body ."</i> [<a href=\"module.php?mod=blog&name=". urlencode($item->userid) ."&date=$item->timestamp\">$item->userid</a>]"; } else if ($type == "import") { $item = db_fetch_object(db_query("SELECT i.*, f.title as ftitle, f.link as flink FROM item i, feed f WHERE i.iid = '". check_input($id) ."' AND i.fid = f.fid")); $edit["title"] = $item->title; - $edit["body"] = "<a href=\"$item->link\">$item->title</a> - ". check_output($item->description) ." [<a href=\"$item->flink\">$item->ftitle</a>]\n"; + $edit["body"] = "<a href=\"$item->link\">$item->title</a> - <i>". check_output($item->description) ."</i> [<a href=\"$item->flink\">$item->ftitle</a>]\n"; } if ($edit["title"]) { @@ -237,7 +200,7 @@ function blog_page() { blog_page_user($name, $date); } else { - blog_page_all(); + blog_page_view(); } } else { @@ -252,31 +215,31 @@ function blog_user() { switch ($op) { case "delete": blog_remove($id); - blog_page_day($user->userid, time()); + blog_page_user($user->userid, time()); break; case "edit": - $theme->box(t("Submit a blog"), blog_form(node_get_array(array("nid" => $id, "type" => "blog")))); - $theme->box(t("Older blogs"), blog_edit_history($id)); + $theme->box(t("Submit a blog"), blog_form(node_get_array(array("nid" => $id, "type" => "blog"))), "main"); + $theme->box(t("Older blogs"), blog_edit_history($id), "main"); break; case t("Preview"): - $theme->box(t("Preview Blog"), blog_form($edit)); + $theme->box(t("Preview Blog"), blog_form($edit), "main"); break; case t("Submit"): blog_save($edit); - blog_page_day($user->userid, time()); + blog_page_user($user->userid, time()); break; default: - $theme->box(t("Submit a blog"), blog_form($edit)); + $theme->box(t("Submit a blog"), blog_form($edit), "main"); } } } -function blog_link($type) { +function blog_link($type, $node = 0) { global $user; if ($type == "page" && user_access("access blogs")) { - $links[] = "<a href=\"module.php?mod=blog\">". t("latest blogs") ."</a>"; + $links[] = "<a href=\"module.php?mod=blog\">". t("user blogs") ."</a>"; } if ($type == "menu" && user_access("post blogs")) { @@ -284,6 +247,10 @@ function blog_link($type) { $links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($user->userid) ."\">". t("view your blog") ."</a>"; } + if ($type == "node" && $node) { + $links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($node->userid) ."\">". strtr(t("%a's blog"), array("%a" => $node->userid)) ."</a>"; + } + return $links ? $links : array(); } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 5106da1f2..60fd9bb5d 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -22,86 +22,60 @@ function blog_perm() { return array("administer blogs", "access blogs", "post blogs"); } -function blog_page_all($num = 20) { - global $theme, $user; - - $result = db_query("SELECT n.timestamp, n.title, u.userid, n.nid, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id ORDER BY b.lid DESC LIMIT $num"); - - while ($blog = db_fetch_object($result)) { - $output .= blog_format_link($blog) ." "; - $output .= "<a href=\"module.php?mod=blog&name=". urlencode($blog->userid) ."\"><img src=\"misc/earth.gif\" border= \"0\" width=\"11\" height=\"11\" alt=\"". t("This blog") ."\" /></a> "; - $output .= format_username($blog->userid) .", ". format_date($blog->timestamp, "small") .":<br />"; - $output .= "<blockquote><b>". check_input($blog->title) ."</b><br />" . check_output($blog->body, 1) ."</blockquote>\n"; - } - - $theme->header(); - $theme->box(t("Latest blogs"), $output); - $theme->footer(); +function blog_status() { + return array(dumped, posted); } -function blog_page_user($userid = 0, $date = 0) { +function blog_page_user($name = 0, $date = 0) { global $theme, $user; - $userid = $userid ? $userid : $user->userid; + $name = check_input($name ? $name : $user->userid); + $date = check_input($date ? $date : time()); - $theme->header(); - - if ($date) { - - /* - ** Displays today's blogs for this user: - */ - - blog_page_day($userid, $date); - } - else { - - /* - ** Display the last blogs for this user: - */ + $result = db_query("SELECT n.nid, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id WHERE u.userid = '$name' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 30"); - $result = db_query("SELECT n.nid, n.timestamp FROM node n LEFT JOIN users u ON u.id = n.author WHERE n.type = 'blog' AND u.userid = '". check_input($userid) ."' AND n.timestamp > ". (time() - 2592000) ." ORDER BY n.timestamp DESC LIMIT 20"); - while ($blog = db_fetch_object($result)) { - if ($date != date("ndy", $blog->timestamp)) { - $date = date("ndy", $blog->timestamp); - blog_page_day($userid, $blog->timestamp); + $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; + while ($blog = db_fetch_object($result)) { + if ($date != date("dny", $blog->timestamp)) { + $date = date("dny", $blog->timestamp); + if ($user->id && $user->userid == $name) { + $links = array("<a href=\"submit.php?mod=blog&op=edit&id=$blog->nid\">". t("edit") ."</a>"); + $output .= "<tr><td><b>". format_date($blog->timestamp, custom, "d M Y") .":</b></td><td align=\"right\">". $theme->links($links) ."</td></tr>"; + } + else { + $output .= "<tr><td colspan=\"2\"><b>". format_date($blog->timestamp, custom, "d M Y") .":</b></td></tr>"; } } + $output .= "<tr><td colspan=\"2\" style=\"margin-left: 20px;\">". check_output($blog->body, 1) ."</td></tr>"; } + $output .= "</table>"; + + $theme->header(); + $theme->box(strtr(t("%a's blog"), array("%a" => $name)), $output, "main"); $theme->footer(); } - -function blog_page_day($userid = 0, $date = 0) { +function blog_page_view($num = 20) { global $theme, $user; - $header .= "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"; - $header .= " <tr>\n"; - $header .= " <td><b><a href=\"module.php?mod=blog&op=view&name=". urlencode($userid) ."\">". check_output($userid) ."'s ". t("blog") ."</a></b></td>\n"; - $header .= " <td align=\"right\"><b><a href=\"module.php?mod=blog&op=view&name=". urlencode($userid) ."&date=$date\">". format_date($date, custom, "d-M-Y") ."</a></b></td>\n"; - $header .= " </tr>\n"; - $header .= "</table>\n"; - - $sdate = mktime(0, 0, 0, date("m", $date), date("d", $date), date("Y", $date)); - $edate = mktime(23, 59, 59, date("m", $date), date("d", $date), date("Y", $date)); - - $result = db_query("SELECT b.body, n.timestamp, n.nid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id WHERE u.userid = '". check_input($userid) ."' AND n.timestamp > '$sdate' AND n.timestamp < '$edate' ORDER BY b.lid DESC LIMIT 50"); + $result = db_query("SELECT n.timestamp, n.title, u.userid, n.nid, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id ORDER BY b.lid DESC LIMIT $num"); + $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; while ($blog = db_fetch_object($result)) { - if (!$first) $first = $blog->nid; - $output .= "<p>". blog_format_link($blog) . check_output($blog->body, 1) ."</p>\n"; - } + $links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($blog->userid) ."\">". strtr(t("%a's blog"), array("%a" => $blog->userid)) ."</a>"; + $links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog") ."</a>"; + $links[] = "<a href=\"node.php?id=$blog->nid\">". t("discuss") ."</a>"; - if ($user->id && $user->userid == $userid) { - $output .= "<p>[ <a href=\"submit.php?mod=blog&op=edit&id=$first\">". t("edit") ."</a> ]</p>"; + $output .= "<tr><td><b>$blog->title</b></td><td align=\"right\">". $theme->links($links) ."</td></tr>"; + $output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px; margin-bottom: 2px;\">$blog->body</div></td></tr>"; + unset($links); } + $output .= "</table>"; - $theme->box($header, $output); -} - -function blog_status() { - return array(dumped, posted); + $theme->header(); + $theme->box(t("User blogs"), $output, "main"); + $theme->footer(); } function blog_remove($nid) { @@ -124,20 +98,9 @@ function blog_format_link($blog) { } function blog_view($node, $main = 0) { - global $status, $theme; - - $userid = urlencode($node->userid); + global $theme; - $header .= "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">"; - $header .= " <tr>"; - $header .= " <td><b><a href=\"module.php?mod=blog&op=view&name=$userid\">". $node->userid ."'s ". t("blog") ."</a></b></td>"; - $header .= " <td align=\"right\"><b><a href=\"module.php?mod=blog&op=view&name=$userid&date=$node->timestamp\">". format_date($node->timestamp, custom, "d-M-Y") ."</a></b></td>"; - $header .= " </tr>"; - $header .= "</table>"; - - $output .= check_output($node->body, 1) ."<p>[ ". implode(" | ", link_node($node)) ." ]</p>"; - - $theme->box($header, $output); + $theme->node($node, $main); } function blog_form($edit = array()) { @@ -151,12 +114,12 @@ function blog_form($edit = array()) { else if ($type == "blog") { $item = node_get_object(array(type => "blog", nid => $id)); $edit["title"] = $item->title; - $edit["body"] = $item->body ." [<a href=\"module.php?mod=blog&name=". urlencode($item->userid) ."&date=$item->timestamp\">$item->userid</a>]"; + $edit["body"] = "<i>". $item->body ."</i> [<a href=\"module.php?mod=blog&name=". urlencode($item->userid) ."&date=$item->timestamp\">$item->userid</a>]"; } else if ($type == "import") { $item = db_fetch_object(db_query("SELECT i.*, f.title as ftitle, f.link as flink FROM item i, feed f WHERE i.iid = '". check_input($id) ."' AND i.fid = f.fid")); $edit["title"] = $item->title; - $edit["body"] = "<a href=\"$item->link\">$item->title</a> - ". check_output($item->description) ." [<a href=\"$item->flink\">$item->ftitle</a>]\n"; + $edit["body"] = "<a href=\"$item->link\">$item->title</a> - <i>". check_output($item->description) ."</i> [<a href=\"$item->flink\">$item->ftitle</a>]\n"; } if ($edit["title"]) { @@ -237,7 +200,7 @@ function blog_page() { blog_page_user($name, $date); } else { - blog_page_all(); + blog_page_view(); } } else { @@ -252,31 +215,31 @@ function blog_user() { switch ($op) { case "delete": blog_remove($id); - blog_page_day($user->userid, time()); + blog_page_user($user->userid, time()); break; case "edit": - $theme->box(t("Submit a blog"), blog_form(node_get_array(array("nid" => $id, "type" => "blog")))); - $theme->box(t("Older blogs"), blog_edit_history($id)); + $theme->box(t("Submit a blog"), blog_form(node_get_array(array("nid" => $id, "type" => "blog"))), "main"); + $theme->box(t("Older blogs"), blog_edit_history($id), "main"); break; case t("Preview"): - $theme->box(t("Preview Blog"), blog_form($edit)); + $theme->box(t("Preview Blog"), blog_form($edit), "main"); break; case t("Submit"): blog_save($edit); - blog_page_day($user->userid, time()); + blog_page_user($user->userid, time()); break; default: - $theme->box(t("Submit a blog"), blog_form($edit)); + $theme->box(t("Submit a blog"), blog_form($edit), "main"); } } } -function blog_link($type) { +function blog_link($type, $node = 0) { global $user; if ($type == "page" && user_access("access blogs")) { - $links[] = "<a href=\"module.php?mod=blog\">". t("latest blogs") ."</a>"; + $links[] = "<a href=\"module.php?mod=blog\">". t("user blogs") ."</a>"; } if ($type == "menu" && user_access("post blogs")) { @@ -284,6 +247,10 @@ function blog_link($type) { $links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($user->userid) ."\">". t("view your blog") ."</a>"; } + if ($type == "node" && $node) { + $links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($node->userid) ."\">". strtr(t("%a's blog"), array("%a" => $node->userid)) ."</a>"; + } + return $links ? $links : array(); } diff --git a/modules/node.module b/modules/node.module index 1d3981310..cde5f9d83 100644 --- a/modules/node.module +++ b/modules/node.module @@ -69,14 +69,13 @@ function node_cron() { db_query("UPDATE node SET status = '". node_status("dumped") ."', timestamp_hidden = '' WHERE timestamp_hidden > 0 AND timestamp_hidden < ". time()); } -function node_link($context) { +function node_link($type, $node = 0) { - if ($context == "admin" && user_access("administer nodes")) { + if ($type == "admin" && user_access("administer nodes")) { $links[] = "<a href=\"admin.php?mod=node\">content</a>"; } - if ($context[0] && $context[1]) { - $node = $context[1]; + if ($type == "node") { if ($node->body) { $links[] = "<a href=\"node.php?id=". $node->nid ."\">". t("read more") ."</a>"; } diff --git a/modules/node/node.module b/modules/node/node.module index 1d3981310..cde5f9d83 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -69,14 +69,13 @@ function node_cron() { db_query("UPDATE node SET status = '". node_status("dumped") ."', timestamp_hidden = '' WHERE timestamp_hidden > 0 AND timestamp_hidden < ". time()); } -function node_link($context) { +function node_link($type, $node = 0) { - if ($context == "admin" && user_access("administer nodes")) { + if ($type == "admin" && user_access("administer nodes")) { $links[] = "<a href=\"admin.php?mod=node\">content</a>"; } - if ($context[0] && $context[1]) { - $node = $context[1]; + if ($type == "node") { if ($node->body) { $links[] = "<a href=\"node.php?id=". $node->nid ."\">". t("read more") ."</a>"; } diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme index c1ed292eb..d579aa9b1 100644 --- a/themes/marvin/marvin.theme +++ b/themes/marvin/marvin.theme @@ -129,6 +129,10 @@ print "</table>\n"; print "<br />\n\n"; } + + function links($links, $delimiter = " · ") { + return implode($delimiter, $links); + } function footer() { ?> @@ -143,7 +147,7 @@ <tr> <td align="center" colspan="2"> <?php - print "<p><small>[ ". $this->links(link_page()) ." ]</small></p><p>". variable_get("site_footer", "") ."</p>\n"; + print "<p><small>". $this->links(link_page()) ."</small></p><p>". variable_get("site_footer", "") ."</p>\n"; ?> </td> </tr> |