'; 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']); $userPicture = UserManager::getUserPicture($friend['friend_user_id']); $friend_html.='
    '; $friend_html.=''; $friend_html.='
    '; $friend_html.='
    '.$user_name.'
    '; $friend_html.='

    '; $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_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': break; default: break; } break; case 'listWallMessage': $start = isset($_REQUEST['start']) ? intval($_REQUEST['start']) - 1 : 0; $length = isset($_REQUEST['length']) ? intval($_REQUEST['length']) : 10; $userId = isset($_REQUEST['u']) ? intval($_REQUEST['u']) : api_get_user_id(); $friendId = $userId; $array = SocialManager::getWallMessagesPostHTML($userId, $friendId, null, $length, $start); if (!empty($array)) { ksort($array); $html = ''; for($i = 0; $i < count($array); $i++) { $post = $array[$i]['html']; $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $array[$i]['id']); $html .= '
    '.$post.$comment.'
    '; } $html .= Display::div( Display::url( get_lang('SeeMore'), api_get_self() . '?u=' . $userId . '&a=listWallMessage&start=' . ($start + $length + 1) . '&length=' . $length, array( 'class' => 'nextPage', ) ), array( 'class' => 'next', ) ); echo $html; } break; default: echo ''; } exit;