Commit 1e4308a9 authored by Kjartan's avatar Kjartan

- made the user information block into two different blocks. One for

  login and one for user information.
- added link to help in book module (post-patch, see below).
- applied various patches:
  Patch by Greg Tyrelle <greg@tyrelle.net>
  - tracker module now shows usernames next to comments.

  Patch by Moshe Weitzman <moshe@wallaware.com>
  - book module has a more complete help.
  - added administrative link to export book to html
  - fixed non book nodes not showing up in trees.

  Patch by moshe weitzman <weitzman@tejasa.com>
  - links can be defined in the configuration file.
parent 1e8c9d81
......@@ -594,18 +594,21 @@ function field_merge($a, $b) {
}
function link_page() {
$links[] = "<a href=\"index.php\">". t("home") ."</a>";
foreach (module_list() as $name) {
if (module_hook($name, "link")) {
$links = array_merge($links, module_invoke($name, "link", "page"));
global $custom_links;
if (is_array($custom_links)) {
return $custom_links;
}
else {
$links[] = "<a href=\"index.php\">". t("home") ."</a>";
foreach (module_list() as $name) {
if (module_hook($name, "link")) {
$links = array_merge($links, module_invoke($name, "link", "page"));
}
}
return $links;
}
return $links;
}
}
function link_node($node, $main = 0) {
foreach (module_list() as $name) {
......
......@@ -45,4 +45,13 @@
# appropriately.
$languages = array("en" => "English");
# Custom Navigation Links override the standard page links
# offerred by most Drupal modules. Administrators may
# add/remove/reorder nav links here. These links are typically
# displayed in a row near the top of every page.
# $custom_links = array(
# "<a href=\"\index.php\">home</a>",
# "<a href=\"\module.php?mod=user\">school</a>",
# "<a href=\"\module.php?mod=blog\">work</a>");
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -34,12 +34,12 @@ function tracker_comments($id = 0) {
$cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND uid = '". check_input($id) ."' AND nid = '$node->nid' ORDER BY cid DESC");
}
else {
$cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND nid = '$node->nid' ORDER BY cid DESC");
$cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.nid = '$node->nid' ORDER BY c.cid DESC");
}
$output .= "<ul>";
while ($comment = db_fetch_object($cresult)) {
$output .= " <li><a href=\"node.php?id=$node->nid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."</a> (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
$output .= " <li><a href=\"node.php?id=$node->nid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."</a> by <a href=\"module.php?mod=user&op=view&id=$comment->uid\">". check_output($comment->name) ."</a> (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
}
$output .= " </ul>\n";
}
......
......@@ -34,12 +34,12 @@ function tracker_comments($id = 0) {
$cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND uid = '". check_input($id) ."' AND nid = '$node->nid' ORDER BY cid DESC");
}
else {
$cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND nid = '$node->nid' ORDER BY cid DESC");
$cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.nid = '$node->nid' ORDER BY c.cid DESC");
}
$output .= "<ul>";
while ($comment = db_fetch_object($cresult)) {
$output .= " <li><a href=\"node.php?id=$node->nid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."</a> (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
$output .= " <li><a href=\"node.php?id=$node->nid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."</a> by <a href=\"module.php?mod=user&op=view&id=$comment->uid\">". check_output($comment->name) ."</a> (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
}
$output .= " </ul>\n";
}
......
......@@ -464,9 +464,10 @@ function user_block() {
$output .= @implode("<br />\n", $links);
$output .= "</div>";
$block[0]["content"] = $output;
}
else {
$block[0]["subject"] = t("Log in");
$block[1]["subject"] = t("Log in");
$output .= "<div align=\"center\">\n";
$output .= "<form action=\"module.php?mod=user&op=login\" method=\"post\">\n";
......@@ -477,11 +478,15 @@ function user_block() {
if (variable_get("account_register", 1)) $output .= " <a href=\"module.php?mod=user\" title=\"". t("Create a new user account.") ."\">". t("REGISTER") ."</a>\n";
$output .= "</form>\n";
$output .= "</div>\n";
$block[1]["content"] = $output;
}
$block[0]["content"] = $output;
$block[0]["info"] = t("User information");
$block[0]["link"] = "module.php?mod=user";
$block[1]["info"] = t("Log in");
$block[1]["link"] = "module.php?mod=user";
// Who's online block
$time = 60 * 60; // minutes * seconds
$limit = 5; // List the X most recent people
......@@ -494,10 +499,10 @@ function user_block() {
$output .= '<li><a href="module.php?mod=user&op=view&id='. $account->uid .'">'. (strlen($account->name) > 10 ? substr($account->name, 0, 10) . '...' : $account->name) .'</a></li>';
}
$output .= "</ol>";
$block[1]["content"] = $output;
$block[2]["content"] = $output;
}
$block[1]["subject"] = t("Who's online");
$block[1]["info"] = t("Who's online");
$block[2]["subject"] = t("Who's online");
$block[2]["info"] = t("Who's online");
return $block;
}
......
......@@ -464,9 +464,10 @@ function user_block() {
$output .= @implode("<br />\n", $links);
$output .= "</div>";
$block[0]["content"] = $output;
}
else {
$block[0]["subject"] = t("Log in");
$block[1]["subject"] = t("Log in");
$output .= "<div align=\"center\">\n";
$output .= "<form action=\"module.php?mod=user&op=login\" method=\"post\">\n";
......@@ -477,11 +478,15 @@ function user_block() {
if (variable_get("account_register", 1)) $output .= " <a href=\"module.php?mod=user\" title=\"". t("Create a new user account.") ."\">". t("REGISTER") ."</a>\n";
$output .= "</form>\n";
$output .= "</div>\n";
$block[1]["content"] = $output;
}
$block[0]["content"] = $output;
$block[0]["info"] = t("User information");
$block[0]["link"] = "module.php?mod=user";
$block[1]["info"] = t("Log in");
$block[1]["link"] = "module.php?mod=user";
// Who's online block
$time = 60 * 60; // minutes * seconds
$limit = 5; // List the X most recent people
......@@ -494,10 +499,10 @@ function user_block() {
$output .= '<li><a href="module.php?mod=user&op=view&id='. $account->uid .'">'. (strlen($account->name) > 10 ? substr($account->name, 0, 10) . '...' : $account->name) .'</a></li>';
}
$output .= "</ol>";
$block[1]["content"] = $output;
$block[2]["content"] = $output;
}
$block[1]["subject"] = t("Who's online");
$block[1]["info"] = t("Who's online");
$block[2]["subject"] = t("Who's online");
$block[2]["info"] = t("Who's online");
return $block;
}
......
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