当前位置: 首页>>代码示例>>PHP>>正文


PHP SocialManager::get_relation_between_contacts方法代码示例

本文整理汇总了PHP中SocialManager::get_relation_between_contacts方法的典型用法代码示例。如果您正苦于以下问题:PHP SocialManager::get_relation_between_contacts方法的具体用法?PHP SocialManager::get_relation_between_contacts怎么用?PHP SocialManager::get_relation_between_contacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocialManager的用法示例。


在下文中一共展示了SocialManager::get_relation_between_contacts方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: api_get_user_info

             }
             // It's me!
             if (api_get_user_id() != $user_id) {
                 $user_info = api_get_user_info($user_id);
                 $show_full_profile = false;
                 if (!$user_info) {
                     // user does no exist !!
                     api_not_allowed(true);
                 } else {
                     //checking the relationship between me and my friend
                     $my_status = SocialManager::get_relation_between_contacts(api_get_user_id(), $user_id);
                     if (in_array($my_status, array(USER_RELATION_TYPE_PARENT, USER_RELATION_TYPE_FRIEND, USER_RELATION_TYPE_GOODFRIEND))) {
                         $show_full_profile = true;
                     }
                     //checking the relationship between my friend and me
                     $my_friend_status = SocialManager::get_relation_between_contacts($user_id, api_get_user_id());
                     if (in_array($my_friend_status, array(USER_RELATION_TYPE_PARENT, USER_RELATION_TYPE_FRIEND, USER_RELATION_TYPE_GOODFRIEND))) {
                         $show_full_profile = true;
                     } else {
                         // im probably not a good friend
                         $show_full_profile = false;
                     }
                 }
             } else {
                 $user_info = api_get_user_info($user_id);
             }
         } else {
             $user_info = api_get_user_info($user_id);
         }
     }
 }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:profile.php

