fixed display groups for my friend's shared profile - partial CT#446

skala
Cristian Fasanando 15 years ago
parent 2eef592410
commit a1d253177b
  1. 19
      main/inc/lib/message.lib.php
  2. 24
      main/social/groups.php
  3. 7
      main/social/profile.php

@ -837,7 +837,7 @@ class MessageManager
$rows = self::calculate_children($rows);
$group_info = GroupPortalManager::get_group_data($group_id);
$current_user_id = api_get_user_id();
$count=0;
$count_items = 0;
$html = '';
if (is_array($rows) && count($rows)> 0) {
@ -923,7 +923,15 @@ class MessageManager
<tr><td style="width:25%">&nbsp;</td><td style="text-align:center">'.$pager_items['details'].'</td><td style="text-align:right;width:25%">'.$pager_items['links'].'</td></tr></table></div>';
$topic_slice['items'] = array_slice($topic['items'],($page_item-1)*($items_per_page),$items_per_page);
$count_items = count($topic['items']);
$current_page = $count_items/$items_per_page;
if (is_int($current_page)) {
$page_item_nr = $current_page + 1;
} else {
$page_item_nr = intval($_GET['page_item_nr']);
}
foreach ($topic_slice['items'] as $item) {
$indent = $item['indent_cnt']*'15';
@ -936,10 +944,11 @@ class MessageManager
$html.= '<div class="social-box-container3" >';
$html .= '<div>'.Display::return_icon('content-post-reply01.jpg').'</div>';
$html .= '<div class="social-box-content3">';
$html.= '<div id="message-reply-link">
<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
$html.= '<div id="message-reply-link">';
//$html.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
$html.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.intval($_GET['page_nr']).'&page_item_nr='.intval($page_item_nr).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
if ($item['user_sender_id'] == $current_user_id) {
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$item['id'].'&action=edit_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$item['id'].'&action=edit_message_group&div_id=content_'.$topic['id'].'&page_nr='.intval($_GET['page_nr']).'&page_item_nr='.intval($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
}
$html.= '</div>';
$html.= '<div class="message-group-title">'.$item['title'].'&nbsp;</div>';

@ -12,6 +12,7 @@ require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
require_once api_get_path(LIBRARY_PATH).'text.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
api_block_anonymous_users();
@ -137,7 +138,8 @@ if (isset($_POST['token']) && $_POST['token'] === $_SESSION['sec_token']) {
// display error messages
if (is_string($res)) {
Display::display_error_message($res);
}
}
Security::clear_token();
}
}
@ -175,6 +177,7 @@ echo '<div id="social-content">';
echo '<div id="social-content-right">';
if ($group_id != 0 ) {
$group_info = GroupPortalManager::get_group_data($group_id);
//Loading group information
if (isset($_GET['status']) && $_GET['status']=='sent') {
@ -277,7 +280,7 @@ if ($group_id != 0 ) {
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$name .= Display::return_icon('moderator_star.png', get_lang('Moderator'), array('style'=>'vertical-align:middle'));
}
$count_users_group = count(GroupPortalManager::get_all_users_by_group($id));
$count_users_group = count(GroupPortalManager::get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
} else {
@ -303,7 +306,7 @@ if ($group_id != 0 ) {
$id = $result['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
$count_users_group = count(GroupPortalManager::get_all_users_by_group($id));
$count_users_group = count(GroupPortalManager::get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
} else {
@ -329,14 +332,15 @@ if ($group_id != 0 ) {
foreach ($results as $result) {
$id = $result['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
if ($result['count'] == 1 ) {
$result['count'] = $result['count'].' '.get_lang('Member');
} else {
$result['count'] = $result['count'].' '.get_lang('Members');
}
$count_users_group = $result['count'];
$url_close = '</a>';
$count_users_group = count(GroupPortalManager::get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
} else {
$count_users_group = $count_users_group.' '.get_lang('Members');
}
$name = api_strtoupper(cut($result['name'],30,true));
$picture = GroupPortalManager::get_picture_group($result['id'], $result['picture_uri'],80);
$result['picture_uri'] = '<img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" />';

@ -460,8 +460,9 @@ echo '<div id="social-content-right">';
echo '</div>'; // close div tag .social-box-main1
if ($show_full_profile) {
// MY GROUPS
$results = GroupPortalManager::get_groups_by_user(api_get_user_id(), 0);
$results = GroupPortalManager::get_groups_by_user($my_user_id, 0);
$grid_my_groups = array();
$max_numbers_of_group = 4;
if (is_array($results) && count($results) > 0) {
@ -485,8 +486,8 @@ echo '<div id="social-content-right">';
$count_users_group = $count_users_group.' '.get_lang('Members');
}
$picture = GroupPortalManager::get_picture_group($result['id'], $result['picture_uri'],80);
$item_name = '<div class="box_shared_profile_group_title">'.strtoupper($name). $icon.'</div>';
$item_description = '<div class="box_shared_profile_group_description">'.get_lang('DescriptionGroup').'<p>'.cut($result['description'],120,true).'</p></div>';
$item_name = '<div class="box_shared_profile_group_title"><span class="social-groups-text1">'.strtoupper($name).'</span>'. $icon.'</div>';
$item_description = '<div class="box_shared_profile_group_description"><span class="social-groups-text2">'.get_lang('DescriptionGroup').'</span><p class="social-groups-text4">'.cut($result['description'],120,true).'</p></div>';
$result['picture_uri'] = '<div class="box_shared_profile_group_image"><img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" /></div>';
$item_actions = '';
if (api_get_user_id() == $user_id) {

Loading…
Cancel
Save