Index: bugnote_view_inc.php
===================================================================
--- bugnote_view_inc.php (revision 376)
+++ bugnote_view_inc.php (working copy)
@@ -124,6 +124,7 @@
?>
+
()
';
+ }
+ }
+ return $t_avatar_exist;
+ }
+
# --------------------
# prints the name of the user given the id. also makes it an email link.
function print_user( $p_user_id ) {
Index: core/user_api.php
===================================================================
--- core/user_api.php (revision 376)
+++ core/user_api.php (working copy)
@@ -629,6 +629,58 @@
}
# --------------------
+ # return the user avatar image
+ # return value is an array( URL, width, height )
+ # in this first implementation, only gravatar.com avatars are supported
+ function user_get_avatar( $p_user_id ) {
+ $t_email = user_get_email( $p_user_id );
+ $t_default_image = "/images/gravatar_logo.gif";
+ $t_size = 80;
+ $t_avatar_url = "http://www.gravatar.com/avatar.php?gravatar_id=" . md5( $t_email ) .
+ "&default=" . urlencode( $t_default_image ) .
+ "&size=" . $t_size .
+ "&rating=G";
+
+ return array( $t_avatar_url, $t_size, $t_size );
+ }
+
+ # --------------------
+ # return the user avatar image
+ # return value is an array( URL, width, height )
+ # in this first implementation, only gravatar.com avatars are supported
+ function user_get_local_avatar( $p_user_id ) {
+ global $g_path;
+ $t_avatar_exist = true;
+
+ # default imagesize
+ $t_height = 80;
+ $t_width = 80;
+
+ $t_username = user_get_name( $p_user_id );
+ $t_avatar_url = $g_path . "/avatar/" . $t_username . ".gif";
+ if (!file_exists(dirname( dirname( __FILE__ ) ).DIRECTORY_SEPARATOR.'avatar'.DIRECTORY_SEPARATOR.$t_username .".gif")) {
+ $t_avatar_url = $g_path . "/avatar/" . $t_username . ".jpg";
+ if (!file_exists(dirname( dirname( __FILE__ ) ).DIRECTORY_SEPARATOR.'avatar'.DIRECTORY_SEPARATOR.$t_username .".jpg")) {
+ $t_avatar_exist = false;
+ }
+ }
+
+ if ($t_avatar_exist) {
+ # get image dimensions
+ list($width_orig, $height_orig) = getimagesize($t_avatar_url);
+ $ratio_orig = $width_orig/$height_orig;
+
+ if ($t_width/$t_height > $ratio_orig) {
+ $t_width = $t_height*$ratio_orig;
+ } else {
+ $t_height = $t_width/$ratio_orig;
+ }
+ }
+
+ return array( $t_avatar_url, $t_width, $t_height, $t_avatar_exist );
+ }
+
+ # --------------------
# return the user's access level
# account for private project and the project user lists
function user_get_access_level( $p_user_id, $p_project_id = ALL_PROJECTS ) {
Index: css/default.css
===================================================================
--- css/default.css (revision 376)
+++ css/default.css (working copy)
@@ -144,5 +144,17 @@
border-bottom: 1px dotted black;
}
+.avatar
+{
+ float: right;
+ border: 0;
+}
+
+.manage_avatar
+{
+ float: left;
+ border: 0;
+}
+
.progress400 { position: relative; width: 400px; border: 1px solid #d7d7d7; margin-top: 1em; margin-bottom: 1em; padding: 1px; }
.progress400 .bar { display: block; position: relative; background: #6bba70; text-align: center; font-weight: normal; color: #333; height: 2em; line-height: 2em; }
Index: custom_strings_inc.php
===================================================================
--- custom_strings_inc.php (revision 387)
+++ custom_strings_inc.php (working copy)
@@ -9,9 +9,14 @@
+ #avatar
+ $s_avatar = 'Avatar';
+ $s_upload_avatar = 'Avatar hochladen';
+ $s_delete_avatar = 'Avatar löschen';
+
} else {
+
+ #avatar
+ $s_avatar = 'Avatar';
+ $s_upload_avatar = 'Upload Avatar';
+ $s_delete_avatar = 'Delete Avatar';
}
if ( file_exists( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'pluginmanager' . DIRECTORY_SEPARATOR . 'lang_inc.php' ) ) {
Index: manage_user_edit_page.php
===================================================================
--- manage_user_edit_page.php (revision 376)
+++ manage_user_edit_page.php (working copy)
@@ -9,7 +9,10 @@
# $Id: manage_user_edit_page.php,v 1.17 2007/03/06 07:05:18 vboctor Exp $
# --------------------------------------------------------
?>
|