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


PHP userpro_profile_data函数代码示例

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


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

示例1: userpro_get_avatar

function userpro_get_avatar($avatar, $id_or_email, $size, $default, $alt = '')
{
    global $userpro;
    if (isset($id_or_email->user_id)) {
        $id_or_email = $id_or_email->user_id;
    } elseif (is_email($id_or_email)) {
        $user = get_user_by('email', $id_or_email);
        $id_or_email = $user->ID;
    }
    if ($id_or_email && userpro_profile_data('profilepicture', $id_or_email)) {
        $url = $userpro->file_uri(userpro_profile_data('profilepicture', $id_or_email));
        $crop = userpro_url . "lib/timthumb.php?src=" . $url . "&w={$size}&h={$size}&a=t&q=100";
        $return = '<img src="' . $crop . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="modified avatar" />';
    } else {
        if ($id_or_email && userpro_profile_data('gender', $id_or_email)) {
            $gender = strtolower(userpro_profile_data('gender', $id_or_email));
        } else {
            $gender = 'male';
            // default gender
        }
        $userpro_default = userpro_url . 'img/default_avatar_' . $gender . '.jpg';
        $return = '<img src="' . $userpro_default . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="default avatar" />';
    }
    if (userpro_profile_data('profilepicture', $id_or_email) != '') {
        return $return;
    } else {
        if (userpro_get_option('use_default_avatars') == 1) {
            return $avatar;
        } else {
            return $return;
        }
    }
}
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:33,代码来源:hooks-filters.php

示例2: userpro_get_avatar

function userpro_get_avatar($avatar, $id_or_email, $size, $default, $alt = '')
{
    global $userpro;
    require_once userpro_path . 'lib/BFI_Thumb.php';
    if (isset($id_or_email->user_id)) {
        $id_or_email = $id_or_email->user_id;
    } elseif (is_email($id_or_email)) {
        $user = get_user_by('email', $id_or_email);
        $id_or_email = $user->ID;
    }
    if ($id_or_email && userpro_profile_data('profilepicture', $id_or_email)) {
        $url = $userpro->file_uri(userpro_profile_data('profilepicture', $id_or_email), $id_or_email);
        $params = array('width' => $size, 'height' => $size, 'quality' => 100);
        $crop = bfi_thumb(get_site_url() . (strpos($url, "http") !== false ? urlencode($url) : $url), $params);
        $return = '<img src="' . $crop . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="modified avatar" />';
    } else {
        if ($id_or_email && userpro_profile_data('gender', $id_or_email)) {
            $gender = strtolower(userpro_profile_data('gender', $id_or_email));
        } else {
            $gender = 'male';
            // default gender
        }
        $userpro_default = userpro_url . 'img/default_avatar_' . $gender . '.jpg';
        $return = '<img src="' . $userpro_default . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="default avatar" />';
    }
    if (userpro_profile_data('profilepicture', $id_or_email) != '') {
        return $return;
    } else {
        if (userpro_get_option('use_default_avatars') == 1) {
            return $avatar;
        } else {
            return $return;
        }
    }
}
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:35,代码来源:hooks-filters.php

示例3: userpro_admin_users_badges

