Fixing social network UI see #190

skala
Julio Montoya 15 years ago
parent 53e198f26c
commit 277cef357d
  1. 7
      index.php
  2. 10
      main/css/blue_lagoon/default.css
  3. 15
      main/inc/lib/social.lib.php
  4. 6
      main/inc/lib/usermanager.lib.php
  5. 156
      main/social/friends.php
  6. 17
      main/social/groups.php
  7. 2
      main/social/invitations.php
  8. 18
      main/social/profile.php
  9. 4
      main/social/search.php
  10. 12
      user_portal.php

@ -443,7 +443,12 @@ function display_anonymous_right_menu() {
echo "</ul>";
echo "</div>";
}
//deleting the myprofile link
if (api_get_setting('allow_social_tool') == true) {
unset($menu_navigation['myprofile']);
}
if (!empty($menu_navigation)) {
echo "<div class=\"menusection\">";
echo "<span class=\"menusectioncaption\">".get_lang("MainNavigation")."</span>";

@ -2222,7 +2222,7 @@ div.comments {
margin-right:-100px;
}
.message-title {
color:#ff0000;
/* color:#ff0000; */
font-size:12px;
}
.message-body {
@ -2464,7 +2464,7 @@ div.image-social-content center.friend {
color:#000;
font-weight:bold;
font-size:12px;
vertical-align:bottom;
vertical-align:bottom;
}
.social-menu-title-right {
width:84%;
@ -3274,6 +3274,7 @@ a.read {
.search_user_grid_element_0 img {width:50px;height:50px;border:2px solid #E6E6E6;}
.search_user_grid_element_1 { width:100%; text-align:center;}
.search_user_grid_element_2 { width:100%; text-align:center;}
.search_user_grid_element_3 { width:100%; text-align:center;}
/*SEARCH GROUP*/
@ -3310,8 +3311,9 @@ a.read {
-moz-border-radius: 10px; border: 1px solid #e1e1e0;
-webkit-border-radius: 10px; border: 1px solid #e1e1e0;
-opera-border-radius: 10px; border: 1px solid #e1e1e0;
width:240px;
margin-top:40px;
width:270px;
margin-top:20px;
margin-right:10px;
margin-bottom:40px;
padding-left:10px;

@ -667,13 +667,11 @@ class SocialManager extends UserManager {
}
}
echo '<div class="social-menu">';
echo '<div class="social-menu">';
if ($show != 'shared_profile') {
echo '<div align="center" class="social-menu-title" ><span class="social-menu-text1">'.get_lang('Menu').'</span></div>';
echo '<div align="center" class="social-menu-title" ><span class="social-menu-text1">'.get_lang('Menu').'</span></div>';
echo '<div>
<ul>
@ -689,9 +687,10 @@ class SocialManager extends UserManager {
echo '</ul></li>';
}
if ($show == 'invitations') {
// why this link was hide?
//if ($show == 'invitations') {
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('mail.png',get_lang('Invitations'),array('hspace'=>'6')).'<span class="'.($show=='invitations'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Invitations').'</span></a></li>';
}
//}
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png',get_lang('ViewMySharedProfile'),array('hspace'=>'6')).'<span class="'.($show=='shared_profile'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('ViewMySharedProfile').'</span></a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/friends.php">'.Display::return_icon('members.gif',get_lang('Friends'),array('hspace'=>'6')).'<span class="'.($show=='friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Friends').'</span></a></li>
@ -716,11 +715,11 @@ class SocialManager extends UserManager {
//--- User image
echo '<div class="social-content-image">';
echo '<div class="social-background-content" style="width:80%;" ><center>';
echo '<div class="social-background-content" ><center>';
if ($img_array['file'] != 'unknown.jpg') {
echo '<a class="thickbox" href="'.$big_image.'"><img src='.$img_array['dir'].$img_array['file'].' width="180px" /> </a>';
} else {
echo '<img src='.$img_array['dir'].$img_array['file'].' width="150px"/>';
echo '<img src='.$img_array['dir'].$img_array['file'].' width="110px" />';
}
echo '</center></div>';
echo '</div>';

@ -2650,7 +2650,9 @@ class UserManager
if ($keyword_active) {
$sql .= " AND u.active='1'";
}
//avoid anonymous
$sql .= " AND u.status <> 6 ";
// adding the filter to see the user's only of the current access_url
if ($_configuration['multiple_access_urls']==true && api_get_current_access_url_id()!=-1) {
$sql.= " AND url_rel_user.access_url_id=".api_get_current_access_url_id();
@ -2666,7 +2668,7 @@ class UserManager
//$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";
$res = Database::query($sql, __FILE__, __LINE__);
if (Database::num_rows($res)> 0) {
while ($row = Database::fetch_array($res,'ASSOC')) {

@ -23,7 +23,6 @@ $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqu
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script type="text/javascript">
function delete_friend (element_div) {
id_image=$(element_div).attr("id");
user_id=id_image.split("_");
@ -98,83 +97,92 @@ echo '<div id="social-content">';
$language_variable = api_xml_http_response_encode(get_lang('Contacts'));
$user_id = api_get_user_id();
?>
<div align="center" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td height="25" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="100%" valign="top" class="social-align-box">&nbsp;&nbsp;<?php echo get_lang('Search') .'&nbsp;&nbsp; : &nbsp;&nbsp;'; ?>
<input class="social-search-image" type="text" id="id_search_image" name="id_search_image" value="" onkeyup="search_image_social(this)" />
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="175" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td height="153" valign="top">
<?php
echo '<div class="social-box-container2">';
echo '<div>'.Display::return_icon('content-post-group1.jpg').'</div>';
echo '<div id="div_content_table" class="social-box-content2">';
$list_path_friends = array();
$user_id = api_get_user_id();
$name_search= Security::remove_XSS($_POST['search_name_q']);
$number_friends = 0;
if (isset($name_search) && $name_search!='undefined') {
$friends = SocialManager::get_friends($user_id,null,$name_search);
} else {
$friends = SocialManager::get_friends($user_id);
}
$friend_html = '';
$number_of_images = 8;
$list_path_friends = array();
$user_id = api_get_user_id();
$name_search= Security::remove_XSS($_POST['search_name_q']);
$number_friends = 0;
if (isset($name_search) && $name_search!='undefined') {
$friends = SocialManager::get_friends($user_id,null,$name_search);
} else {
$friends = SocialManager::get_friends($user_id);
}
if (count($friends) == 0 ) {
echo get_lang('NoFriendsInYourContactList').'<br /><br />';
echo '<a href="search.php">'.get_lang('TryAndFindSomeFriends').'</a>';
} else {
?>
<div align="center" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td height="25" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="100%" valign="top" class="social-align-box">&nbsp;&nbsp;<?php echo get_lang('Search') .'&nbsp;&nbsp; : &nbsp;&nbsp;'; ?>
<input class="social-search-image" type="text" id="id_search_image" name="id_search_image" value="" onkeyup="search_image_social(this)" />
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="175" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td height="153" valign="top">
<?php
echo '<div class="social-box-container2">';
echo '<div>'.Display::return_icon('content-post-group1.jpg').'</div>';
echo '<div id="div_content_table" class="social-box-content2">';
$number_friends = count($friends);
if ($number_friends != 0) {
$number_loop = ($number_friends/$number_of_images);
$loop_friends = ceil($number_loop);
$j=0;
$friend_html.= '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="" >';
for ($k=0;$k<$loop_friends;$k++) {
$friend_html.='<tr><td valign="top">';
if ($j==$number_of_images) {
$number_of_images=$number_of_images*2;
}
while ($j<$number_of_images) {
if (isset($friends[$j])) {
$friend = $friends[$j];
$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="width:60px;height:60px;border:3pt solid #eee" 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>';
$friend_html = '';
$number_of_images = 8;
$number_friends = count($friends);
if ($number_friends != 0) {
$number_loop = ($number_friends/$number_of_images);
$loop_friends = ceil($number_loop);
$j=0;
$friend_html.= '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="" >';
for ($k=0;$k<$loop_friends;$k++) {
$friend_html.='<tr><td valign="top">';
if ($j==$number_of_images) {
$number_of_images=$number_of_images*2;
}
while ($j<$number_of_images) {
if (isset($friends[$j])) {
$friend = $friends[$j];
$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="width:60px;height:60px;border:3pt solid #eee" 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++;
}
$j++;
$friend_html.='</td></tr>';
}
$friend_html.='</td></tr>';
$friend_html.='<br/></table>';
}
$friend_html.='<br/></table>';
}
echo $friend_html;
echo '</div>';
echo '</div>';
?>
</td>
</tr>
</table></td>
</tr>
</table>
</div>
<?php
echo $friend_html;
echo '</div>';
echo '</div>';
?>
</td>
</tr>
</table></td>
</tr>
</table>
</div>
<?php
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
Display :: display_footer();
?>

@ -245,7 +245,7 @@ if ($group_id != 0 ) {
if (!empty($relation_group_title)) {
echo '<div class="social-group-details-info">';
echo '<span>'.get_lang('Status').' : </span>';
echo '<span>'.get_lang('StatusInThisGroup').' : </span>';
echo $relation_group_title;
echo '</div>';
}
@ -320,7 +320,7 @@ if ($group_id != 0 ) {
}
// Newest groups --------
$results = GroupPortalManager::get_groups_by_age(null,false);
$results = GroupPortalManager::get_groups_by_age(4,false);
$grid_newest_groups = array();
foreach ($results as $result) {
$id = $result['id'];
@ -353,7 +353,7 @@ if ($group_id != 0 ) {
}
// Pop groups -----
$results = GroupPortalManager::get_groups_by_popularity(null,false);
$results = GroupPortalManager::get_groups_by_popularity(4,false);
$grid_pop_groups = array();
foreach ($results as $result) {
$id = $result['id'];
@ -372,8 +372,15 @@ if ($group_id != 0 ) {
$result['picture_uri'] = '<img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" />';
$grid_item_1 = Display::return_icon('boxmygroups.jpg');
$item_1 = '<div>'.$url_open.$result['picture_uri'].'<p class="social-groups-text1"><strong>'.$name.'<br />('.$count_users_group.')</strong></p>'.$url_close.Display::return_icon('linegroups.jpg').'</div>';
$item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2">'.get_lang('GroupDescription').'</span></div>';
$item_3 = '<div class="box_description_group_content" >'.cut($result['description'],100,true).'</div>';
if ($result['description'] != '') {
$item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2">'.get_lang('GroupDescription').'</span></div>';
$item_3 = '<div class="box_description_group_content" >'.cut($result['description'],100,true).'</div>';
} else {
$item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2"></span></div>';
$item_3 = '<div class="box_description_group_content" ></div>';
}
$item_4 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
$grid_item_2 = $item_1.$item_2.$item_3.$item_4;

@ -110,7 +110,7 @@ echo '<div id="social-content">';
Display :: display_normal_message($show_message);
}
echo '<div id="id_response" align="center"></div>';
echo '<div id="id_response" align="center"></div>';
$list_get_invitation=array();
$user_id = api_get_user_id();

@ -249,8 +249,8 @@ echo '<div id="social-content">';
echo '<div id="social-content-right">';
echo '<div id="social-content-online">'.Display::return_icon('whoisonline.png','',array('hspace'=>'6')).'<a href="'.api_get_path(WEB_PATH).'whoisonline.php" ><span class="social-menu-text1">'.get_lang('FriendsOnline').' '.$user_online_count.'</span></a>';
echo '</div>';
//echo '<div id="social-content-online">'.Display::return_icon('whoisonline.png','',array('hspace'=>'6')).'<a href="'.api_get_path(WEB_PATH).'whoisonline.php" ><span class="social-menu-text1">'.get_lang('FriendsOnline').' '.$user_online_count.'</span></a>';
//echo '</div>';
echo '<div class="social-box-main1">';
@ -408,18 +408,12 @@ echo '<div id="social-content-right">';
$j=1;
for ($k=0;$k<$number_friends;$k++) {
if ($j > $number_of_images) break;
/*
if ($j==$number_of_images) {
$number_of_images=$number_of_images*2;
}
*/
//while ($j<$number_of_images) {
if ($j > $number_of_images) break;
if (isset($friends[$k])) {
$friend = $friends[$k];
$name_user = api_get_person_name($friend['firstName'], $friend['lastName']);
$friend_html.='<div id=div_'.$friend['friend_user_id'].' class="image_friend_network" ><span><center>';
// the height = 92 must be the sqme in the image_friend_network span style in default.css
$friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92, USER_IMAGE_SIZE_MEDIUM , 'width="85" height="90" ');
@ -428,9 +422,7 @@ echo '<div id="social-content-right">';
$friend_html.= '</center></span>';
$friend_html.= '<center class="friend">'.$name_user.'</a></center>';
$friend_html.= '</div>';
}
//$j++;
//}
}
$j++;
}
} else {

@ -53,12 +53,12 @@ echo '<div id="social-content">';
$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;
$results[] = array($img, $user['firstname'],$user['lastname'],$user['tag']);
$results[] = array($img, $user['firstname'],$user['lastname'], $user['tag']);
}
echo '<div class="social-box-container2">';
echo '<div>'.Display::return_icon('content-post-group1.jpg').'</div>';
echo '<div id="div_content_table" class="social-box-content2">';
Display::display_sortable_grid('search_user', array(), $results, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false ,true);
Display::display_sortable_grid('search_user', array(), $results, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false ,true);
echo '</div>';
echo '</div>';
}

@ -1243,6 +1243,7 @@ if ($show_menu) {
$group_pending_invitations = GroupPortalManager::get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION,false);
$group_pending_invitations = count($group_pending_invitations);
$total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations;
$cant_msg = '';
if ($number_of_new_messages > 0)
$cant_msg = ' ('.$number_of_new_messages.')';
@ -1255,17 +1256,14 @@ if ($show_menu) {
$link = '?f=social';
}
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'" class="message-body">'.get_lang('Inbox').$cant_msg.' </a><br />';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'" class="message-body">'.get_lang('Comppose').' </a><br />';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'" class="message-body">'.get_lang('Compose').' </a><br />';
if ($number_of_new_messages_of_friend > 0) {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('PendingInvitations').' ('.$number_of_new_messages_of_friend.') </a><br />';
if ($total_invitations > 0) {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('PendingInvitations').' ('.$total_invitations.') </a><br />';
}
if ( $group_pending_invitations > 0) {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('GroupPendingInvitations').' ('.$group_pending_invitations.') </a><br />';
}
echo '</p>';
//echo '<img src="'.api_get_path(WEB_IMG_PATH).'delete.gif" alt="'.get_lang('Close').'" title="'.get_lang('Close').'" class="message-delete" />';
echo '</div>';

Loading…
Cancel
Save