Esempio n. 1
0
                        <button class="btn btn-primary" name="btn_accepted" type="submit" id="btn_accepted_' . $sender_user_id . '" value="' . get_lang('Accept') . ' "onclick="javascript:register_friend(this)">
                        ' . get_lang('Accept') . '</button>
                        <button class="btn btn-danger" name="btn_denied" type="submit" id="btn_deniedst_' . $sender_user_id . ' " value="' . get_lang('Deny') . ' " onclick="javascript:denied_friend(this)" >
                        ' . get_lang('Deny') . '</button>
                    </div>
                </div>
        </div>';
    }
}
if (count($list_get_invitation_sent) > 0) {
    $social_right_content .= '<div class="span8">' . Display::page_subheader(get_lang('InvitationSent')) . '</div>';
    foreach ($list_get_invitation_sent as $invitation) {
        $sender_user_id = $invitation['user_receiver_id'];
        $social_right_content .= '<div id="id_' . $sender_user_id . '" class="invitation_confirm span8">';
        $picture = UserManager::get_user_picture_path_by_id($sender_user_id, 'web', false, true);
        $friends_profile = SocialManager::get_picture_user($sender_user_id, $picture['file'], 92);
        $userInfo = api_get_user_info($sender_user_id);
        $title = Security::remove_XSS($invitation['title'], STUDENT, true);
        $content = Security::remove_XSS($invitation['content'], STUDENT, true);
        $date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG);
        $social_right_content .= '
        <div class="span2">
            <a class="thumbnail" href="' . $userInfo['profile_url'] . '">
            <img src="' . $friends_profile['file'] . '"  /></a>
        </div>
        <div class="span3">
            <a class="profile_link" href="' . $userInfo['profile_url'] . '">' . $userInfo['complete_name'] . '</a>
            <div>' . $title . ' : ' . $content . '</div>
            <div>' . get_lang('DateSend') . ' : ' . $date . '</div>
            </div>
        </div>';
Esempio n. 2
0
 $number_friends = count($friends);
 if ($number_friends != 0) {
     $number_loop = $number_friends / $number_of_images;
     $loop_friends = ceil($number_loop);
     $j = 0;
     $friend_html .= '<ul class="thumbnails">';
     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 .= '<li class="span2">';
                 $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 .= '<div class="thumbnail" onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_' . $friends[$j]['friend_user_id'] . '>';
                 $friend_html .= '<img src="' . $friends_profile['file'] . '" id="imgfriend_' . $friend['friend_user_id'] . '" title="' . $user_name . '" />';
                 $friend_html .= '<div class="caption">';
                 $friend_html .= '<a href="profile.php?u=' . $friend['friend_user_id'] . '"><h5>' . $user_name . '</h5></a>';
                 $friend_html .= '<p><button class="btn" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '>' . get_lang('Delete') . '</button></p>';
                 $friend_html .= '</div>';
                 $friend_html .= '</div>';
                 $friend_html .= '</li>';
             }
             $j++;
         }
     }
     $friend_html .= '</ul>';
 }
 echo $friend_html;
