diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-03-11 20:33:59 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-03-11 20:33:59 +0000 |
commit | 2101f6c454d670a93ee445f84bfe839aa21bf049 (patch) | |
tree | af44af9438d1346ef674d340813323fba134d31a /themes | |
parent | f10cca1182c1204eafd679e02a3b231f8df3c21b (diff) | |
download | brdo-2101f6c454d670a93ee445f84bfe839aa21bf049.tar.gz brdo-2101f6c454d670a93ee445f84bfe839aa21bf049.tar.bz2 |
- Rewrote the profile module:
+ Added a 'created' field to the users table and renamed the 'timestamp'
fied to 'changed' (cfr. node table). Update.php will try to determine
a 'created' timestamp for existing users.
+ The profile module no longer uses serialized data but has its own set
of tables. Known existing profile data is migrated by these new tables.
TODO: migrate the birthday field.
+ The profile fields can be grouped, and within each group, profile fields
can be sorted using weights.
+ The profile pages can be themed.
+ The profiles can be browsed based on certain properties/settings.
+ Change the _user hook: (i) 'private_view' and 'public_view' are merged
into 'view' as there are no private fields and (ii) 'edit_form' has
been renamed to 'edit'.
+ Avatar handling has been refactored and is now part of the user module.
The users table has a dedicted 'picture' field.
+ Simplified the way themes should use display/visualize pictures or
avatars.
+ Made it possible for administrators to replace or delete avatars.
+ ...
I hope this make for a good base to build on collectively.
Diffstat (limited to 'themes')
-rw-r--r-- | themes/xtemplate/default/xtemplate.css | 4 | ||||
-rw-r--r-- | themes/xtemplate/default/xtemplate.xtmpl | 12 | ||||
-rw-r--r-- | themes/xtemplate/pushbutton/xtemplate.css | 4 | ||||
-rw-r--r-- | themes/xtemplate/pushbutton/xtemplate.xtmpl | 12 | ||||
-rw-r--r-- | themes/xtemplate/xtemplate.theme | 41 |
5 files changed, 24 insertions, 49 deletions
diff --git a/themes/xtemplate/default/xtemplate.css b/themes/xtemplate/default/xtemplate.css index cc42447dc..fcf8d4f08 100644 --- a/themes/xtemplate/default/xtemplate.css +++ b/themes/xtemplate/default/xtemplate.css @@ -222,7 +222,7 @@ table { font-size: 0.8em; padding: 1.5em; } -.node .avatar { +.node .picture { border: 1px solid #ddd; float: right; margin: 0.5em; @@ -242,7 +242,7 @@ table { float: right; color: red; } -.comment .avatar { +.comment .picture { border: 1px solid #abc; float: right; margin: 0.5em; diff --git a/themes/xtemplate/default/xtemplate.xtmpl b/themes/xtemplate/default/xtemplate.xtmpl index b6c74d22b..a1e0e72ac 100644 --- a/themes/xtemplate/default/xtemplate.xtmpl +++ b/themes/xtemplate/default/xtemplate.xtmpl @@ -56,9 +56,9 @@ <!-- BEGIN: node --> <div class="node {static}"> - <!-- BEGIN: avatar --> - <div class="avatar">{avatar}</div> - <!-- END: avatar --> + <!-- BEGIN: picture --> + {picture} + <!-- END: picture --> <!-- BEGIN: title --> <h2 class="title"><a href="{link}">{title}</a></h2> <!-- END: title --> @@ -75,9 +75,9 @@ <!-- BEGIN: comment --> <div class="comment"> - <!-- BEGIN: avatar --> - <div class="avatar">{avatar}</div> - <!-- END: avatar --> + <!-- BEGIN: picture --> + {picture} + <!-- END: picture --> <h3 class="title">{title}</h3><!-- BEGIN: new --><span class="new">{new}</span><!-- END: new --> <div class="submitted">{submitted}</div> <div class="content">{content}</div> diff --git a/themes/xtemplate/pushbutton/xtemplate.css b/themes/xtemplate/pushbutton/xtemplate.css index dd06bc2b9..e3c72a2d4 100644 --- a/themes/xtemplate/pushbutton/xtemplate.css +++ b/themes/xtemplate/pushbutton/xtemplate.css @@ -312,7 +312,7 @@ table#footer-links { font-size: 0.83em; padding: 1.5em; } -.node .avatar { +.node .picture { border: 1px solid #fff; float: right; margin: 0.5em; @@ -334,7 +334,7 @@ table#footer-links { float: right; color: red; } -.comment .avatar { +.comment .picture { border: 1px solid #fff; float: right; margin: 0.5em; diff --git a/themes/xtemplate/pushbutton/xtemplate.xtmpl b/themes/xtemplate/pushbutton/xtemplate.xtmpl index f2eccd4c1..df01933c5 100644 --- a/themes/xtemplate/pushbutton/xtemplate.xtmpl +++ b/themes/xtemplate/pushbutton/xtemplate.xtmpl @@ -59,9 +59,9 @@ <!-- BEGIN: node --> <div class="node {static}"> - <!-- BEGIN: avatar --> - <div class="avatar">{avatar}</div> - <!-- END: avatar --> + <!-- BEGIN: picture --> + {picture} + <!-- END: picture --> <!-- BEGIN: title --> <h1 class="title"><a href="{link}">{title}</a></h1> <!-- END: title --> @@ -78,9 +78,9 @@ <!-- BEGIN: comment --> <div class="comment"> - <!-- BEGIN: avatar --> - <div class="avatar">{avatar}</div> - <!-- END: avatar --> + <!-- BEGIN: picture --> + <div class="picture">{picture}</div> + <!-- END: picture --> <h3 class="title">{title}</h3><!-- BEGIN: new --><span class="new">{new}</span><!-- END: new --> <div class="submitted">{submitted}</div> <div class="content">{content}</div> diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme index ac3e43a14..910698707 100644 --- a/themes/xtemplate/xtemplate.theme +++ b/themes/xtemplate/xtemplate.theme @@ -32,7 +32,8 @@ function xtemplate_settings() { $group .= 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('Header settings'), $group); - $group = 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.')); + $group = form_checkbox(t('Display pictures with posts'), 'xtemplate_picture_node', 1, variable_get('xtemplate_picture_node', 0), t('Display individualized pictures identifying users with posts they start.')); + $gourp .= form_checkbox(t('Display pictures with comments'), 'xtemplate_picture_comment', 1, variable_get('xtemplate_picture_comment', 0), t('Display individualized pictures identifying users with their comments.')); $output .= form_group(t('Avatar settings'), $group); return $output; @@ -69,22 +70,9 @@ 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) { - $avatar = "<img src=\"$avatar\" alt=\"" . t("%user's avatar", array("%user" => $node->name ? $node->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"); - } + if ($picture = theme('user_picture', $node)) { + $xtemplate->template->assign("picture", $picture); + $xtemplate->template->parse("node.picture"); } if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) { @@ -121,22 +109,9 @@ function xtemplate_comment($comment, $links = 0) { $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) { - $avatar = "<img src=\"$avatar\" alt=\"" . t("%user's avatar", array("%user" => $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"); - } + if ($picture = theme('user_picture', $comment)) { + $xtemplate->template->assign("picture", $picture); + $xtemplate->template->parse("comment.picture"); } if ($links) { |