本文整理汇总了PHP中UserGroup::get_picture_group方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::get_picture_group方法的具体用法?PHP UserGroup::get_picture_group怎么用?PHP UserGroup::get_picture_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::get_picture_group方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$social_right_content .= '<div class="col-md-12">';
$social_right_content .= Display::page_subheader(get_lang('Groups'));
foreach ($groups as $group) {
$group['name'] = Security::remove_XSS($group['name'], STUDENT, true);
${$group}['description'] = Security::remove_XSS($group['description'], STUDENT, true);
$id = $group['id'];
$url_open = '<a href="groups.php?id=' . $id . '" >';
$url_close = '</a>';
$name = Text::cut($group['name'], 25, true);
$count_users_group = count($usergroup->get_all_users_by_group($id));
if ($count_users_group == 1) {
$count_users_group = $count_users_group . ' ' . get_lang('Member');
} else {
$count_users_group = $count_users_group . ' ' . get_lang('Members');
}
$picture = $usergroup->get_picture_group($group['id'], $group['picture'], 80);
$tags = $usergroup->get_group_tags($group['id']);
$group['picture'] = '<img class="social-groups-image" src="' . $picture['file'] . '" hspace="4" height="50" border="2" align="left" width="50" />';
$item_0 = Display::div($group['picture'], array('class' => 'box_description_group_image'));
$members = Display::span($count_users_group, array('class' => 'box_description_group_member'));
$item_1 = Display::div(Display::tag('h3', $url_open . $name . $url_close) . $members, array('class' => 'box_description_group_title'));
$item_2 = '';
$item_3 = '';
if ($group['description'] != '') {
$item_3 = '<div class="box_description_group_content" >' . Text::cut($group['description'], 100, true) . '</div>';
} else {
$item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2"></span></div>';
$item_3 = '<div class="box_description_group_content" ></div>';
}
$item_4 = '<div class="box_description_group_tags" >' . $tags . '</div>';
$item_5 = '<div class="box_description_group_actions" >' . $url_open . get_lang('SeeMore') . $url_close . '</div>';
示例2: cut
$my_group_list[] = $id;
$url_open = '<a href="group_view.php?id=' . $id . '">';
$url_close = '</a>';
$name = cut($result['name'], GROUP_TITLE_LENGTH, true);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$name .= ' ' . Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style' => 'vertical-align:middle'));
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$name .= ' ' . Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style' => 'vertical-align:middle'));
}
$count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000));
if ($count_users_group == 1) {
$count_users_group = $count_users_group . ' ' . get_lang('Member');
} else {
$count_users_group = $count_users_group . ' ' . get_lang('Members');
}
$picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80);
$result['picture'] = '<img class="social-groups-image" src="' . $picture['file'] . '" />';
$item_0 = Display::div($result['picture'], array('class' => 'box_description_group_image'));
$members = Display::span($count_users_group, array('class' => 'box_description_group_member'));
$item_1 = Display::div(Display::tag('h4', $url_open . $name . $url_close) . $members, array('class' => 'box_description_group_title'));
$item_2 = '';
$item_3 = '';
if ($result['description'] != '') {
$item_3 = '<div class="box_description_group_content" >' . cut($result['description'], 100, true) . '</div>';
} else {
$item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2"></span></div>';
$item_3 = '<div class="box_description_group_content" ></div>';
}
$grid_item_2 = $item_0 . $item_1 . $item_2 . $item_3;
$grid_my_groups[] = array($grid_item_2);
}
示例3: array
<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>';
}
}
if (count($pending_invitations) > 0) {
$social_right_content .= Display::page_subheader(get_lang('GroupsWaitingApproval'));
$new_invitation = array();
foreach ($pending_invitations as $invitation) {
$picture = $usergroup->get_picture_group($invitation['id'], $invitation['picture'], 80);
$img = '<img class="social-groups-image" src="' . $picture['file'] . '" hspace="4" height="50" border="2" align="left" width="50" />';
$invitation['picture'] = '<a href="groups.php?id=' . $invitation['id'] . '">' . $img . '</a>';
$invitation['name'] = '<a href="groups.php?id=' . $invitation['id'] . '">' . Text::cut($invitation['name'], 120, true) . '</a>';
$invitation['join'] = '<a class="btn btn-primary" href="invitations.php?accept=' . $invitation['id'] . '">' . get_lang('AcceptInvitation') . '</a>';
$invitation['deny'] = '<a class="btn btn-danger" href="invitations.php?deny=' . $invitation['id'] . '">' . get_lang('DenyInvitation') . '</a>';
$invitation['description'] = Text::cut($invitation['description'], 220, true);
$new_invitation[] = $invitation;
}
$social_right_content .= Display::return_sortable_grid('waiting_user', array(), $new_invitation, array('hide_navigation' => true, 'per_page' => 100), array(), false, array(true, true, true, false, false, true, true, true, true));
}
$social_right_content = Display::div($social_right_content, array('class' => 'span9'));
$tpl = $app['template'];
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);
$tpl->assign('message', $show_message);
示例4: array
$social_search_block = Display::panel(UserManager::get_search_form(''), get_lang("SearchUsers"));
$results = $userGroup->get_groups_by_age(1, false);
$groups_newest = array();
if (!empty($results)) {
foreach ($results as $result) {
$id = $result['id'];
$result['description'] = Security::remove_XSS($result['description'], STUDENT, true);
$result['name'] = Security::remove_XSS($result['name'], STUDENT, true);
if ($result['count'] == 1) {
$result['count'] = '1 ' . get_lang('Member');
} else {
$result['count'] = $result['count'] . ' ' . get_lang('Members');
}
$group_url = "group_view.php?id={$id}";
$result['name'] = '<div class="group-name">' . Display::url(api_ucwords(cut($result['name'], 40, true)), $group_url) . '</div><div class="count-username">' . Display::return_icon('user.png', '', '', ICON_SIZE_TINY) . $result['count'] . '</div>';
$picture = $userGroup->get_picture_group($id, $result['picture'], 80);
$result['picture'] = '<img class="group-image" src="' . $picture['file'] . '" />';
$group_actions = '<div class="group-more"><a href="groups.php?#tab_browse-2">' . get_lang('SeeMore') . '</a></div>';
$group_info = '<div class="description"><p>' . cut($result['description'], 120, true) . "</p></div>";
$groups_newest[] = array(Display::url($result['picture'], $group_url), $result['name'], $group_info . $group_actions);
}
}
// Top popular
$results = $userGroup->get_groups_by_popularity(1, false);
$groups_pop = array();
foreach ($results as $result) {
$result['description'] = Security::remove_XSS($result['description'], STUDENT, true);
$result['name'] = Security::remove_XSS($result['name'], STUDENT, true);
$id = $result['id'];
$group_url = "group_view.php?id={$id}";
if ($result['count'] == 1) {
示例5: show_social_avatar_block
/**
* Shows the avatar block in social pages
*
* @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
*
*/
public static function show_social_avatar_block($show = '', $group_id = 0, $user_id = 0)
{
if (empty($user_id)) {
$user_id = api_get_user_id();
}
$show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups');
$template = Container::getTwig();
if (in_array($show, $show_groups) && !empty($group_id)) {
// Group image
$userGroup = new UserGroup();
$group_info = $userGroup->get($group_id);
$userGroupImage = $userGroup->get_picture_group($group_id, $group_info['picture'], 160, GROUP_IMAGE_SIZE_BIG);
$template->addGlobal('show_group', true);
$template->addGlobal('group_id', $group_id);
$template->addGlobal('user_group_image', $userGroupImage);
$template->addGlobal('user_group', $group_info);
$template->addGlobal('user_is_group_admin', $userGroup->is_group_admin($group_id, api_get_user_id()));
} else {
$template->addGlobal('show_group', false);
$template->addGlobal('show_user', true);
$template->addGlobal('user_image', ['big' => UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_BIG), 'normal' => UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_MEDIUM)]);
}
$content = $template->render('@template_style/social/avatar_block.html.twig');
return $content;
}
示例6: 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') {
//.........这里部分代码省略.........
示例7: show_social_avatar_block
/**
* Shows the avatar block in social pages
*
* @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
*
*/
public static function show_social_avatar_block($show = '', $group_id = 0, $user_id = 0)
{
if (empty($user_id)) {
$user_id = api_get_user_id();
}
$show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups');
$template = new Template(null, false, false, false, false, false);
if (in_array($show, $show_groups) && !empty($group_id)) {
// Group image
$userGroup = new UserGroup();
$group_info = $userGroup->get($group_id);
$userGroupImage = $userGroup->get_picture_group($group_id, $group_info['picture'], 160, GROUP_IMAGE_SIZE_BIG);
$template->assign('show_group', true);
$template->assign('group_id', $group_id);
$template->assign('user_group_image', $userGroupImage);
$template->assign('user_group', $group_info);
$template->assign('user_is_group_admin', $userGroup->is_group_admin($group_id, api_get_user_id()));
} else {
$template->assign('show_user', true);
$template->assign('user_image', ['big' => UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_BIG), 'normal' => UserManager::getUserPicture($user_id, USER_IMAGE_SIZE_MEDIUM)]);
}
$skillBlock = $template->get_template('social/avatar_block.tpl');
return $template->fetch($skillBlock);
}
示例8: foreach
$social_right_content .= '<div class="row">';
$social_right_content .= Display::page_subheader(get_lang('Groups'));
foreach ($groups as $group) {
$group['name'] = Security::remove_XSS($group['name'], STUDENT, true);
$group['description'] = Security::remove_XSS($group['description'], STUDENT, true);
$id = $group['id'];
$url_open = '<a class="btn btn-default" href="group_view.php?id=' . $id . '">';
$url_close = '</a>';
$name = cut($group['name'], 60, true);
$count_users_group = count($usergroup->get_all_users_by_group($id));
if ($count_users_group == 1) {
$count_users_group = $count_users_group . ' ' . get_lang('Member');
} else {
$count_users_group = $count_users_group . ' ' . get_lang('Members');
}
$picture = $usergroup->get_picture_group($group['id'], $group['picture'], GROUP_IMAGE_SIZE_ORIGINAL);
//$tags = $usergroup->get_group_tags($group['id']);
$tags = null;
$group['picture'] = '<img src="' . $picture['file'] . '" />';
$members = Display::span($count_users_group);
$item_1 = Display::tag('h3', $url_open . $name . $url_close) . $members;
$social_right_content .= '
<div class="col-md-4">
<div class="card">
<div class="avatar">
' . $group['picture'] . '
</div>
<div class="content">
' . $item_1 . '
<p>' . $group['description'] . '</p>
<p>' . $tags . '</p>
示例9: cut
$url_open = '<a href="group_view.php?id=' . $id . '">';
$url_close = '</a>';
$icon = '';
$name = cut($result['name'], 20, true);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$icon = Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style' => 'vertical-align:middle;width:16px;height:16px;'));
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$icon = Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style' => 'vertical-align:middle;width:16px;height:16px;'));
}
$count_users_group = count($userGroup->get_all_users_by_group($id));
if ($count_users_group == 1) {
$count_users_group = $count_users_group . ' ' . get_lang('Member');
} else {
$count_users_group = $count_users_group . ' ' . get_lang('Members');
}
$picture = $userGroup->get_picture_group($result['id'], $result['picture_uri'], 80);
$item_name = '<div class="box_shared_profile_group_title">' . $url_open . api_xml_http_response_encode($name) . $icon . $url_close . '</div>';
$item_description = '';
if (!empty($result['description'])) {
$item_description = '<div class="box_shared_profile_group_description">
<span class="social-groups-text2">' . api_xml_http_response_encode(get_lang('Description')) . '</span><p class="social-groups-text4">' . cut(api_xml_http_response_encode($result['description']), 120, true) . '</p></div>';
}
$result['picture_uri'] = '<div class="box_shared_profile_group_image">
<img class="social-groups-image" src="' . $picture['file'] . '" /></div>';
$item_actions = '';
if (api_get_user_id() == $user_id) {
$item_actions = '<div class="box_shared_profile_group_actions"><a href="group_view.php?id=' . $id . '">' . get_lang('SeeMore') . $url_close . '</div>';
}
$grid_my_groups[] = array($item_name, $url_open . $result['picture_uri'] . $url_close, $item_description . $item_actions);
$i++;
}