1.10.x
Julio Montoya 10 years ago
parent 53a1e28764
commit 48e0a13da8
  1. 12
      main/social/groups.php
  2. 16
      main/social/home.php
  3. 15
      main/social/invitations.php
  4. 50
      main/social/profile.php
  5. 27
      main/social/search.php

@ -80,13 +80,7 @@ function validate_text_empty (str,msg) {
}
jQuery(document).ready(function() {
/* Binds a tab id in the url */
$("#tab_browse").bind("tabsselect", function(event, ui) {
window.location.href=ui.tab;
});
/*$("#tabs").tabs();
$("#tab_browse").tabs();*/
var valor = "' . $anchor . '";
$(".head").click(function() {
@ -865,7 +859,11 @@ if ($group_id != 0) {
}
$show_message = null;
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'show_message' && $_REQUEST['msg'] == 'topic_deleted') {
if (isset($_REQUEST['action']) &&
$_REQUEST['action'] == 'show_message' &&
isset($_REQUEST['msg']) &&
$_REQUEST['msg'] == 'topic_deleted'
) {
$show_message = Display::return_message(get_lang('Deleted'), 'success');
}

@ -209,7 +209,9 @@ if (!empty($results)) {
Display::url(
$result['picture_uri'],
$group_url
),$result['name'],$group_info.$group_actions
),
$result['name'],
$group_info.$group_actions,
);
}
}
@ -256,9 +258,9 @@ if ($list > 0) {
$social_group_block .= '<div class="list-group-newest">';
$social_group_block .= '<div class="group-title">' . get_lang('Newest') . '</div>';
for($i = 0;$i < $list; $i++){
$social_group_block.='<div class="items">';
$social_group_block.='<div class="group-image">' . $groups_newest[$i][0] . '</div>';
$social_group_block.='<div class="group-info">' . $groups_newest[$i][1];
$social_group_block.='<div class="row">';
$social_group_block.='<div class="col-md-2">' . $groups_newest[$i][0] . '</div>';
$social_group_block.='<div class="col-md-4">' . $groups_newest[$i][1];
$social_group_block.= $groups_newest[$i][2] . '</div>';
$social_group_block.="</div>";
}
@ -270,9 +272,9 @@ if ($list > 0) {
$social_group_block .= '<div class="group-title">' . get_lang('Popular') . '</div>';
for($i = 0;$i < $list; $i++){
$social_group_block.='<div class="items">';
$social_group_block.='<div class="group-image">' . $groups_pop[$i][0] . '</div>';
$social_group_block.='<div class="group-info">' . $groups_pop[$i][1];
$social_group_block.='<div class="row">';
$social_group_block.='<div class="col-md-2">' . $groups_pop[$i][0] . '</div>';
$social_group_block.='<div class="col-md-4">' . $groups_pop[$i][1];
$social_group_block.= $groups_pop[$i][2] . '</div>';
$social_group_block.="</div>";
}

@ -1,10 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.social
* @author Julio Montoya <gugli100@gmail.com>
*/
$cidReset=true;
$cidReset = true;
require_once '../inc/global.inc.php';
api_block_anonymous_users();
@ -127,10 +128,10 @@ if ($number_loop != 0) {
$content = Security::remove_XSS($invitation['content'], STUDENT, true);
$date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG);
$socialInvitationsBlock .= '<div class="row">';
$socialInvitationsBlock .= '<div class="col-md-2">';
$socialInvitationsBlock .= '<div class="col-md-3">';
$socialInvitationsBlock .= '<a href="profile.php?u='.$sender_user_id.'"><img src="'.$userPicture.'"/></a>';
$socialInvitationsBlock .= '</div>';
$socialInvitationsBlock .= '<div class="col-md-10">';
$socialInvitationsBlock .= '<div class="col-md-9">';
$socialInvitationsBlock .= '<h4 class="title-profile"><a href="profile.php?u='.$sender_user_id.'">
'.$user_info['complete_name'].'</a>:
</h4>';
@ -164,10 +165,10 @@ if (count($list_get_invitation_sent) > 0) {
$date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG);
$socialInvitationsBlock .= '<div class="row">';
$socialInvitationsBlock .= '<div class="col-md-2">';
$socialInvitationsBlock .= '<div class="col-md-3">';
$socialInvitationsBlock .= '<a href="profile.php?u='.$sender_user_id.'"><img src="'.$user_info['avatar'].'" /></a>';
$socialInvitationsBlock .= '</div>';
$socialInvitationsBlock .= '<div class="col-md-10">';
$socialInvitationsBlock .= '<div class="col-md-9">';
$socialInvitationsBlock .= '<h4 class="title-profile"><a class="profile_link" href="profile.php?u='.$sender_user_id.'">'.$user_info['complete_name'].'</a></h4>';
$socialInvitationsBlock .= '<div class="content-invitation">'.$title.' : '.$content.'</div>';
$socialInvitationsBlock .= '<div class="date-invitation">'. get_lang('DateSend').' : '.$date.'</div>';
@ -192,8 +193,8 @@ if (count($pending_invitations) > 0) {
$new_invitation[]=$invitation;
$socialInvitationsBlock .= '<div class="well"><div class="row">';
$socialInvitationsBlock .= '<div class="col-md-2">'.$invitation['picture_uri'].'</div>';
$socialInvitationsBlock .= '<div class="col-md-10">';
$socialInvitationsBlock .= '<div class="col-md-3">'.$invitation['picture_uri'].'</div>';
$socialInvitationsBlock .= '<div class="col-md-9">';
$socialInvitationsBlock .= '<h4 class="tittle-profile">'.$invitation['name'].'</h4>';
$socialInvitationsBlock .= '<div class="description-group">'.$invitation['description'].'</div>';
$socialInvitationsBlock .= '<div class="btn-group" role="group">';

@ -1,11 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This is the profile social main page
* @author Julio Montoya <gugli100@gmail.com>
* @author Isaac Flores Paz <florespaz_isaac@hotmail.com>
* @package chamilo.social
*/
* This is the profile social main page
* @author Julio Montoya <gugli100@gmail.com>
* @author Isaac Flores Paz <florespaz_isaac@hotmail.com>
* @todo use Display::panel()
* @package chamilo.social
*/
$cidReset = true;
require_once '../inc/global.inc.php';
// Include OpenGraph NOT AVAILABLE
@ -37,9 +40,20 @@ $social_session_block = null;
if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp_name'])) {
$messageId = 0;
$idMessage = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $_POST['social_wall_new_msg_main'], $messageId, MESSAGE_STATUS_WALL_POST);
$idMessage = SocialManager::sendWallMessage(
api_get_user_id(),
$friendId,
$_POST['social_wall_new_msg_main'],
$messageId,
MESSAGE_STATUS_WALL_POST
);
if (!empty($_FILES['picture']['tmp_name']) && $idMessage > 0) {
$error = SocialManager::sendWallMessageAttachmentFile(api_get_user_id(), $_FILES['picture'], $idMessage, $fileComment = '');
$error = SocialManager::sendWallMessageAttachmentFile(
api_get_user_id(),
$_FILES['picture'],
$idMessage,
$fileComment = ''
);
}
$url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
@ -49,7 +63,13 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
} else if (!empty($_POST['social_wall_new_msg']) && !empty($_POST['messageId'])) {
$messageId = intval($_POST['messageId']);
$res = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $_POST['social_wall_new_msg'], $messageId , MESSAGE_STATUS_WALL);
$res = SocialManager::sendWallMessage(
api_get_user_id(),
$friendId,
$_POST['social_wall_new_msg'],
$messageId,
MESSAGE_STATUS_WALL
);
$url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
header('Location: ' . $url);
@ -97,10 +117,10 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
}
}
} else {
$user_info = UserManager::get_user_info_by_id($user_id);
$user_info = UserManager::get_user_info_by_id($user_id);
}
} else {
$user_info = UserManager::get_user_info_by_id($user_id);
$user_info = UserManager::get_user_info_by_id($user_id);
}
@ -283,8 +303,9 @@ if ($show_full_profile) {
$wallSocialAddPost = SocialManager::getWallForm();
$social_wall_block = $wallSocialAddPost;
//Social Post Wall
// Social Post Wall
$post_wall = SocialManager::getWallMessagesByUser($my_user_id, $friendId) ;
$social_post_wall_block = '<div class="panel panel-default social-post">';
$social_post_wall_block .= '<div class="panel-heading">Mis publicaciones</div>';
$social_post_wall_block .='<div class="panel-body">';
@ -486,17 +507,14 @@ if ($show_full_profile) {
$total = count($grid_my_groups);
$i = 1;
foreach($grid_my_groups as $group) {
foreach ($grid_my_groups as $group) {
$my_groups .= '<div class="panel-body">';
$my_groups .= $group[0];
$my_groups .= '</div>';
if ($i < $total) {
$my_groups .= ', ';
}
$i++;
}
$my_groups .= '</div>';
$social_group_info_block = $my_groups;
$social_group_info_block = $my_groups;
}
//Block Social Course

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.social
* @author Julio Montoya <gugli100@gmail.com>
@ -31,7 +32,6 @@ if (!empty($extra_fields)) {
}
}
}
$user_info = UserManager::get_user_info_by_id($user_id);
//Block Social Menu
$social_menu_block = SocialManager::show_social_menu('search');
@ -136,15 +136,14 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
$grid_groups = array();
if (is_array($groups) && count($groups) > 0) {
$social_right_content .= '<div class="col-md-9">';
$social_right_content .= '<div class="row">';
$social_right_content .= Display::page_subheader(get_lang('Groups'));
$social_right_content .= '<ul class="thumbnails">';
foreach ($groups as $group) {
$group['name'] = Security::remove_XSS($group['name'], STUDENT, true);
$group['description'] = Security::remove_XSS($group['description'], STUDENT, true);
$id = $group['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_open = '<a class="btn btn-default" href="groups.php?id='.$id.'">';
$url_close = '</a>';
$name = cut($group['name'], 60, true);
$count_users_group = count(GroupPortalManager::get_all_users_by_group($id));
@ -153,31 +152,27 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
} else {
$count_users_group = $count_users_group.' '.get_lang('Members');
}
$picture = GroupPortalManager::get_picture_group($group['id'], $group['picture_uri'], 80);
$picture = GroupPortalManager::get_picture_group($group['id'], $group['picture_uri'], GROUP_IMAGE_SIZE_ORIGINAL);
$tags = GroupPortalManager::get_group_tags($group['id']);
$group['picture_uri'] = '<img src="'.$picture['file'].'" width="50" />';
$group['picture_uri'] = '<img src="'.$picture['file'].'" />';
$item_0 = Display::div($group['picture_uri']);
$members = Display::span($count_users_group);
$item_1 = Display::tag('h3', $url_open.$name.$url_close).$members;
$social_right_content .= '
<li class="col-md-8">
<div class="row">
<div class="col-md-1">
<div class="media">
'.$item_0.'
</div>
<div class="col-md-4">
<div class="card">
<div class="avatar">
'.$group['picture_uri'].'
</div>
<div class="col-md-6">
<div class="content">
'.$item_1.'
<p>'.$group['description'].'</p>
<p>'.$tags.'</p>
<p>'.$url_open.get_lang('SeeMore').$url_close.'</p>
</div>
</div>
</li>';
</div>';
}
$social_right_content .= '</ul></div></div>';

Loading…
Cancel
Save