function userpro_admin_users_badges($value, $column_name, $user_id)
{
    global $userpro;
    $user = get_userdata($user_id);
    if (userpro_get_option('backend_users_change')) {
        if ('userpro_username' == $column_name) {
            $res = '<div class="upadmin-avatar">' . get_avatar($user_id, 40) . '</div>';
            $res .= '<strong><a href="' . $userpro->permalink($user_id) . '" target="_blank" title="' . __('View Profile', 'userpro') . '">' . $user->user_login . '</a></strong><br />';
            $res .= '<span class="upadmin-small-name">(' . userpro_profile_data('display_name', $user_id) . ')</span>';
            $res .= '<div class="row-actions"><span class="edit"><a href="' . $userpro->permalink($user_id, 'edit') . '" target="_blank">' . __('Edit Profile', 'userpro') . '</a></span></div>';
            return $res;
        }
    }
    if ('userpro_admin_badges' == $column_name) {
        $res = userpro_show_badges($user_id, true);
        return $res;
    }
    if ('userpro_verify' == $column_name) {
        $res = '<div class="upadmin-verify-v2">';
        if ($userpro->get_verified_status($user_id) == 0) {
            $res .= '<a href="#" class="button upadmin-verify-u" data-user="' . $user_id . '">' . userpro_get_badge('unverified') . '</a>';
        } else {
            if (userpro_is_admin($user_id)) {
                $res .= '<a href="#" class="button button-primary upadmin-unverify-u" data-user="' . $user_id . '">' . userpro_get_badge('verified') . '</a>';
            } else {
                $res .= '<a href="#" class="button button-primary upadmin-unverify-u" data-user="' . $user_id . '">' . userpro_get_badge('verified') . '</a>';
            }
        }
        if ($userpro->get_verified_status($user_id) == 0) {
            if ($userpro->invited_to_verify($user_id)) {
                $res .= '&nbsp;&nbsp;' . __('Invitation sent!', 'userpro');
            } else {
                $res .= '<a href="#" class="button upadmin-invite-u" data-user="' . $user_id . '">' . __('Verified Invite', 'userpro') . '</a>';
            }
        }
        $res .= '</div>';
        return $res;
    }
    if ('block_users' == $column_name) {
        $res = '<div class="upadmin-block-v2">';
        if ($userpro->get_account_status($user_id) == 0) {
            $res .= '<a href="#" class="button upadmin-block-u" data-user="' . $user_id . '">' . userpro_get_badge('unblocked') . '</a>';
        } else {
            if (userpro_is_admin($user_id)) {
                $res .= '<a href="#" class="button upadmin-unblock-u" data-user="' . $user_id . '">' . userpro_get_badge('blocked') . '</a>';
            } else {
                $res .= '<a href="#" class="button upadmin-unblock-u" data-user="' . $user_id . '">' . userpro_get_badge('blocked') . '</a>';
            }
        }
        if ($userpro->get_account_status($user_id) == 1) {
            $res .= '<span class="button" data-user="' . $user_id . '">' . __('Account Blocked', 'userpro') . '</span>';
        }
        $res .= '</div>';
        $res .= '</div>';
        return $res;
    }
    return $value;
}
开发者ID:Darciro,项目名称:PPM,代码行数:58,代码来源:admin-users.php

示例4: delete_file

 function delete_file($user_id, $key)
 {
     if (userpro_profile_data($key, $user_id)) {
         $file = $this->get_uploads_dir($user_id) . basename(userpro_profile_data($key, $user_id));
         if (file_exists($file)) {
             unlink($file);
         }
     }
 }
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:9,代码来源:api.php

示例5: map_url

 function map_url($url, $user)
 {
     $array = array('{username}' => $user->user_login);
     foreach (get_option('userpro_fields') as $key => $arr) {
         $array['{' . $key . '}'] = $this->filter(userpro_profile_data($key, $user->ID));
     }
     $search = array_keys($array);
     $replace = array_values($array);
     $url = str_replace($search, $replace, $url);
     return $url;
 }
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:11,代码来源:api.php

示例6: userpro_unverify_verified_account

function userpro_unverify_verified_account($form, $user_id)
{
    global $userpro;
    // validate display name change
    if (!userpro_is_admin($user_id) && userpro_get_option('unverify_on_namechange') && $userpro->get_verified_status($user_id) == 1 && !current_user_can('manage_options')) {
        if (isset($form['display_name'])) {
            $old_displayname = userpro_profile_data('display_name', $user_id);
            $new_displayname = $form['display_name'];
            if ($new_displayname != $old_displayname) {
                $userpro->unverify($user_id);
            }
        }
    }
}
开发者ID:httvncoder,项目名称:151722441,代码行数:14,代码来源:fields-hooks.php

示例7: userpro_profile_icons

