diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-02-11 19:11:59 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-02-11 19:11:59 +0000 |
commit | d795565c32530d6af7e895ca769423eb230b73bb (patch) | |
tree | f3c8f46fe488b416e062748cc24ade8509f17f93 /themes | |
parent | a333c05d74e0d7542ee8076262f054cc8d710251 (diff) | |
download | brdo-d795565c32530d6af7e895ca769423eb230b73bb.tar.gz brdo-d795565c32530d6af7e895ca769423eb230b73bb.tar.bz2 |
- Patch 5789 by TDobes: added avatar support to the Xtemplate theme.
Diffstat (limited to 'themes')
-rw-r--r-- | themes/xtemplate/xtemplate.css | 10 | ||||
-rw-r--r-- | themes/xtemplate/xtemplate.theme | 31 | ||||
-rw-r--r-- | themes/xtemplate/xtemplate.xtmpl | 6 |
3 files changed, 47 insertions, 0 deletions
diff --git a/themes/xtemplate/xtemplate.css b/themes/xtemplate/xtemplate.css index 4bbabe82b..8bec39cc5 100644 --- a/themes/xtemplate/xtemplate.css +++ b/themes/xtemplate/xtemplate.css @@ -219,6 +219,11 @@ table { font-size: 0.8em; padding: 1.5em; } +.node .avatar { + border: 1px solid #ddd; + float: right; + margin: 0.5em; +} .comment { border: 1px solid #abc; padding: .5em; @@ -234,6 +239,11 @@ table { float: right; color: red; } +.comment .avatar { + border: 1px solid #abc; + float: right; + margin: 0.5em; +} /* ** Module specific styles diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme index 432ff4a15..a75452257 100644 --- a/themes/xtemplate/xtemplate.theme +++ b/themes/xtemplate/xtemplate.theme @@ -15,6 +15,7 @@ function xtemplate_settings() { $output .= form_textarea(t("Primary links"), "xtemplate_primary_links", variable_get("xtemplate_primary_links", l("edit primary links", "admin/system/themes/xtemplate")), 70, 8, t("The HTML code for the primary links.")); $output .= form_textarea(t("Secondary links"), "xtemplate_secondary_links", variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/system/themes/xtemplate")), 70, 8, t("The HTML code for the secondary links.")); $output .= form_radios(t("Search box"), "xtemplate_search_box", variable_get("xtemplate_search_box", 0), array(t("Disabled"), t("Enabled")), t("Show a search box in the upper right corner.")); + $output .= form_group(t("Avatars"), form_checkbox(t("Display avatars with posts"), "xtemplate_avatar_node", 1, variable_get("xtemplate_avatar_node", 0), t("Display individualized pictures identifying users with posts they start.")) . form_checkbox(t("Display avatars with comments"), "xtemplate_avatar_comment", 1, variable_get("xtemplate_avatar_comment", 0), t("Display individualized pictures identifying users with their comments.")) . form_textfield(t("Default avatar"), "xtemplate_avatar_default", variable_get("xtemplate_avatar_default", ""), 70, 300, t("URL of avatar to display for users with no custom avatar selected. Leave blank for none."))); return $output; } @@ -49,6 +50,20 @@ function xtemplate_node($node, $main = 0, $page = 0) { $xtemplate->template->parse("node.title"); } + if (module_exist("profile") && variable_get("xtemplate_avatar_node", 0)) { + $avatar = $node->profile_avatar; + if (empty($avatar) || !file_exists($avatar)) { + $avatar = variable_get("xtemplate_avatar_default", ""); + } + else { + $avatar = file_create_url($avatar); + } + if ($avatar) { + $xtemplate->template->assign("avatar", "<img src=\"$avatar\" alt=\"" . t("%user's avatar", array("%user" => $comment->name ? $comment->name : t(variable_get("anonymous", "Anonymous")))) . "\" />"); + $xtemplate->template->parse("node.avatar"); + } + } + if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) { $xtemplate->template->assign("taxonomy", theme_links($taxonomy)); $xtemplate->template->parse("node.taxonomy"); @@ -82,10 +97,26 @@ function xtemplate_comment($comment, $links = 0) { if ($comment->new) { $xtemplate->template->parse("comment.new"); } + + if (module_exist("profile") && variable_get("xtemplate_avatar_comment", 0)) { + $avatar = $comment->profile_avatar; + if (empty($avatar) || !file_exists($avatar)) { + $avatar = variable_get("xtemplate_avatar_default", ""); + } + else { + $avatar = file_create_url($avatar); + } + if ($avatar) { + $xtemplate->template->assign("avatar", "<img src=\"$avatar\" alt=\"" . t("%user's avatar", array("%user" => $comment->name ? $comment->name : t(variable_get("anonymous", "Anonymous")))) . "\" />"); + $xtemplate->template->parse("comment.avatar"); + } + } + if ($links) { $xtemplate->template->assign("links", $links); $xtemplate->template->parse("comment.links"); } + $xtemplate->template->parse("comment"); $output = $xtemplate->template->text("comment"); $xtemplate->template->reset("comment"); diff --git a/themes/xtemplate/xtemplate.xtmpl b/themes/xtemplate/xtemplate.xtmpl index b82f6f38d..456a2424d 100644 --- a/themes/xtemplate/xtemplate.xtmpl +++ b/themes/xtemplate/xtemplate.xtmpl @@ -56,6 +56,9 @@ <!-- BEGIN: node --> <div class="node {static}"> + <!-- BEGIN: avatar --> + <div class="avatar">{avatar}</div> + <!-- END: avatar --> <!-- BEGIN: title --> <h2 class="title"><a href="{link}">{title}</a></h2> <!-- END: title --> @@ -72,6 +75,9 @@ <!-- BEGIN: comment --> <div class="comment"> + <!-- BEGIN: avatar --> + <div class="avatar">{avatar}</div> + <!-- END: avatar --> <h3 class="title">{title}</h3><!-- BEGIN: new --><span class="new">{new}</span><!-- END: new --> <div class="submitted">{submitted}</div> <div class="content">{content}</div> |