• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP um_profile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中um_profile函数的典型用法代码示例。如果您正苦于以下问题:PHP um_profile函数的具体用法?PHP um_profile怎么用?PHP um_profile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: um_get_avatar

function um_get_avatar($avatar = '', $id_or_email = '', $size = '96', $avatar_class = '', $default = '', $alt = '')
{
    if (is_numeric($id_or_email)) {
        $user_id = (int) $id_or_email;
    } elseif (is_string($id_or_email) && ($user = get_user_by('email', $id_or_email))) {
        $user_id = $user->ID;
    } elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) {
        $user_id = (int) $id_or_email->user_id;
    }
    if (empty($user_id)) {
        return $avatar;
    }
    um_fetch_user($user_id);
    $avatar = um_user('profile_photo', $size);
    if (!um_profile('profile_photo') && um_get_option('use_gravatars')) {
        if (is_ssl()) {
            $protocol = 'https://';
        } else {
            $protocol = 'http://';
        }
        $default = get_option('avatar_default', 'mystery');
        if ($default == 'gravatar_default') {
            $default = '';
        }
        $rating = get_option('avatar_rating');
        if (!empty($rating)) {
            $rating = "&r={$rating}";
        }
        $avatar = '<img src="' . $protocol . 'gravatar.com/avatar/' . md5(um_user('user_email')) . '?d=' . $default . '&amp;s=' . $size . $rating . '" class="gravatar avatar avatar-' . $size . ' um-avatar" width="' . $size . '" height="' . $size . '" alt="" />';
    }
    return $avatar;
}
开发者ID:BurlesonBrad,项目名称:ultimatemember,代码行数:32,代码来源:um-filters-avatars.php


示例2: show_social_urls

    function show_social_urls()
    {
        global $ultimatemember;
        $fields = $ultimatemember->builtin->all_user_fields;
        foreach ($fields as $field => $args) {
            if (isset($args['advanced']) && $args['advanced'] == 'social') {
                $social[$field] = $args;
            }
        }
        foreach ($social as $k => $arr) {
            if (um_profile($k)) {
                ?>
				
				<a href="<?php 
                echo um_filtered_social_link($k, $arr['match']);
                ?>
" style="background: <?php 
                echo $arr['color'];
                ?>
;" target="_blank" class="um-tip-n" title="<?php 
                echo $arr['title'];
                ?>
"><i class="<?php 
                echo $arr['icon'];
                ?>
"></i></a>
				
			<?php 
            }
        }
    }
开发者ID:Ksajikyan,项目名称:poiskuslug,代码行数:31,代码来源:um-fields.php


示例3: um_user