Esempio n. 3
0
function listMyFriends($user_id, $link_shared, $show_full_profile)
{
    //SOCIALGOODFRIEND , USER_RELATION_TYPE_FRIEND, USER_RELATION_TYPE_PARENT
    $friends = SocialManager::get_friends($user_id, USER_RELATION_TYPE_FRIEND);

    $friendHtml = '';
    $number_of_images = 30;
    $number_friends = 0;
    $number_friends = count($friends);

    $friendHtml = '<div class="nav-list"><h3>'.get_lang('SocialFriend').'<span>(' . $number_friends . ')</span></h3></div>';

    if ($number_friends != 0) {
        if ($number_friends > $number_of_images) {
            if (api_get_user_id() == $user_id) {
                $friendHtml.= ' : <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>';
            } else {
                $friendHtml.= ' : <span>'
                    .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php'
                    .'?view=friends&height=390&width=610&user_id='.$user_id.'"'
                    .'class="thickbox" title="'.get_lang('SeeAll').'" >'.get_lang('SeeAll').'</a></span>';
            }
        }

        $friendHtml.= '<ul class="nav nav-list">';
        $j = 1;
        for ($k=0; $k < $number_friends; $k++) {
            if ($j > $number_of_images) break;

            if (isset($friends[$k])) {
                $friend = $friends[$k];
                $name_user    = api_get_person_name($friend['firstName'], $friend['lastName']);
                $user_info_friend = api_get_user_info($friend['friend_user_id'], true);

                if ($user_info_friend['user_is_online']) {
                    $statusIcon = Display::span('', array('class' => 'online_user_in_text'));
                } else {
                    $statusIcon = Display::span('', array('class' => 'offline_user_in_text'));
                }

                $friendHtml.= '<li class="">';
                // the height = 92 must be the sqme in the image_friend_network span style in default.css
                $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 20, USER_IMAGE_SIZE_SMALL);
                $friendHtml.= '<img src="'.$friends_profile['file'].'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>';
                $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared;
                $friendHtml.= $statusIcon .'<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '">' . $name_user .'</a>';
                $friendHtml.= '</li>';
            }
            $j++;
        }
        $friendHtml.='</ul>';
    } else {
        $friendHtml.= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />'
            .'<a class="btn" href="'.api_get_path(WEB_PATH).'whoisonline.php">'. get_lang('TryAndFindSomeFriends').'</a></div>';
    }

    return $friendHtml;
}
     $friend_html .= '<div id="friend-container" class="social-friend-container">';
     $friend_html .= '<div id="friend-header" >';
     if ($number_friends == 1) {
         $friend_html .= '<div style="float:left;width:80%">' . $number_friends . ' ' . get_lang('Friend') . '</div>';
     } else {
         $friend_html .= '<div style="float:left;width:80%">' . $number_friends . ' ' . get_lang('Friends') . '</div>';
     }
     $friend_html .= '</div>';
     // close div friend-header
     for ($k = 0; $k < $number_friends; $k++) {
         if (isset($friends[$k])) {
             $friend = $friends[$k];
             $name_user = api_get_person_name($friend['firstName'], $friend['lastName']);
             $friend_html .= '<div id=div_' . $friend['friend_user_id'] . ' class="image_friend_network" ><span><center>';
             // the height = 92 must be the sqme in the image_friend_network span style in default.css
             $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92, USER_IMAGE_SIZE_MEDIUM, 'width="85" height="90" ');
             $friend_html .= '<a href="' . $friend['user_info']['profile_url'] . '">';
             $friend_html .= '<img src="' . $friends_profile['file'] . '" ' . $friends_profile['style'] . ' id="imgfriend_' . $friend['friend_user_id'] . '" title="' . $name_user . '" />';
             $friend_html .= '</center></span>';
             $friend_html .= '<center class="friend">' . $name_user . '</a></center>';
             $friend_html .= '</div>';
         }
     }
     echo $friend_html;
     echo '</div>';
 } else {
     $usergroup = new UserGroup();
     // show all groups by user_id
     // MY GROUPS
     $results = $usergroup->get_groups_by_user($user_id, 0);
     $grid_my_groups = array();
Esempio n. 5
0
         if ($j > $number_of_images) {
             break;
         }
         if (isset($friends[$k])) {
             $friend = $friends[$k];
             $name_user = api_get_person_name($friend['firstName'], $friend['lastName']);
             $user_info_friend = api_get_user_info($friend['friend_user_id'], true);
             if ($user_info_friend['user_is_online']) {
                 $status_icon = Display::span('', array('class' => 'online_user_in_text'));
             } else {
                 $status_icon = Display::span('', array('class' => 'offline_user_in_text'));
             }
             $friend_html .= '<li class="span2">';
             $friend_html .= '<div class="thumbnail">';
             // the height = 92 must be the sqme in the image_friend_network span style in default.css
             $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92, USER_IMAGE_SIZE_ORIGINAL);
             $friend_html .= '<img src="' . $friends_profile['file'] . '"  id="imgfriend_' . $friend['friend_user_id'] . '" title="' . $name_user . '" />';
             $friend_html .= '<div class="caption">';
             $friend_html .= $status_icon . '<a href="' . $user_info_friend['profile_url'] . '">';
             $friend_html .= $name_user;
             $friend_html .= '</a></div>';
             $friend_html .= '</div>';
             $friend_html .= '</li>';
         }
         $j++;
     }
     $friend_html .= '</ul>';
 } else {
     // No friends!! :(
     $friend_html .= '<div><h3>' . get_lang('SocialFriend') . '</h3></div>';
     $friend_html .= '<div id="friend-container" class="social-friend-container">';