Fixing user images

skala
Julio Montoya 15 years ago
parent 40baf661f1
commit e682f8fb34
  1. 35
      main/css/base.css
  2. 3
      main/css/base_chamilo.css
  3. 11
      main/inc/lib/social.lib.php
  4. 2
      main/inc/lib/usermanager.lib.php
  5. 4
      main/social/friends.php
  6. 2
      main/social/profile.php
  7. 26
      main/social/search.php

@ -1224,6 +1224,27 @@ a.unread {
/*SOCIAL TOOL*/
.clip-wrapper {
position:relative;
width:100px;
height:100px;
top:-1px;
left:-1px;
}
.clip_vertical {
position:absolute;
clip:rect(0px 218px 155px 0px);
top:-42px;
left:-32px;
}
.clip_horizontal {
position:absolute;
clip:rect(0px 218px 155px 0px);
top:-25px;
left:-48px;
}
.social-plugin-item {
float:left;
width:50%;
@ -1314,7 +1335,7 @@ div.image-social-content center.friend {
height:auto;
overflow:hidden;
float:left;
width:700px;
width:700px;
}
.social-content-image {
@ -1333,7 +1354,6 @@ div.image-social-content center.friend {
width:175px;
}
.social-content-description {
background:#ECE9D8;
}
@ -1346,19 +1366,22 @@ div.image-social-content center.friend {
border-right:1px #9DACBF solid;
border-bottom:1px #9DACBF solid;
}
.social-profile-info {
width:100%;
}
.social-profile-info dt {
text-align:left;
clear:left;
float:left;
width:80px;
width:120px;
}
.social-profile-info dd {
padding:1px 0px 3px 0px;
float:left;
margin:0;
display : block;
padding-left:10px;
width:200px;
padding-left:5px;
width:150px;
}
/* general layout of the profile page */
@ -1623,7 +1646,7 @@ div.image-social-content center.friend {
}
.hidden_message a {
color:#fff;
color:#fff !important;
/* text-decoration: underline; */
}

@ -2873,8 +2873,7 @@ span.form_required {
/* input values to crop the image: top, right, bottom, left */
.online_grid_element_0 img{
width: 200px;
margin: -10px 0 0 -50px;
/* width: 200px; */
/* height: 150px; */
}

@ -13,6 +13,8 @@ define('SOCIAL_LEFT_PLUGIN', 1);
define('SOCIAL_CENTER_PLUGIN', 2);
define('SOCIAL_RIGHT_PLUGIN', 3);
define('CUT_GROUP_NAME', 50);
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
@ -814,7 +816,14 @@ class SocialManager extends UserManager {
$table_row[] = '<a href="'.$url.'"><img title = "'.$name.'" class="social-home-anonymous-online" alt="'.$name.'" src="'.$friends_profile['file'].'"></a>';
} else {
$friends_profile = UserManager::get_picture_user($uid, $image_array['file'], 80, USER_IMAGE_SIZE_ORIGINAL );
$table_row[] = '<a href="'.$url.'"><img title = "'.$name.'" class="social-home-users-online" alt="'.$name.'" src="'.$friends_profile['file'].'"></a>';
$img = '<img title = "'.$name.'" alt="'.$name.'" src="'.$friends_profile['file'].'">';
$clip = 'clip_vertical';
if ($friends_profile['original_height'] > $friends_profile['original_width']) {
$clip = 'clip_horizontal';
}
$table_row[] = Display::url(Display::div(Display::div($img, array('class'=>$clip)), array('class'=>'clip-wrapper')) , $url);
}
$table_row[] = '<a href="'.$url.'">'.(cut($user_info['firstName'],16)).'<br />'.cut($user_info['lastName'],18).'</a>';

@ -2352,6 +2352,8 @@ class UserManager
$margin = (($height - $dimension[1]) / 2);
//@ todo the padding-top should not be here
$picture['style'] = ' style="padding-top:'.$margin.'px; width:'.$dimension[0].'px; height:'.$dimension[1].'px;" ';
$picture['original_height'] = $dimension[0];
$picture['original_width'] = $dimension[1];
}
} else {
//$file = api_get_path(SYS_CODE_PATH).$patch_profile.$user_id.'/'.$picture_file;

@ -61,7 +61,7 @@ function show_icon_delete(element_html) {
elem_id=$(element_html).attr("id");
id_elem=elem_id.split("_");
ident="#img_"+id_elem[1];
$(ident).attr("src","../img/delete.gif");
$(ident).attr("src","../img/delete.png");
$(ident).attr("alt","'.get_lang('Delete', '').'");
$(ident).attr("title","'.get_lang('Delete', '').'");
}
@ -155,7 +155,7 @@ if (count($friends) == 0 ) {
$user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']);
$friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92);
$friend_html.='<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$friends[$j]['friend_user_id'].'>';
$friend_html.='<span><a href="profile.php?u='.$friend['friend_user_id'].'"><center><img src="'.$friends_profile['file'].'" style="height:60px;border:3pt solid #eee" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" /></center></a></span>';
$friend_html.='<span><a href="profile.php?u='.$friend['friend_user_id'].'"><center><img src="'.$friends_profile['file'].'" style="height:60px;" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" /></center></a></span>';
$friend_html.='<img onclick="delete_friend(this)" id=img_'.$friend['friend_user_id'].' src="../img/blank.gif" alt="" title="" class="image-delete" /> <center class="friend">'.$user_name.'</center></div>';
}
$j++;

@ -442,7 +442,7 @@ if ($show_full_profile) {
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
$icon = '';
$name = cut($result['name'],20,true);
$name = cut($result['name'],CUT_GROUP_NAME,true);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$icon = Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style'=>'vertical-align:middle;width:16px;height:16px;'));
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {

@ -48,18 +48,25 @@ echo '<div id="social-content">';
if (is_array($users) && count($users)> 0) {
echo '<h2>'.get_lang('Users').'</h2>';
foreach($users as $user) {
$url = api_get_path(WEB_PATH).'main/social/profile.php?u='.$user['user_id'];
if (empty($user['picture_uri'])) {
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown_180_100.jpg';
$img = Display::url('<img title class="social-home-anonymous-online" src="'.$picture['file'].'">', $url);
} else {
$picture = UserManager::get_picture_user($user['user_id'], $user['picture_uri'], 80, USER_IMAGE_SIZE_ORIGINAL );
$img = '<img src="'.$picture['file'].'">';
$clip = 'clip_vertical';
if ($picture['original_height'] > $picture['original_width']) {
$clip = 'clip_horizontal';
}
$img = Display::url(Display::div(Display::div($img, array('class'=>$clip)), array('class'=>'clip-wrapper')) , $url);
}
//$picture = UserManager::get_picture_user($user['user_id'], $user['picture_uri'],'', USER_IMAGE_SIZE_ORIGINAL);
$url_open = '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user['user_id'].'">';
$url_close ='</a>';
$img = $url_open.'<img src="'.$picture['file'].'" />'.$url_close;
$user['firstname'] = $url_open.$user['firstname'].$url_close;
$user['lastname'] = $url_open.$user['lastname']. $url_close;
$user['firstname'] = Display::url($user['firstname'], $url);
$user['lastname'] = Display::url($user['lastname'], $url);
$results[] = array($img, $user['firstname'], $user['lastname'], $user['tag']);
}
@ -141,15 +148,12 @@ echo '<div id="social-content">';
$item_4 = '<div class="box_description_group_tags" >'.$tags.'</div>';
$item_5 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
/*$join_url = '<a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('group_join.png', get_lang('JoinGroup'), array('hspace'=>'6')).''.get_lang('JoinGroup').'</a> ';
$item_4 = '<div class="box_description_group_actions" >'.$join_url. $url_open.get_lang('SeeMore').$url_close.'</div>';*/
$grid_item_2 = $item_0.$item_1.$item_2.$item_3.$item_4.$item_5;
$grid_groups[]= array('',$grid_item_2);
//$grid_groups[]= array('', $data);
}
}
Display::display_sortable_grid('mygroups', array(), $grid_groups, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false, array(true,true,true,true,true));
$visibility = array(true,true,true,true,true);
Display::display_sortable_grid('mygroups', array(), $grid_groups, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false, $visibility);
}
}
echo '</div>';

Loading…
Cancel
Save