';
}
$j++;
}
}
}
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::read('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 '';
echo api_xml_http_response_encode($result);
echo '
';
echo '';
api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments')));
echo api_xml_http_response_encode($result);
echo '
';
echo '