function um_user($data, $attrs = null)
{
    global $ultimatemember;
    switch ($data) {
        default:
            $value = um_profile($data);
            if ($ultimatemember->validation->is_serialized($value)) {
                $value = unserialize($value);
            }
            if ($data == 'role') {
                return strtolower($value);
            }
            return $value;
            break;
        case 'full_name':
            if (um_user('first_name') && um_user('last_name')) {
                $full_name = um_user('first_name') . ' ' . um_user('last_name');
            } else {
                $full_name = um_user('display_name');
            }
            $full_name = $ultimatemember->validation->safe_name_in_url($full_name);
            // update full_name changed
            if (um_profile($data) !== $full_name) {
                update_user_meta(um_user('ID'), 'full_name', $full_name);
            }
            return $full_name;
            break;
        case 'display_name':
            $op = um_get_option('display_name');
            $name = '';
            if ($op == 'default') {
                $name = um_profile('display_name');
            }
            if ($op == 'nickname') {
                $name = um_profile('nickname');
            }
            if ($op == 'full_name') {
                if (um_user('first_name') && um_user('last_name')) {
                    $name = um_user('first_name') . ' ' . um_user('last_name');
                } else {
                    $name = um_profile($data);
                }
                if (!$name) {
                    $name = um_user('user_login');
                }
            }
            if ($op == 'sur_name') {
                if (um_user('first_name') && um_user('last_name')) {
                    $name = um_user('last_name') . ' ' . um_user('first_name');
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'first_name') {
                if (um_user('first_name')) {
                    $name = um_user('first_name');
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'username') {
                $name = um_user('user_login');
            }
            if ($op == 'initial_name') {
                if (um_user('first_name') && um_user('last_name')) {
                    $initial = um_user('last_name');
                    $name = um_user('first_name') . ' ' . $initial[0];
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'initial_name_f') {
                if (um_user('first_name') && um_user('last_name')) {
                    $initial = um_user('first_name');
                    $name = $initial[0] . ' ' . um_user('last_name');
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'field' && um_get_option('display_name_field') != '') {
                $fields = array_filter(preg_split('/[,\\s]+/', um_get_option('display_name_field')));
                $name = '';
                foreach ($fields as $field) {
                    $name .= um_profile($field) . ' ';
                }
            }
            return apply_filters('um_user_display_name_filter', $name, um_user('ID'), $attrs == 'html' ? 1 : 0);
            break;
        case 'role_select':
        case 'role_radio':
            return $ultimatemember->user->get_role_name(um_user('role'));
            break;
        case 'submitted':
            $array = um_profile($data);
            if (empty($array)) {
                return '';
            }
            $array = unserialize($array);
            return $array;
            break;
//.........这里部分代码省略.........
开发者ID:lytranuit,项目名称:wordpress,代码行数:101,代码来源:um-short-functions.php


示例4: um_user

function um_user($data, $attrs = null)
{
    global $ultimatemember;
    switch ($data) {
        default:
            $value = um_profile($data);
            if ($ultimatemember->validation->is_serialized($value)) {
                $value = unserialize($value);
            }
            return $value;
            break;
        case 'full_name':
            if (!um_profile($data)) {
                if (um_user('first_name') && um_user('last_name')) {
                    $full_name = um_user('first_name') . '.' . um_user('last_name');
                } else {
                    $full_name = um_user('display_name');
                }
                $full_name = $ultimatemember->validation->safe_name_in_url($full_name);
                update_user_meta(um_user('ID'), 'full_name', $full_name);
                return $full_name;
            } else {
                return um_profile($data);
            }
            break;
        case 'display_name':
            $op = um_get_option('display_name');
            if ($op == 'full_name') {
                if (um_user('first_name') && um_user('last_name')) {
                    $name = um_user('first_name') . ' ' . um_user('last_name');
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'sur_name') {
                if (um_user('first_name') && um_user('last_name')) {
                    $name = um_user('last_name') . ', ' . um_user('first_name');
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'first_name') {
                if (um_user('first_name')) {
                    $name = um_user('first_name');
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'username') {
                $name = um_user('user_login');
            }
            if ($op == 'initial_name') {
                if (um_user('first_name') && um_user('last_name')) {
                    $initial = um_user('last_name');
                    $name = um_user('first_name') . ' ' . $initial[0];
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'initial_name_f') {
                if (um_user('first_name') && um_user('last_name')) {
                    $initial = um_user('first_name');
                    $name = $initial[0] . ' ' . um_user('last_name');
                } else {
                    $name = um_profile($data);
                }
            }
            if ($op == 'public_name') {
                $name = um_profile($data);
            }
            if ($op == 'field' && um_get_option('display_name_field') != '') {
                $fields = array_filter(preg_split('/[,\\s]+/', um_get_option('display_name_field')));
                $name = '';
                foreach ($fields as $field) {
                    $name .= um_profile($field) . ' ';
                }
            }
            return apply_filters('um_user_display_name_filter', $name, um_user('ID'), $attrs == 'html' ? 1 : 0);
            break;
        case 'role_select':
        case 'role_radio':
            return $ultimatemember->user->get_role_name(um_user('role'));
            break;
        case 'submitted':
            $array = um_profile($data);
            if (empty($array)) {
                return '';
            }
            $array = unserialize($array);
            return $array;
            break;
        case 'password_reset_link':
            return $ultimatemember->password->reset_url();
            break;
        case 'account_activation_link':
            return $ultimatemember->permalinks->activate_url();
            break;
        case 'profile_photo':
            if (um_profile('profile_photo')) {
                $avatar_uri = um_get_avatar_uri(um_profile('profile_photo'), $attrs);
//.........这里部分代码省略.........
开发者ID:blogfor,项目名称:king,代码行数:101,代码来源:um-short-functions.php


示例5: um_profile_header

function um_profile_header($args)
{
    global $ultimatemember;
    $classes = null;
    if (!$args['cover_enabled']) {
        $classes .= ' no-cover';
    }
    $default_size = str_replace('px', '', $args['photosize']);
    $overlay = '<span class="um-profile-photo-overlay">
			<span class="um-profile-photo-overlay-s">
				<ins>
					<i class="um-faicon-camera"></i>
				</ins>
			</span>
		</span>';
    ?>

			<div class="um-header<?php 
    echo $classes;
    ?>
">

				<?php 
    do_action('um_pre_header_editprofile', $args);
    ?>

				<div class="um-profile-photo" data-user_id="<?php 
    echo um_profile_id();
    ?>
">

					<a href="<?php 
    echo um_user_profile_url();
    ?>
" class="um-profile-photo-img" title="<?php 
    echo um_user('display_name');
    ?>
"><?php 
    echo $overlay . get_avatar(um_user('ID'), $default_size);
    ?>
</a>

					<?php 
    if (!isset($ultimatemember->user->cannot_edit)) {
        $ultimatemember->fields->add_hidden_field('profile_photo');
        if (!um_profile('profile_photo')) {
            // has profile photo
            $items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Upload photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
            $items = apply_filters('um_user_photo_menu_view', $items);
            echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
        } else {
            if ($ultimatemember->fields->editing == true) {
                $items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Change photo', 'ultimatemember') . '</a>', '<a href="#" class="um-reset-profile-photo" data-user_id="' . um_profile_id() . '" data-default_src="' . um_get_default_avatar_uri() . '">' . __('Remove photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
                $items = apply_filters('um_user_photo_menu_edit', $items);
                echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
            }
        }
    }
    ?>

				</div>

				<div class="um-profile-meta">

					<div class="um-main-meta">

						<?php 
    if ($args['show_name']) {
        ?>
						<div class="um-name">

							<a href="<?php 
        echo um_user_profile_url();
        ?>
" title="<?php 
        echo um_user('display_name');
        ?>
"><?php 
        echo um_user('display_name', 'html');
        ?>
</a>

							<?php 
        do_action('um_after_profile_name_inline', $args);
        ?>

						</div>
						<?php 
    }
    ?>

						<div class="um-clear"></div>

						<?php 
    do_action('um_after_profile_header_name_args', $args);
    ?>
						<?php 
    do_action('um_after_profile_header_name');
    ?>

//.........这里部分代码省略.........
开发者ID:TeamSubjectMatter,项目名称:juddfoundation,代码行数:101,代码来源:um-actions-profile.php


示例6: get_auser

 /**
  * Process Get user API Request
  */
 public function get_auser($args)
 {
     global $ultimatemember;
     extract($args);
     $response = array();
     $error = array();
     if (!isset($id)) {
         $error['error'] = __('You must provide a user ID', 'ultimatemember');
         return $error;
     }
     $user = get_userdata($id);
     if (!$user) {
         $error['error'] = __('Invalid user specified', 'ultimatemember');
         return $error;
     }
     unset($user->data->user_status);
     unset($user->data->user_activation_key);
     unset($user->data->user_pass);
     um_fetch_user($user->ID);
     if (isset($fields) && $fields) {
         $fields = explode(',', $fields);
         $response['ID'] = $user->ID;
         $response['username'] = $user->user_login;
         foreach ($fields as $field) {
             switch ($field) {
                 default:
                     $response[$field] = um_profile($field) ? um_profile($field) : '';
                     break;
                 case 'mycred_points':
                     $response['mycred_points'] = number_format((int) get_user_meta($user->ID, 'mycred_default', true), 2);
                     break;
                 case 'cover_photo':
                     $response['cover_photo'] = $this->getsrc(um_user('cover_photo', 1000));
                     break;
                 case 'profile_pic':
                     $response['profile_pic_original'] = $this->getsrc(um_user('profile_photo', 'original'));
                     $response['profile_pic_normal'] = $this->getsrc(um_user('profile_photo', 200));
                     $response['profile_pic_small'] = $this->getsrc(um_user('profile_photo', 40));
                     break;
                 case 'status':
                     $response['status'] = um_user('account_status');
                     break;
                 case 'role':
                     $response['role'] = um_user('role');
                     break;
                 case 'email':
                 case 'user_email':
                     $response['email'] = um_user('user_email');
                     break;
                 case 'followers':
                     if (class_exists('UM_Followers_API')) {
                         global $um_followers;
                         $response['followers_count'] = $um_followers->api->count_followers_plain($user->ID);
                         $response['following_count'] = $um_followers->api->count_following_plain($user->ID);
                     }
                     break;
             }
         }
     } else {
         foreach ($user as $key => $val) {
             if ($key != 'data') {
                 continue;
             }
             if ($key == 'data') {
                 $key = 'profile';
                 $val->roles = $user->roles;
                 $val->first_name = um_user('first_name');
                 $val->last_name = um_user('last_name');
                 $val->community_role = um_user('role');
                 $val->account_status = um_user('account_status');
                 $val->profile_pic_original = $this->getsrc(um_user('profile_photo', 'original'));
                 $val->profile_pic_normal = $this->getsrc(um_user('profile_photo', 200));
                 $val->profile_pic_small = $this->getsrc(um_user('profile_photo', 40));
                 $val->cover_photo = $this->getsrc(um_user('cover_photo', 1000));
                 if (class_exists('UM_Followers_API')) {
                     global $um_followers;
                     $val->followers_count = $um_followers->api->count_followers_plain($user->ID);
                     $val->following_count = $um_followers->api->count_following_plain($user->ID);
                 }
             }
             $response = $val;
         }
     }
     return $response;
 }
开发者ID:Makenrro,项目名称:repos,代码行数:88,代码来源:um-api.php


示例7: um_submit_form_errors_hook_

function um_submit_form_errors_hook_($args)
{
    global $ultimatemember;
    $form_id = $args['form_id'];
    $mode = $args['mode'];
    $fields = unserialize($args['custom_fields']);
    $um_profile_photo = um_profile('profile_photo');
    if (get_post_meta($form_id, '_um_profile_photo_required', true) && (empty($args['profile_photo']) && empty($um_profile_photo))) {
        $ultimatemember->form->add_error('profile_photo', sprintf(__('%s is required.', 'ultimatemember'), 'Profile Photo'));
    }
    if (isset($fields) && !empty($fields)) {
        foreach ($fields as $key => $array) {
            $array = apply_filters('um_get_custom_field_array', $array, $fields);
            if (isset($array['type']) && $array['type'] == 'checkbox' && isset($array['required']) && $array['required'] == 1 && !isset($args[$key])) {
                $ultimatemember->form->add_error($key, sprintf(__('%s is required.', 'ultimatemember'), $array['title']));
            }
            if (defined('um_user_tags_path') && isset($array['type']) && $array['type'] == 'user_tags' && isset($array['required']) && $array['required'] == 1 && !isset($args[$key])) {
                $ultimatemember->form->add_error($key, sprintf(__('%s is required.', 'ultimatemember'), $array['title']));
            }
            if (isset($array['type']) && $array['type'] == 'radio' && isset($array['required']) && $array['required'] == 1 && !isset($args[$key]) && !in_array($key, array('role_radio', 'role_select'))) {
                $ultimatemember->form->add_error($key, sprintf(__('%s is required.', 'ultimatemember'), $array['title']));
            }
            if (isset($array['type']) && $array['type'] == 'multiselect' && isset($array['required']) && $array['required'] == 1 && !isset($args[$key]) && !in_array($key, array('role_radio', 'role_select'))) {
                $ultimatemember->form->add_error($key, sprintf(__('%s is required.', 'ultimatemember'), $array['title']));
            }
            if ($key == 'role_select' || $key == 'role_radio') {
                if (isset($array['required']) && $array['required'] == 1 && (!isset($args['role']) || empty($args['role']))) {
                    $ultimatemember->form->add_error('role', __('Please specify account type.', 'ultimatemember'));
                }
            }
            if (isset($args[$key])) {
                if (isset($array['required']) && $array['required'] == 1) {
                    if (!isset($args[$key]) || $args[$key] == '') {
                        $ultimatemember->form->add_error($key, sprintf(__('%s is required', 'ultimatemember'), $array['label']));
                    }
                }
                if (isset($array['max_words']) && $array['max_words'] > 0) {
                    if (str_word_count($args[$key]) > $array['max_words']) {
                        $ultimatemember->form->add_error($key, sprintf(__('You are only allowed to enter a maximum of %s words', 'ultimatemember'), $array['max_words']));
                    }
                }
                if (isset($array['min_chars']) && $array['min_chars'] > 0) {
                    if ($args[$key] && strlen(utf8_decode($args[$key])) < $array['min_chars']) {
                        $ultimatemember->form->add_error($key, sprintf(__('Your %s must contain at least %s characters', 'ultimatemember'), $array['label'], $array['min_chars']));
                    }
                }
                if (isset($array['max_chars']) && $array['max_chars'] > 0) {
                    if ($args[$key] && strlen(utf8_decode($args[$key])) > $array['max_chars']) {
                        $ultimatemember->form->add_error($key, sprintf(__('Your %s must contain less than %s characters', 'ultimatemember'), $array['label'], $array['max_chars']));
                    }
                }
                $profile_show_html_bio = um_get_option('profile_show_html_bio');
                if ($profile_show_html_bio == 1 && $key !== "description") {
                    if (isset($array['html']) && $array['html'] == 0) {
                        if (wp_strip_all_tags($args[$key]) != trim($args[$key])) {
                            $ultimatemember->form->add_error($key, __('You can not use HTML tags here', 'ultimatemember'));
                        }
                    }
                }
                if (isset($array['force_good_pass']) && $array['force_good_pass'] == 1) {
                    if (!$ultimatemember->validation->strong_pass($args[$key])) {
                        $ultimatemember->form->add_error($key, __('Your password must contain at least one lowercase letter, one capital letter and one number', 'ultimatemember'));
                    }
                }
                if (isset($array['force_confirm_pass']) && $array['force_confirm_pass'] == 1) {
                    if ($args['confirm_' . $key] == '' && !$ultimatemember->form->has_error($key)) {
                        $ultimatemember->form->add_error('confirm_' . $key, __('Please confirm your password', 'ultimatemember'));
                    }
                    if ($args['confirm_' . $key] != $args[$key] && !$ultimatemember->form->has_error($key)) {
                        $ultimatemember->form->add_error('confirm_' . $key, __('Your passwords do not match', 'ultimatemember'));
                    }
                }
                if (isset($array['min_selections']) && $array['min_selections'] > 0) {
                    if (!isset($args[$key]) || isset($args[$key]) && is_array($args[$key]) && count($args[$key]) < $array['min_selections']) {
                        $ultimatemember->form->add_error($key, sprintf(__('Please select at least %s choices', 'ultimatemember'), $array['min_selections']));
                    }
                }
                if (isset($array['max_selections']) && $array['max_selections'] > 0) {
                    if (isset($args[$key]) && is_array($args[$key]) && count($args[$key]) > $array['max_selections']) {
                        $ultimatemember->form->add_error($key, sprintf(__('You can only select up to %s choices', 'ultimatemember'), $array['max_selections']));
                    }
                }
                if (isset($array['validate']) && !empty($array['validate'])) {
                    switch ($array['validate']) {
                        case 'custom':
                            $custom = $array['custom_validate'];
                            do_action("um_custom_field_validation_{$custom}", $key, $array, $args);
                            break;
                        case 'numeric':
                            if ($args[$key] && !is_numeric($args[$key])) {
                                $ultimatemember->form->add_error($key, __('Please enter numbers only in this field', 'ultimatemember'));
                            }
                            break;
                        case 'phone_number':
                            if (!$ultimatemember->validation->is_phone_number($args[$key])) {
                                $ultimatemember->form->add_error($key, __('Please enter a valid phone number', 'ultimatemember'));
                            }
                            break;
                        case 'youtube_url':
                            if (!$ultimatemember->validation->is_url($args[$key], 'youtube.com')) {
//.........这里部分代码省略.........
开发者ID:TeamSubjectMatter,项目名称:juddfoundation,代码行数:101,代码来源:um-actions-form.php


示例8: um_profile_header

function um_profile_header($args)
{
    global $ultimatemember;
    $classes = null;
    if (!$args['cover_enabled']) {
        $classes .= ' no-cover';
    }
    $default_size = str_replace('px', '', $args['photosize']);
    $overlay = '<span class="um-profile-photo-overlay">
			<span class="um-profile-photo-overlay-s">
				<ins>
					<i class="um-faicon-camera"></i>
				</ins>
			</span>
		</span>';
    ?>
		
			<div class="um-header<?php 
    echo $classes;
    ?>
">
			
				<?php 
    do_action('um_pre_header_editprofile', $args);
    ?>
				
				<div class="um-profile-photo" data-user_id="<?php 
    echo um_profile_id();
    ?>
">

					<a href="<?php 
    echo um_user_profile_url();
    ?>
" class="um-profile-photo-img" title="<?php 
    echo um_user('display_name');
    ?>
"><?php 
    echo $overlay . get_avatar(um_user('ID'), $default_size);
    ?>
</a>
					
					<?php 
    if (!isset($ultimatemember->user->cannot_edit)) {
        $ultimatemember->fields->add_hidden_field('profile_photo');
        if (!um_profile('profile_photo')) {
            // has profile photo
            $items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Загрузить фото', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Отменить', 'ultimatemember') . '</a>');
            echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
        } else {
            if ($ultimatemember->fields->editing == true) {
                $items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Изменить фотографию', 'ultimatemember') . '</a>', '<a href="#" class="um-reset-profile-photo" data-user_id="' . um_profile_id() . '" data-default_src="' . um_get_default_avatar_uri() . '">' . __('Удалить фото', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Отменить', 'ultimatemember') . '</a>');
                echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
            }
        }
    }
    ?>
					
				</div>
				
				<div class="um-profile-meta">
				
					<div class="um-main-meta">
					
						<?php 
    if ($args['show_name']) {
        ?>
						<div class="um-name">
							
							<a href="<?php 
        echo um_user_profile_url();
        ?>
" title="<?php 
        echo um_user('display_name');
        ?>
"><?php 
        echo um_user('display_name', 'html');
        ?>
</a>
							
							<?php 
        do_action('um_after_profile_name_inline', $args);
        ?>
						
						</div>
						<?php 
    }
    ?>
						
						<div class="um-clear"></div>
						
						<?php 
    do_action('um_after_profile_header_name_args', $args);
    ?>
						<?php 
    do_action('um_after_profile_header_name');
    ?>
						
					</div>
					
//.........这里部分代码省略.........
开发者ID:Ksajikyan,项目名称:poiskuslug,代码行数:101,代码来源:um-actions-profile.php


示例9: custom_um_profile_header

function custom_um_profile_header($args)
{
    global $ultimatemember;
    $user_id = get_current_user_id();
    $userrole = get_user_meta($user_id, 'role', true);
    $classes = null;
    if (!$args['cover_enabled']) {
        $classes .= ' no-cover';
    }
    $default_size = str_replace('px', '', $args['photosize']);
    $overlay = '<span class="um-profile-photo-overlay">
      <span class="um-profile-photo-overlay-s">
        <ins>
          <i class="um-faicon-camera"></i>
        </ins>
      </span>
    </span>';
    ?>
	<div class="um-header<?php 
    echo $classes;
    ?>
">

		<?php 
    do_action('um_pre_header_editprofile', $args);
    ?>

		<div class="um-profile-photo" data-user_id="<?php 
    echo um_profile_id();
    ?>
">

			<a href="<?php 
    echo um_user_profile_url();
    ?>
" class="um-profile-photo-img" title="<?php 
    echo um_user('display_name');
    ?>
"><?php 
    echo $overlay . get_avatar(um_user('ID'), $default_size);
    ?>
</a>


			<?php 
    if (!isset($ultimatemember->user->cannot_edit)) {
        $ultimatemember->fields->add_hidden_field('profile_photo');
        if (!um_profile('profile_photo')) {
            // has profile photo
            $items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Upload photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
            echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
        } else {
            if ($ultimatemember->fields->editing == true) {
                $items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Change photo', 'ultimatemember') . '</a>', '<a href="#" class="um-reset-profile-photo" data-user_id="' . um_profile_id() . '" data-default_src="' . um_get_default_avatar_uri() . '">' . __('Remove photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
                echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
            }
        }
    }
    ?>

		</div>

		<div class="um-profile-meta">

			<div class="um-main-meta">

				<?php 
    if ($args['show_name']) {
        ?>
					<div class="um-name">

						<a href="<?php 
        echo um_user_profile_url();
        ?>
" title="<?php 
        echo um_user('display_name');
        ?>
"><?php 
        echo um_user('display_name');
        ?>
</a>

						<?php 
        do_action('um_after_profile_name_inline', $args);
        ?>
						<?php 
        if ($ultimatemember->fields->editing == true) {
            ?>
							<?php 
            if ($userrole == 'advisee') {
                ?>
								<a href="javascript:void(0);" class="hb-button" id="um-upgrade">Upgrade to become an Advisor</a>
							<?php 
            }
            ?>
						<?php 
        }
        ?>

					</div>
//.........这里部分代码省略.........
开发者ID:KKRTEAM,项目名称:cis_admq,代码行数:101,代码来源:functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP um_profile_id函数代码示例发布时间:2022-05-23
下一篇:
PHP um_is_temp_upload函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap