From bf459265e607e4c5a5082ef0276a88dd90dd727f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 15 Feb 2004 21:17:23 +0000 Subject: - Patch #5789 by TDobes: made the avatars link to the user profile. --- themes/xtemplate/xtemplate.theme | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme index acb93d1d6..9da5e5a03 100644 --- a/themes/xtemplate/xtemplate.theme +++ b/themes/xtemplate/xtemplate.theme @@ -78,7 +78,11 @@ function xtemplate_node($node, $main = 0, $page = 0) { $avatar = file_create_url($avatar); } if ($avatar) { - $xtemplate->template->assign("avatar", "\"" $comment->name ? $comment->name : t(variable_get("anonymous", "Anonymous")))) . "\" />"); + $avatar = "\"" $comment->name ? $comment->name : t(variable_get("anonymous", "Anonymous")))) . "\" />"; + if ($node->uid) { + $avatar = l($avatar, "user/view/$node->uid", array("title" => t("View user profile."))); + } + $xtemplate->template->assign("avatar", $avatar); $xtemplate->template->parse("node.avatar"); } } @@ -126,7 +130,11 @@ function xtemplate_comment($comment, $links = 0) { $avatar = file_create_url($avatar); } if ($avatar) { - $xtemplate->template->assign("avatar", "\"" $comment->name ? $comment->name : t(variable_get("anonymous", "Anonymous")))) . "\" />"); + $avatar = "\"" $comment->name ? $comment->name : t(variable_get("anonymous", "Anonymous")))) . "\" />"; + if ($comment->uid) { + $avatar = l($avatar, "user/view/$comment->uid", array("title" => t("View user profile."))); + } + $xtemplate->template->assign("avatar", $avatar); $xtemplate->template->parse("comment.avatar"); } } -- cgit v1.2.3