From 9a4a9befac732cc0810707126385fab46f09abdc Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Wed, 29 May 2002 17:08:05 +0000 Subject: - fixing perma links and link to all blogs by user. - added access checks to blog block. --- modules/blog.module | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'modules/blog.module') diff --git a/modules/blog.module b/modules/blog.module index f3603bc5d..4c2c13f83 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -177,7 +177,7 @@ function blog_page_user($uid = 0, $date = 0, $all = 0) { $output .= ""; $output .= lm("image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "blog", "op" => "feed", "id" => $account->uid), "", array("title" => t("Read the XML version of this page."))) ."\n"; - if (!$all && !$date) { + if (!$all && $date) { $output .= lm(t("show all blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid, "all" => 1), "", array("title" => t("Show all blogs by this user"))); } else { @@ -199,9 +199,8 @@ function blog_page_last() { $links = link_node($blog, 1); - $output .= "". check_output($blog->title) ."". $theme->links($links) .""; - $output .= "
". check_output($blog->teaser, 1) ."

"; - + $output .= "". check_output($blog->title) ."". $theme->links($links) ."". l('', array("id" => $node->nid), "node", "", array("title" => t("Permanent link to this blog entry"))) .""; + $output .= "
". check_output($blog->teaser, 1) ."

"; } $output .= ""; @@ -315,7 +314,7 @@ function blog_link($type, $node = 0, $main) { if (blog_access("update", $node)) { $links[] = lm(t("edit this blog"), array("mod" => "node", "op" => "edit", "id" => $node->nid), "", array("title" => t("Edit this blog entry."))); } - elseif ($mod == "blog" && $op != "view" && !$id) { + elseif ($op != "view" && !$id) { $links[] = lm(t("%u's blog", array("%u" => $node->name)), array("mod" => "blog", "op" => "view", "id" => $node->uid), "", array("title" => t("Read %u's latest blog entries.", array("%u" => $node->name)))); } } @@ -328,14 +327,16 @@ function blog_block() { $result = db_query("SELECT u.uid, u.name, n.created, n.title, n.nid FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.type = 'blog' ORDER BY n.nid DESC LIMIT 10"); - while ($node = db_fetch_object($result)) { - $output .= l(check_output($node->title), array("id" => $node->nid)) ."
\n"; + if (user_access("access content")) { + while ($node = db_fetch_object($result)) { + $output .= l(check_output($node->title), array("id" => $node->nid)) ."
\n"; + } + $output .= "
".lm(t("more"), array("mod" => "blog"), t("Read the latest blog entries."))."
"; + $block[0]["content"] = $output; } - $output .= "
".lm(t("more"), array("mod" => "blog"), t("Read the latest blog entries."))."
"; $block[0]["subject"] = t("User blogs"); - $block[0]["content"] = $output; $block[0]["info"] = t("User blogs"); $block[0]["link"] = drupal_url(array("mod" => "blog"), "module"); -- cgit v1.2.3