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


PHP SocialManager::getUserOnlineLink方法代码示例

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


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

示例1: display_individual_user

 /**
  * Displays the information of an individual user
  * @param int $user_id
  */
 public static function display_individual_user($user_id, $returnContent = false)
 {
     global $interbreadcrumb;
     $safe_user_id = intval($user_id);
     $curretUserId = api_get_user_id();
     $user_table = Database::get_main_table(TABLE_MAIN_USER);
     $sql = "SELECT * FROM {$user_table} WHERE user_id = " . $safe_user_id;
     $result = Database::query($sql);
     $userInfo = api_get_user_info($user_id);
     $content = null;
     if (Database::num_rows($result) == 1) {
         $user_object = Database::fetch_object($result);
         $alt = $userInfo['complete_name'] . ($curretUserId == $user_id ? ' (' . get_lang('Me') . ')' : '');
         $status = api_get_status_from_code($user_object->status);
         $interbreadcrumb[] = array('url' => SocialManager::getUserOnlineLink(), 'name' => get_lang('UsersOnLineList'));
         if ($returnContent == false) {
             Display::display_header($alt, null, $alt);
         }
         $content = '<div class ="thumbnail">';
         if (strlen(trim($user_object->picture_uri)) > 0) {
             $sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'system');
             $sysdir = $sysdir_array['dir'];
             $webdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'web');
             $webdir = $webdir_array['dir'];
             $fullurl = $webdir . $user_object->picture_uri;
             $system_image_path = $sysdir . $user_object->picture_uri;
             list($width, $height, $type, $attr) = @getimagesize($system_image_path);
             $height += 30;
             $width += 30;
             // get the path,width and height from original picture
             $big_image = $webdir . 'big_' . $user_object->picture_uri;
             $big_image_size = api_getimagesize($big_image);
             $big_image_width = $big_image_size['width'];
             $big_image_height = $big_image_size['height'];
             $url_big_image = $big_image . '?rnd=' . time();
             //echo '<a href="javascript:void()" onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');" >';
             $content .= '<img src="' . $fullurl . '" alt="' . $alt . '" />';
         } else {
             $content .= Display::return_icon('unknown.jpg', get_lang('Unknown'));
         }
         if (!empty($status)) {
             $content .= '<div class="caption">' . $status . '</div>';
         }
         $content .= '</div>';
         if (api_get_setting('show_email_addresses') == 'true') {
             $content .= Display::encrypted_mailto_link($user_object->email, $user_object->email) . '<br />';
         }
         if ($user_object->competences) {
             $content .= Display::page_subheader(get_lang('MyCompetences'));
             $content .= '<p>' . $user_object->competences . '</p>';
         }
         if ($user_object->diplomas) {
             $content .= Display::page_subheader(get_lang('MyDiplomas'));
             $content .= '<p>' . $user_object->diplomas . '</p>';
         }
         if ($user_object->teach) {
             $content .= Display::page_subheader(get_lang('MyTeach'));
             $content .= '<p>' . $user_object->teach . '</p>';
         }
         $content .= SocialManager::display_productions($user_object->user_id);
         if ($user_object->openarea) {
             $content .= Display::page_subheader(get_lang('MyPersonalOpenArea'));
             $content .= '<p>' . $user_object->openarea . '</p>';
         }
     } else {
         if ($returnContent == false) {
             Display::display_header(get_lang('UsersOnLineList'));
         }
         $content .= '<div class="actions-title">';
         $content .= get_lang('UsersOnLineList');
         $content .= '</div>';
     }
     if ($returnContent) {
         return $content;
     } else {
         echo $content;
     }
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:82,代码来源:social.lib.php

示例2: returnNotificationMenu

 /**
  * @return string
  */
 public function returnNotificationMenu()
 {
     $_course = api_get_course_info();
     $course_id = api_get_course_id();
     $user_id = api_get_user_id();
     $html = '';
     if (api_get_setting('showonline', 'world') == 'true' and !$user_id or api_get_setting('showonline', 'users') == 'true' and $user_id or api_get_setting('showonline', 'course') == 'true' and $user_id and $course_id) {
         $number = Online::who_is_online_count(api_get_setting('time_limit_whosonline'));
         $number_online_in_course = 0;
         if (!empty($_course['id'])) {
             $number_online_in_course = Online::who_is_online_in_this_course_count($user_id, api_get_setting('time_limit_whosonline'), $_course['id']);
         }
         // Display the who's online of the platform
         if ($number) {
             if (api_get_setting('showonline', 'world') == 'true' and !$user_id or api_get_setting('showonline', 'users') == 'true' and $user_id) {
                 $html .= '<li><a href="' . SocialManager::getUserOnlineLink() . '" target="_top" title="' . get_lang('UsersOnline') . '" >' . Display::return_icon('user.png', get_lang('UsersOnline'), array(), ICON_SIZE_TINY) . ' ' . $number . '</a></li>';
             }
         }
         // Display the who's online for the course
         if ($number_online_in_course) {
             if (is_array($_course) and api_get_setting('showonline', 'course') == 'true' and isset($_course['sysCode'])) {
                 $html .= '<li><a href="' . SocialManager::getUserOnlineLink($_course['sysCode']) . '" target="_top">' . Display::return_icon('course.png', get_lang('UsersOnline') . ' ' . get_lang('InThisCourse'), array(), ICON_SIZE_TINY) . ' ' . $number_online_in_course . ' </a></li>';
             }
         }
         // Display the who's online for the session
         if (api_get_setting('showonline', 'session') == 'true') {
             if (isset($user_id) && api_get_session_id() != 0) {
                 if (api_is_allowed_to_edit()) {
                     $html .= '<li><a href="' . SocialManager::getUserOnlineLink(null, api_get_session_id()) . '&id_coach=' . $user_id . '" >' . Display::return_icon('session.png', get_lang('UsersConnectedToMySessions'), array(), ICON_SIZE_TINY) . ' </a></li>';
                 }
             }
         }
     }
     if (api_get_setting('accessibility_font_resize') == 'true') {
         $html .= '<li class="resize_font">';
         $html .= '<span class="decrease_font" title="' . get_lang('DecreaseFontSize') . '">A</span> <span class="reset_font" title="' . get_lang('ResetFontSize') . '">A</span> <span class="increase_font" title="' . get_lang('IncreaseFontSize') . '">A</span>';
         $html .= '</li>';
     }
     return $html;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:43,代码来源:template.lib.php


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