diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-09-13 09:17:34 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-09-13 09:17:34 +0000 |
commit | 33b76e9ae446369dc921d33742903c761c611973 (patch) | |
tree | bedb70fc1733faca38ae4f436bce413600720c42 /modules/blog.module | |
parent | ee35d9136e70cbafad2574089c6f346ab5a635ba (diff) | |
download | brdo-33b76e9ae446369dc921d33742903c761c611973.tar.gz brdo-33b76e9ae446369dc921d33742903c761c611973.tar.bz2 |
- Added basic breadcrumb navigation to the blog module.
Diffstat (limited to 'modules/blog.module')
-rw-r--r-- | modules/blog.module | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/modules/blog.module b/modules/blog.module index 773e42283..9de75b81c 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -121,15 +121,14 @@ function blog_feed_last() { node_feed($result, $channel); } -function blog_page_user($uid = 0) { - global $user; +function blog_page_user($uid) { + $account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1)); - if ($uid) { - $account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1)); - } - else { - $account = $user; - } + // Breadcrumb navigation: + $trail[] = l(t("Home"), NULL); + $trail[] = l(t("Blogs"), "blog"); + $trail[] = l(t("%name's blog", array("%name" => $account->name)), "blog/$account->uid"); + theme("path", $trail, $trail); $result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10)); while ($node = db_fetch_object($result)) { @@ -226,6 +225,18 @@ function blog_page() { } +function blog_view($node, $main = 0) { + if ($main == 0) { + // Breadcrumb navigation: + $trail[] = l(t("Home"), NULL); + $trail[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid"); + + theme("path", $trail, $trail); + } + + theme("node", $node, $main); +} + function blog_link($type, $node = 0, $main) { global $user; |