function userpro_profile_icons($args, $user_id, $wrapper = null)
{
    global $userpro;
    $res = null;
    foreach (userpro_fields_group_by_template('social', $args["social_group"]) as $key => $array) {
        $icon = $userpro->field_icon($key);
        if (userpro_profile_data($key, $user_id) && userpro_field_is_viewable($key, $user_id, $args) && $icon) {
            $res .= '<a href="' . userpro_link_filter(userpro_profile_data($key, $user_id), $key) . '" class="userpro-profile-icon userpro-tip" title="' . $array['label'] . '" target="' . $args['social_target'] . '" ><i class="userpro-icon-' . $icon . '"></i></a>';
        }
    }
    if ($res) {
        if ($wrapper) {
            echo '<div class="' . $wrapper . '">';
        }
        echo $res;
        if ($wrapper) {
            echo '</div>';
        }
    }
}
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:20,代码来源:icons-functions.php

示例8: userpro_rd_custom_register_redirection

function userpro_rd_custom_register_redirection($arg)
{
    $user_id = get_current_user_id();
    $user = get_userdata($user_id);
    $rules = get_option('userpro_redirects_register');
    if (is_array($rules)) {
        $rules = array_reverse($rules);
        foreach ($rules as $k => $rule) {
            /* Check user */
            if ($rule['user'] != '' || $rule['user'] == 'all') {
                if ($user_id == $rule['user'] || $rule['user'] == 'all') {
                    $arg = $rule['url'];
                    return $arg;
                    exit;
                }
            }
            /* Check user */
            if ($rule['field'] != '') {
                $test = userpro_profile_data($rule['field'], $user_id);
                if ($test == $rule['field_value']) {
                    $arg = $rule['url'];
                    return $arg;
                    exit;
                }
            }
            /* Check role */
            if ($rule['role'] != '') {
                $user_roles = $user->roles;
                $user_role = array_shift($user_roles);
                if ($user_role == $rule['role']) {
                    $arg = $rule['url'];
                    return $arg;
                    exit;
                }
            }
        }
    }
    return $arg;
}
开发者ID:Darciro,项目名称:PPM,代码行数:39,代码来源:filters.php

示例9: userpro_bp_get_displayed_user_mentionname

function userpro_bp_get_displayed_user_mentionname()
{
    $user_id = bp_displayed_user_id();
    return userpro_profile_data('display_name', $user_id);
}
开发者ID:Darciro,项目名称:PPM,代码行数:5,代码来源:buddypress.php

示例10: extract_profile_for_mail

 function extract_profile_for_mail($user_id, $form)
 {
     $output = '';
     foreach ($form as $k => $v) {
         if ($this->field_label($k) != '' && !strstr($k, 'pass')) {
             $val = userpro_profile_data($k, $user_id);
             if ($k == 'gender') {
                 $val = userpro_profile_data_nicename($k, userpro_profile_data($k, $user_id));
             }
             if (is_array($val)) {
                 $val = implode(', ', $val);
             }
             $output .= $this->field_label($k) . ': ' . $val . "\r\n";
         }
     }
     return $output;
 }
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:17,代码来源:api.php

示例11: field_value

 function field_value($field, $user_id)
 {
     $value = userpro_profile_data_nicename($field, userpro_profile_data($field, $user_id));
     return $value;
 }
开发者ID:Darciro,项目名称:PPM,代码行数:5,代码来源:api.php

示例12: userpro_update_user_profile

