';
for ($k=0;$k<$loop_friends;$k++) {
if ($j==$number_of_images) {
$number_of_images=$number_of_images*2;
}
while ($j<$number_of_images) {
if (isset($friends[$j])) {
$friend_html.='
';
$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.='';
$friend_html.='
';
$friend_html.='
';
$friend_html.='
'.$user_name.' ';
$friend_html.='
'.get_lang('Delete').'
';
$friend_html.='
';
$friend_html.='
';
$friend_html.=' ';
}
$j++;
}
}
$friend_html.='';
}
echo $friend_html;
break;
case 'toogle_course':
if (api_is_anonymous()){
echo '';
break;
}
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
$user_id = intval($_SESSION['social_user_id']);
if ($_POST['action']) {$action = $_POST['action'];}
switch ($action) {
case 'load_course' :
$course_id = intval($_POST['course_code']); // the int course id
$course_info = api_get_course_info_by_id($course_id);
$course_code = $course_info['code'];
if (api_is_user_of_course($course_info['real_id'], api_get_user_id())) {
//------Forum messages
$forum_result = get_all_post_from_user($user_id, $course_code);
$all_result_data = 0;
if ($forum_result !='') {
echo '';
echo api_xml_http_response_encode(get_lang('Forum'));
echo '
';
echo '';
echo api_xml_http_response_encode($forum_result);
echo '
';
echo ' ';
$all_result_data++;
}
//------Blog posts
$result = get_blog_post_from_user($course_code, $user_id);
if (!empty($result)) {
api_display_tool_title(api_xml_http_response_encode(get_lang('Blog')));
echo '';
echo api_xml_http_response_encode($result);
echo '
';
echo ' ';
$all_result_data++;
}
//------Blog comments
$result = get_blog_comment_from_user($course_code, $user_id);
if (!empty($result)) {
echo '';
api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments')));
echo api_xml_http_response_encode($result);
echo '
';
echo ' ';
$all_result_data++;
}
if ($all_result_data == 0) {
echo api_xml_http_response_encode(get_lang('NoDataAvailable'));
}
} else {
echo '
';
api_display_tool_title(api_xml_http_response_encode(get_lang('Details')));
echo '';
echo api_xml_http_response_encode(get_lang('UserNonRegisteredAtTheCourse'));
echo '
';
echo '
';
echo '
';
}
break;
case 'unload_course' :
//echo 'load2';
break;
default:
break;
}
break;
default:
echo '';
}
exit;