示例2: send

 /**
  * Sends a message from one user to another user
  * @param int $from_user_id The ID of the user sending the message
  * @param int $to_user_id The ID of the user receiving the message
  * @param string $message Message
  * @param boolean $printResult Optional. Whether print the result
  * @param boolean $sanitize Optional. Whether sanitize the message
  * @return void Prints "1"
  */
 public function send($from_user_id, $to_user_id, $message, $printResult = true, $sanitize = true)
 {
     $user_friend_relation = SocialManager::get_relation_between_contacts($from_user_id, $to_user_id);
     if ($user_friend_relation == USER_RELATION_TYPE_FRIEND) {
         $user_info = api_get_user_info($to_user_id, true);
         $this->save_window($to_user_id);
         $_SESSION['openChatBoxes'][$to_user_id] = api_get_utc_datetime();
         if ($sanitize) {
             $messagesan = self::sanitize($message);
         } else {
             $messagesan = $message;
         }
         error_log(print_r($sanitize) . '----' . $messagesan);
         if (!isset($_SESSION['chatHistory'][$to_user_id])) {
             $_SESSION['chatHistory'][$to_user_id] = array();
         }
         $item = array("s" => "1", "f" => $from_user_id, "m" => $messagesan, "username" => get_lang('Me'));
         $_SESSION['chatHistory'][$to_user_id]['items'][] = $item;
         $_SESSION['chatHistory'][$to_user_id]['user_info']['user_name'] = $user_info['complete_name'];
         $_SESSION['chatHistory'][$to_user_id]['user_info']['online'] = $user_info['user_is_online'];
         $_SESSION['chatHistory'][$to_user_id]['user_info']['avatar'] = $user_info['avatar_small'];
         unset($_SESSION['tsChatBoxes'][$to_user_id]);
         $params = array();
         $params['from_user'] = intval($from_user_id);
         $params['to_user'] = intval($to_user_id);
         $params['message'] = $message;
         $params['sent'] = api_get_utc_datetime();
         if (!empty($from_user_id) && !empty($to_user_id)) {
             $this->save($params);
         }
         if ($printResult) {
             echo "1";
             exit;
         }
     } else {
         if ($printResult) {
             echo "0";
             exit;
         }
     }
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:50,代码来源:chat.lib.php

示例3: show_social_menu

 /**
  * Shows the right menu of the Social Network tool
  *
  * @param string $show highlight link possible values:
  * group_add,
  * home,
  * messages,
  * messages_inbox,
  * messages_compose ,
  * messages_outbox,
  * invitations,
  * shared_profile,
  * friends,
  * groups search
  * @param int $group_id group id
  * @param int $user_id user id
  * @param bool $show_full_profile show profile or not (show or hide the user image/information)
  * @param bool $show_delete_account_button
  *
  */
 public static function show_social_menu($show = '', $group_id = 0, $user_id = 0, $show_full_profile = false, $show_delete_account_button = false)
 {
     if (empty($user_id)) {
         $user_id = api_get_user_id();
     }
     $usergroup = new UserGroup();
     $user_info = api_get_user_info($user_id, true);
     $current_user_id = api_get_user_id();
     $current_user_info = api_get_user_info($current_user_id, true);
     if ($current_user_id == $user_id) {
         $user_friend_relation = null;
     } else {
         $user_friend_relation = SocialManager::get_relation_between_contacts($current_user_id, $user_id);
     }
     $show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups');
     // get count unread message and total invitations
     $count_unread_message = MessageManager::get_number_of_messages(true);
     $count_unread_message = !empty($count_unread_message) ? Display::badge($count_unread_message) : null;
     $number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
     $group_pending_invitations = $usergroup->get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION, false);
     $group_pending_invitations = count($group_pending_invitations);
     $total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations;
     $total_invitations = !empty($total_invitations) ? Display::badge($total_invitations) : '';
     $filesIcon = Display::return_icon('sn-files.png', get_lang('MyFiles'), '', ICON_SIZE_SMALL);
     $friendsIcon = Display::return_icon('sn-friends.png', get_lang('Friends'), '', ICON_SIZE_SMALL);
     $groupsIcon = Display::return_icon('sn-groups.png', get_lang('SocialGroups'), '', ICON_SIZE_SMALL);
     $homeIcon = Display::return_icon('sn-home.png', get_lang('Home'), '', ICON_SIZE_SMALL);
     $invitationsIcon = Display::return_icon('sn-invitations.png', get_lang('Invitations'), '', ICON_SIZE_SMALL);
     $messagesIcon = Display::return_icon('sn-message.png', get_lang('Messages'), '', ICON_SIZE_SMALL);
     $sharedProfileIcon = Display::return_icon('sn-profile.png', get_lang('ViewMySharedProfile'));
     $searchIcon = Display::return_icon('sn-search.png', get_lang('Search'), '', ICON_SIZE_SMALL);
     $html = '';
     $active = null;
     if (!in_array($show, array('shared_profile', 'groups', 'group_edit', 'member_list', 'waiting_list', 'invite_friends'))) {
         $links = '<ul class="nav nav-pills nav-stacked">';
         $active = $show == 'home' ? 'active' : null;
         $links .= '
             <li class="home-icon ' . $active . '">
                 <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
                     ' . $homeIcon . ' ' . get_lang('Home') . '
                 </a>
             </li>';
         $active = $show == 'messages' ? 'active' : null;
         $links .= '
             <li class="messages-icon ' . $active . '">
                 <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
                     ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
                 </a>
             </li>';
         //Invitations
         $active = $show == 'invitations' ? 'active' : null;
         $links .= '
             <li class="invitations-icon ' . $active . '">
                 <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
                     ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
                 </a>
             </li>';
         //Shared profile and groups
         $active = $show == 'shared_profile' ? 'active' : null;
         $links .= '
             <li class="shared-profile-icon' . $active . '">
                 <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
                     ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
                 </a>
             </li>';
         $active = $show == 'friends' ? 'active' : null;
         $links .= '
             <li class="friends-icon ' . $active . '">
                 <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
                     ' . $friendsIcon . ' ' . get_lang('Friends') . '
                 </a>
             </li>';
         $active = $show == 'browse_groups' ? 'active' : null;
         $links .= '
             <li class="browse-groups-icon ' . $active . '">
                 <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
                     ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
                 </a>
             </li>';
         //Search users
//.........这里部分代码省略.........
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:101,代码来源:social.lib.php

示例4: show_social_menu

 /**
  * Shows the right menu of the Social Network tool
  *
  * @param string highlight link possible values: group_add, home, messages, messages_inbox, messages_compose ,messages_outbox ,invitations, shared_profile, friends, groups search
  * @param int group id
  * @param int user id
  * @param bool show profile or not (show or hide the user image/information)
  *
  */
 public static function show_social_menu($show = '', $group_id = 0, $user_id = 0, $show_full_profile = false, $show_delete_account_button = false)
 {
     if (empty($user_id)) {
         $user_id = api_get_user_id();
     }
     $usergroup = new UserGroup();
     $user_info = api_get_user_info($user_id, true);
     $current_user_id = api_get_user_id();
     $current_user_info = api_get_user_info($current_user_id, true);
     if ($current_user_id == $user_id) {
         $user_friend_relation = null;
     } else {
         $user_friend_relation = SocialManager::get_relation_between_contacts($current_user_id, $user_id);
     }
     $show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups');
     // get count unread message and total invitations
     $count_unread_message = MessageManager::get_number_of_messages(true);
     $count_unread_message = !empty($count_unread_message) ? Display::badge($count_unread_message) : '';
     $number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
     $group_pending_invitations = $usergroup->get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION, false);
     $group_pending_invitations = count($group_pending_invitations);
     $total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations;
     $total_invitations = !empty($total_invitations) ? Display::badge($total_invitations) : '';
     $html = '<div class="social-menu">';
     if (in_array($show, $show_groups) && !empty($group_id)) {
         //--- Group image
         $group_info = $usergroup->get($group_id);
         $big = $usergroup->get_picture_group($group_id, $group_info['picture'], 160, GROUP_IMAGE_SIZE_BIG);
         $html .= '<div class="social-content-image">';
         $html .= '<div class="well social-background-content">';
         $html .= Display::url('<img src=' . $big['file'] . ' class="social-groups-image" /> </a><br /><br />', api_get_path(WEB_PATH) . 'main/social/groups.php?id=' . $group_id);
         if ($usergroup->is_group_admin($group_id, api_get_user_id())) {
             $html .= '<div id="edit_image" class="hidden_message" style="display:none"><a href="' . api_get_path(WEB_PATH) . 'main/social/group_edit.php?id=' . $group_id . '">' . get_lang('EditGroup') . '</a></div>';
         }
         $html .= '</div>';
         $html .= '</div>';
     } else {
         $img_array = UserManager::get_user_picture_path_by_id($user_id, 'web', true, true);
         $big_image = UserManager::get_picture_user($user_id, $img_array['file'], '', USER_IMAGE_SIZE_BIG);
         $big_image = $big_image['file'];
         $normal_image = $img_array['dir'] . $img_array['file'];
         //--- User image
         $html .= '<div class="well social-background-content">';
         if ($img_array['file'] != 'unknown.jpg') {
             $html .= '<a class="thumbnail ajax" href="' . $big_image . '"><img src=' . $normal_image . ' /> </a>';
         } else {
             $html .= '<img src=' . $normal_image . ' width="110px" />';
         }
         if (api_get_user_id() == $user_id) {
             $html .= '<div id="edit_image" class="hidden_message" style="display:none">';
             $html .= '<a href="' . api_get_path(WEB_PATH) . 'main/auth/profile.php">' . get_lang('EditProfile') . '</a></div>';
         }
         $html .= '</div>';
     }
     if (!in_array($show, array('shared_profile', 'groups', 'group_edit', 'member_list', 'waiting_list', 'invite_friends'))) {
         $html .= '<div class="well sidebar-nav"><ul class="nav nav-list">';
         $active = $show == 'home' ? 'active' : null;
         $html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/home.php">' . Display::return_icon('home.png', get_lang('Home'), array()) . get_lang('Home') . '</a></li>';
         if (api_get_setting('allow_message_tool') == 'true') {
             $active = $show == 'messages' ? 'active' : null;
             $html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/messages/inbox.php?f=social">' . Display::return_icon('instant_message.png', get_lang('Messages'), array()) . get_lang('Messages') . $count_unread_message . '</a></li>';
         }
         // Invitations
         if (api_get_setting('allow_message_tool') == 'true') {
             $active = $show == 'invitations' ? 'active' : null;
             $html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/invitations.php">' . Display::return_icon('invitation.png', get_lang('Invitations'), array()) . get_lang('Invitations') . $total_invitations . '</a></li>';
         }
         //Shared profile and groups
         $active = $show == 'shared_profile' ? 'active' : null;
         $html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/profile.php">' . Display::return_icon('my_shared_profile.png', get_lang('ViewMySharedProfile'), array()) . get_lang('ViewMySharedProfile') . '</a></li>';
         $active = $show == 'friends' ? 'active' : null;
         $html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/friends.php">' . Display::return_icon('friend.png', get_lang('Friends'), array()) . get_lang('Friends') . '</a></li>';
         $active = $show == 'browse_groups' ? 'active' : null;
         $html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/groups.php">' . Display::return_icon('group_s.png', get_lang('SocialGroups'), array()) . get_lang('SocialGroups') . '</a></li>';
         //Search users
         $active = $show == 'search' ? 'active' : null;
         $html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/search.php">' . Display::return_icon('zoom.png', get_lang('Search'), array()) . get_lang('Search') . '</a></li>';
         $html .= '</ul>
               </div>';
     }
     if (in_array($show, $show_groups) && !empty($group_id)) {
         $html .= $usergroup->show_group_column_information($group_id, api_get_user_id(), $show);
     }
     if ($show == 'shared_profile') {
         //echo '<div align="center" class="social-menu-title" ><span class="social-menu-text1">'.get_lang('Menu').'</span></div>';
         $html .= '<div class="well sidebar-nav">
                 <ul class="nav nav-list">';
         // My own profile
         if ($show_full_profile && $user_id == intval(api_get_user_id())) {
             $html .= '<li><a href="' . api_get_path(WEB_PATH) . 'main/social/home.php">' . Display::return_icon('home.png', get_lang('Home'), array()) . get_lang('Home') . '</a></li>';
             if (api_get_setting('allow_message_tool') == 'true') {
//.........这里部分代码省略.........
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:101,代码来源:social.lib.php

示例5: intval

     // Groups
     $fromGroups = intval(($pageGroup - 1) * $itemPerPage);
     $totalGroups = count($usergroup->get_all_group_tags($_GET['q'], 0, $itemPerPage, true));
     $groups = $usergroup->get_all_group_tags($_GET['q'], $fromGroups);
 }
 if (empty($users) && empty($groups)) {
     $social_right_content .= get_lang('SorryNoResults');
 }
 $results = '<div id="online_grid_container">';
 if (is_array($users) && count($users) > 0) {
     $results .= Display::page_subheader(get_lang('Users'));
     $results .= '<div class="row">';
     $buttonClass = 'btn btn-default btn-sm';
     foreach ($users as $user) {
         $send_inv = '<button class="' . $buttonClass . ' disabled "><i class="fa fa-user"></i> ' . get_lang('SendInvitation') . '</button>';
         $relation_type = intval(SocialManager::get_relation_between_contacts(api_get_user_id(), $user['user_id']));
         $user_info = api_get_user_info($user['user_id'], true);
         $url = api_get_path(WEB_PATH) . 'main/social/profile.php?u=' . $user['user_id'];
         // Show send invitation icon if they are not friends yet
         if ($relation_type != 3 && $relation_type != 4 && $user['user_id'] != api_get_user_id()) {
             $send_inv = '<a href="#" class="' . $buttonClass . ' btn-to-send-invitation" data-send-to="' . $user['user_id'] . '">
                          <i class="fa fa-user"></i> ' . get_lang('SendInvitation') . '</a>';
         }
         $send_msg = '<a href="#" class="btn-to-send-message ' . $buttonClass . '" data-send-to="' . $user['user_id'] . '">
                     <i class="fa fa-envelope"></i> ' . get_lang('SendMessage') . '</a>';
         $img = '<img src="' . $user_info['avatar'] . '" width="100" height="100">';
         if ($user_info['user_is_online']) {
             $status_icon = Display::span('', array('class' => 'online_user_in_text'));
         } else {
             $status_icon = Display::span('', array('class' => 'offline_user_in_text'));
         }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:search.php

示例6: show_social_menu

 /**
  * Shows the right menu of the Social Network tool
  *
  * @param string $show highlight link possible values:
  * group_add,
  * home,
  * messages,
  * messages_inbox,
  * messages_compose ,
  * messages_outbox,
  * invitations,
  * shared_profile,
  * friends,
  * groups search
  * @param int $group_id group id
  * @param int $user_id user id
  * @param bool $show_full_profile show profile or not (show or hide the user image/information)
  * @param bool $show_delete_account_button
  *
  */
 public static function show_social_menu($show = '', $group_id = 0, $user_id = 0, $show_full_profile = false, $show_delete_account_button = false)
 {
     if (empty($user_id)) {
         $user_id = api_get_user_id();
     }
     $usergroup = new UserGroup();
     $user_info = api_get_user_info($user_id, true);
     $current_user_id = api_get_user_id();
     $current_user_info = api_get_user_info($current_user_id, true);
     if ($current_user_id == $user_id) {
         $user_friend_relation = null;
     } else {
         $user_friend_relation = SocialManager::get_relation_between_contacts($current_user_id, $user_id);
     }
     $show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups');
     // get count unread message and total invitations
     $count_unread_message = MessageManager::get_number_of_messages(true);
     $count_unread_message = !empty($count_unread_message) ? Display::badge($count_unread_message) : null;
     $number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
     $group_pending_invitations = $usergroup->get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION, false);
     $group_pending_invitations = count($group_pending_invitations);
     $total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations;
     $total_invitations = !empty($total_invitations) ? Display::badge($total_invitations) : '';
     $html = '';
     $active = null;
     if (!in_array($show, array('shared_profile', 'groups', 'group_edit', 'member_list', 'waiting_list', 'invite_friends'))) {
         $html .= '<div class="panel panel-default sidebar-nav">';
         $html .= '<div class="panel-body">';
         $html .= '<ul class="nav nav-pills nav-stacked">';
         $active = $show == 'home' ? 'active' : null;
         $html .= '<li class="home-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">' . Display::return_icon('social-home.png', get_lang('Home'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Home') . '</a></li>';
         $active = $show == 'messages' ? 'active' : null;
         $html .= '<li class="messages-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">' . Display::return_icon('social-message.png', get_lang('Messages'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Messages') . $count_unread_message . '</a></li>';
         //Invitations
         $active = $show == 'invitations' ? 'active' : null;
         $html .= '<li class="invitations-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">' . Display::return_icon('social-invitations.png', get_lang('Invitations'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Invitations') . $total_invitations . '</a></li>';
         //Shared profile and groups
         $active = $show == 'shared_profile' ? 'active' : null;
         $html .= '<li class="shared-profile-icon' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">' . Display::return_icon('social-profile.png', get_lang('ViewMySharedProfile'), '', ICON_SIZE_SMALL) . ' ' . get_lang('ViewMySharedProfile') . '</a></li>';
         $active = $show == 'friends' ? 'active' : null;
         $html .= '<li class="friends-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">' . Display::return_icon('social-friends.png', get_lang('Friends'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Friends') . '</a></li>';
         $active = $show == 'browse_groups' ? 'active' : null;
         $html .= '<li class="browse-groups-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">' . Display::return_icon('social-groups.png', get_lang('SocialGroups'), '', ICON_SIZE_SMALL) . ' ' . get_lang('SocialGroups') . '</a></li>';
         //Search users
         $active = $show == 'search' ? 'active' : null;
         $html .= '<li class="search-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">' . Display::return_icon('social-search.png', get_lang('Search'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Search') . '</a></li>';
         //My files
         $active = $show == 'myfiles' ? 'active' : null;
         $html .= '<li class="myfiles-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">' . Display::return_icon('social-files.png', get_lang('MyFiles'), '', ICON_SIZE_SMALL) . ' ' . get_lang('MyFiles') . '</span></a></li>';
         $html .= '</ul></div></div>';
     }
     if (in_array($show, $show_groups) && !empty($group_id)) {
         $html .= $usergroup->show_group_column_information($group_id, api_get_user_id(), $show);
     }
     if ($show == 'shared_profile') {
         $html .= '<div class="panel panel-default sidebar-nav">';
         $html .= '<div class="panel-body">';
         $html .= '<ul class="nav nav-pills nav-stacked">';
         // My own profile
         if ($show_full_profile && $user_id == intval(api_get_user_id())) {
             $html .= '<li class="home-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">' . Display::return_icon('social-home.png', get_lang('Home'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Home') . '</a></li>
                       <li class="messages-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">' . Display::return_icon('social-message.png', get_lang('Messages'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Messages') . $count_unread_message . '</a></li>';
             $active = $show == 'invitations' ? 'active' : null;
             $html .= '<li class="invitations-icon' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">' . Display::return_icon('social-invitations.png', get_lang('Invitations'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Invitations') . $total_invitations . '</a></li>';
             $html .= '<li class="shared-profile-icon active"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">' . Display::return_icon('social-profile.png', get_lang('ViewMySharedProfile'), '', ICON_SIZE_SMALL) . ' ' . get_lang('ViewMySharedProfile') . '</a></li>
                       <li class="friends-icon"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">' . Display::return_icon('social-friends.png', get_lang('Friends'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Friends') . '</a></li>
                       <li class="browse-groups-icon"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">' . Display::return_icon('social-groups.png', get_lang('SocialGroups'), '', ICON_SIZE_SMALL) . ' ' . get_lang('SocialGroups') . '</a></li>';
             $active = $show == 'search' ? 'active' : null;
             $html .= '<li class="search-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">' . Display::return_icon('social-search.png', get_lang('Search'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Search') . '</a></li>';
             $active = $show == 'myfiles' ? 'active' : null;
             $html .= '<li class="myfiles-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">' . Display::return_icon('social-files.png', get_lang('MyFiles'), '', ICON_SIZE_SMALL) . ' ' . get_lang('MyFiles') . '</a></li>';
         }
         // My friend profile.
         if ($user_id != api_get_user_id()) {
             $html .= '<li><a href="#" class="btn-to-send-message" data-send-to="' . $user_id . '" title="' . get_lang('SendMessage') . '">';
             $html .= Display::return_icon('compose_message.png', get_lang('SendMessage')) . '&nbsp;&nbsp;' . get_lang('SendMessage') . '</a></li>';
         }
         // Check if I already sent an invitation message
         $invitation_sent_list = SocialManager::get_list_invitation_sent_by_user_id(api_get_user_id());
         if (isset($invitation_sent_list[$user_id]) && is_array($invitation_sent_list[$user_id]) && count($invitation_sent_list[$user_id]) > 0) {
//.........这里部分代码省略.........
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:101,代码来源:social.lib.php


注:本文中的SocialManager::get_relation_between_contacts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。