function userpro_update_user_profile($user_id, $form, $action = null)
{
    global $userpro;
    extract($form);
    if ($action == 'new_user' && !$userpro->user_exists($user_id)) {
        die;
    }
    if (!$userpro->user_exists($user_id)) {
        die;
    }
    if ($action == 'ajax_save' && $user_id != get_current_user_id() && !current_user_can('manage_options')) {
        die;
    }
    if (!$template) {
        die;
    }
    /* hooks before saving profile fields */
    do_action('userpro_pre_profile_update', $form, $user_id);
    $form = apply_filters('userpro_pre_profile_update_filters', $form, $user_id);
    $fields = userpro_fields_group_by_template($template, $group);
    foreach ($form as $key => $form_value) {
        /* hidden from public */
        if (!isset($form["hide_{$key}"])) {
            update_user_meta($user_id, 'hide_' . $key, 0);
        } elseif (isset($form["hide_{$key}"])) {
            update_user_meta($user_id, 'hide_' . $key, 1);
        }
        /* UPDATE PRIMARY META */
        if (isset($key) && in_array($key, array('user_url', 'display_name', 'role', 'user_login', 'user_pass', 'user_pass_confirm', 'user_email'))) {
            /* Save passwords */
            if ($key == 'user_pass') {
                if (!empty($form_value)) {
                    wp_update_user(array('ID' => $user_id, $key => $form_value));
                }
            } else {
                wp_update_user(array('ID' => $user_id, $key => $form_value));
            }
        }
        /* UPDATE USER META TABLE */
        if (isset($key) && !strstr($key, 'pass')) {
            update_user_meta($user_id, $key, $form_value);
        } else {
            delete_user_meta($user_id, $key);
        }
        /* move user pics to his folder */
        if ((isset($fields[$key]['type']) && $fields[$key]['type'] == 'picture' || isset($fields[$key]['type']) && $fields[$key]['type'] == 'file') && isset($form_value) && !empty($form_value)) {
            $userpro->do_uploads_dir($user_id);
            if (file_exists($userpro->get_uploads_dir() . basename(userpro_profile_data($key, $user_id)))) {
                rename($userpro->get_uploads_dir() . basename(userpro_profile_data($key, $user_id)), $userpro->get_uploads_dir($user_id) . basename(userpro_profile_data($key, $user_id)));
                update_user_meta($user_id, $key, $userpro->get_uploads_url($user_id) . basename(userpro_profile_data($key, $user_id)));
            }
        }
        /* MailChimp Integration */
        if (isset($fields[$key]['type']) && $fields[$key]['type'] == 'mailchimp') {
            if ($form[$key] == 'unsubscribed') {
                $userpro->mailchimp_subscribe($user_id, $fields[$key]['list_id']);
            } elseif ($form[$key] == 'subscribed') {
                $userpro->mailchimp_unsubscribe($user_id, $fields[$key]['list_id']);
            }
        }
    }
    /* do action while updating profile (use $form) */
    do_action('userpro_profile_update', $form, $user_id);
    /* after profile update no args */
    do_action('userpro_after_profile_updated');
}
开发者ID:httvncoder,项目名称:151722441,代码行数:66,代码来源:user-functions.php

示例13: _e

<p class="submit">
	<input type="submit" name="find-user-badges" id="find-user-badges" class="button button-primary" value="<?php 
_e('Find User Badges', 'userpro');
?>
"  />
</p>

</form>

<?php 
if (isset($_POST['badge_user']) && $userpro->user_exists($_POST['badge_user'])) {
    $user_id = $_POST['badge_user'];
    $badges = get_user_meta($user_id, '_userpro_badges', true);
    if (isset($badges) && is_array($badges) && !empty($badges)) {
        echo '<h3>' . sprintf(__('%s\'s Given Badges', 'userpro'), userpro_profile_data('display_name', $user_id)) . '</h3>';
        foreach ($badges as $k => $arr) {
            ?>
			
			<div class="userpro-user-badge">
				<img src="<?php 
            echo $arr['badge_url'];
            ?>
" alt="" title="<?php 
            echo $arr['badge_title'];
            ?>
" /> <?php 
            echo $arr['badge_title'];
            ?>
				<a href="#" class="button userpro-delete-badge" data-user="<?php 
            echo $user_id;
开发者ID:httvncoder,项目名称:151722441,代码行数:30,代码来源:user_badges.php

示例14: url

    ?>
.userpro-id-<?php 
    echo $user_id;
    ?>
 div.userpro-centered {
	background-image: url(<?php 
    echo $userpro->correct_space_in_url(userpro_profile_data('custom_profile_bg', $user_id));
    ?>
) !important;
	background-size: cover;
	-webkit-background-origin:border;
	background-repeat: no-repeat;
}

<?php 
    if (userpro_profile_data('custom_profile_color', $user_id) == userpro_get_option('heading_light')) {
        ?>
div.userpro-<?php 
        echo $i;
        ?>
.userpro-id-<?php 
        echo $user_id;
        ?>
 div.userpro-profile-name,
div.userpro-<?php 
        echo $i;
        ?>
.userpro-id-<?php 
        echo $user_id;
        ?>
 div.userpro-profile-name a {
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:31,代码来源:userpro.php

示例15: userpro_show_field

function userpro_show_field($key, $array, $i, $args, $user_id = null)
{
    global $userpro;
    extract($array);
    extract($args);
    $res = null;
    /**
    		include & exclude
    		done by custom shortcode
    		params 
    		start here 
    		**/
    if (isset($args['exclude_fields']) && $args['exclude_fields'] != '') {
        if (in_array($key, explode(',', $args['exclude_fields']))) {
            $res = '';
            return false;
        }
    }
    if (isset($args['exclude_fields_by_name']) && $args['exclude_fields_by_name'] != '') {
        if (in_array($array['label'], explode(',', $args['exclude_fields_by_name']))) {
            $res = '';
            return false;
        }
    }
    if (isset($args['exclude_fields_by_type']) && $args['exclude_fields_by_type'] != '') {
        if (isset($array['type']) && in_array($array['type'], explode(',', $args['exclude_fields_by_type']))) {
            $res = '';
            return false;
        }
    }
    if (isset($args['include_fields']) && $args['include_fields'] != '') {
        if (!in_array($key, explode(',', $args['include_fields']))) {
            $res = '';
            return false;
        }
    }
    if (isset($args['include_fields_by_name']) && $args['include_fields_by_name'] != '') {
        if (!in_array($array['label'], explode(',', $args['include_fields_by_name']))) {
            $res = '';
            return false;
        }
    }
    if (isset($args['include_fields_by_type']) && $args['include_fields_by_type'] != '') {
        if (isset($array['type']) && !in_array($array['type'], explode(',', $args['include_fields_by_type'])) || !isset($array['type'])) {
            $res = '';
            return false;
        }
    }
    /**
    		end here
    		thanks please do not edit 
    		here unless you know what you do
    		**/
    if ($user_id) {
        $value = userpro_profile_data($key, $user_id);
        if (isset($array['type']) && $key != 'role' && in_array($array['type'], array('select', 'multiselect', 'checkbox', 'checkbox-full', 'radio', 'radio-full'))) {
            $value = userpro_profile_data_nicename($key, userpro_profile_data($key, $user_id));
        }
        if (isset($array['html']) && $array['html'] == 0) {
            $value = userpro_profile_nohtml($value);
        }
        if (isset($array['type']) && $array['type'] == 'picture') {
            if ($key == 'profilepicture') {
                $value = get_avatar($user_id, 64);
            } else {
                $crop = userpro_profile_data($key, $user_id);
                if ($crop) {
                    if (isset($array['width'])) {
                        $width = $array['width'];
                        $height = $array['height'];
                    } else {
                        $width = '';
                        $height = '';
                    }
                    $value = '<img src="' . $crop . '" width="' . $width . '" height="' . $height . '" alt="" class="modified" />';
                }
            }
        }
        if (isset($array['type']) && $array['type'] == 'file') {
            $file = userpro_profile_data($key, $user_id);
            if ($file) {
                $value = '<div class="userpro-file-input"><a href="' . $file . '" ' . userpro_file_type_icon($file) . '>' . basename($file) . '</a></div>';
            }
        }
    }
    /* display a section */
    if ($allow_sections && isset($array['heading'])) {
        $res .= "<div class='userpro-section userpro-column userpro-collapsible-" . $array['collapsible'] . " userpro-collapsed-" . $array['collapsed'] . "'>" . $array['heading'] . "</div>";
    }
    /* display a field */
    if (!$user_id) {
        $user_id = 0;
    }
    if (isset($array['type']) && userpro_field_by_role($key, $user_id) && !empty($value) && userpro_field_is_viewable($key, $user_id, $args) && !in_array($key, $userpro->fields_to_hide_from_view()) && $array['type'] != 'mailchimp' && $array['type'] != 'followers') {
        $res .= "<div class='userpro-field userpro-field-" . $key . " " . userpro_private_field_class($array) . " userpro-field-{$template}' data-key='{$key}'>";
        if ($array['label'] && $array['type'] != 'passwordstrength') {
            if ($args['field_icons'] == 1) {
                $res .= "<div class='userpro-label view iconed'>";
            } else {
                $res .= "<div class='userpro-label view'>";
//.........这里部分代码省略.........
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:101,代码来源:fields-functions.php


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