本文整理汇总了PHP中um_user_uploads_uri函数的典型用法代码示例。如果您正苦于以下问题:PHP um_user_uploads_uri函数的具体用法?PHP um_user_uploads_uri怎么用?PHP um_user_uploads_uri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了um_user_uploads_uri函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_field
//.........这里部分代码省略.........
/* Gap/Space */
case 'spacing':
$output .= '<div class="um-field um-field-spacing' . $classes . '"' . $conditional . ' style="height: ' . $spacing . '"></div>';
break;
/* A line divider */
/* A line divider */
case 'divider':
$output .= '<div class="um-field um-field-divider' . $classes . '"' . $conditional . ' style="border-bottom: ' . $borderwidth . 'px ' . $borderstyle . ' ' . $bordercolor . '">';
if ($divider_text) {
$output .= '<div class="um-field-divider-text"><span>' . $divider_text . '</span></div>';
}
$output .= '</div>';
break;
/* Single Image Upload */
/* Single Image Upload */
case 'image':
$output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="' . $key . '">';
if (in_array($key, array('profile_photo', 'cover_photo'))) {
$field_value = '';
} else {
$field_value = $this->field_value($key, $default, $data);
}
$output .= '<input type="hidden" name="' . $key . $ultimatemember->form->form_suffix . '" id="' . $key . $ultimatemember->form->form_suffix . '" value="' . $field_value . '" />';
if (isset($data['label'])) {
$output .= $this->field_label($label, $key, $data);
}
$modal_label = isset($data['label']) ? $data['label'] : __('Upload Photo', 'ultimatemember');
$output .= '<div class="um-field-area" style="text-align: center">';
if ($this->field_value($key, $default, $data)) {
if (!in_array($key, array('profile_photo', 'cover_photo'))) {
if (isset($this->set_mode) && $this->set_mode == 'register') {
$imgValue = $this->field_value($key, $default, $data);
} else {
$imgValue = um_user_uploads_uri() . $this->field_value($key, $default, $data);
}
$img = '<img src="' . $imgValue . '" alt="" />';
} else {
$img = '';
}
$output .= '<div class="um-single-image-preview show ' . $crop_class . '" data-crop="' . $crop_data . '" data-key="' . $key . '">
<a href="#" class="cancel"><i class="um-icon-close"></i></a>' . $img . '
</div><a href="#" data-modal="um_upload_single" data-modal-size="' . $modal_size . '" data-modal-copy="1" class="um-button um-btn-auto-width">' . __('Change photo', 'ultimatemember') . '</a>';
} else {
$output .= '<div class="um-single-image-preview ' . $crop_class . '" data-crop="' . $crop_data . '" data-key="' . $key . '">
<a href="#" class="cancel"><i class="um-icon-close"></i></a>
<img src="" alt="" />
</div><a href="#" data-modal="um_upload_single" data-modal-size="' . $modal_size . '" data-modal-copy="1" class="um-button um-btn-auto-width">' . $button_text . '</a>';
}
$output .= '</div>';
/* modal hidden */
$output .= '<div class="um-modal-hidden-content">';
$output .= '<div class="um-modal-header"> ' . $modal_label . '</div>';
$output .= '<div class="um-modal-body">';
if (isset($this->set_id)) {
$set_id = $this->set_id;
$set_mode = $this->set_mode;
} else {
$set_id = 0;
$set_mode = '';
}
$output .= '<div class="um-single-image-preview ' . $crop_class . '" data-crop="' . $crop_data . '" data-ratio="' . $ratio . '" data-min_width="' . $min_width . '" data-min_height="' . $min_height . '" data-coord=""><a href="#" class="cancel"><i class="um-icon-close"></i></a><img src="" alt="" /></div>';
$output .= '<div class="um-single-image-upload" data-icon="' . $icon . '" data-set_id="' . $set_id . '" data-set_mode="' . $set_mode . '" data-type="' . $type . '" data-key="' . $key . '" data-max_size="' . $max_size . '" data-max_size_error="' . $max_size_error . '" data-min_size_error="' . $min_size_error . '" data-extension_error="' . $extension_error . '" data-allowed_types="' . $allowed_types . '" data-upload_text="' . $upload_text . '" data-max_files_error="' . $max_files_error . '" data-upload_help_text="' . $upload_help_text . '">' . $button_text . '</div>';
$output .= '<div class="um-modal-footer">
<div class="um-modal-right">
<a href="#" class="um-modal-btn um-finish-upload image disabled" data-key="' . $key . '" data-change="' . __('Change photo', 'ultimatemember') . '" data-processing="' . __('Processing...', 'ultimatemember') . '"> ' . __('Apply', 'ultimatemember') . '</a>
<a href="#" class="um-modal-btn alt" data-action="um_remove_modal"> ' . __('Cancel', 'ultimatemember') . '</a>
示例2: um_get_avatar_uri
function um_get_avatar_uri($image, $attrs)
{
global $ultimatemember;
$uri = false;
$find = false;
if (file_exists($ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $attrs . '.jpg')) {
$uri = um_user_uploads_uri() . 'profile_photo-' . $attrs . '.jpg?' . current_time('timestamp');
} else {
$sizes = um_get_option('photo_thumb_sizes');
if (is_array($sizes)) {
$find = um_closest_num($sizes, $attrs);
}
if (file_exists($ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $find . '.jpg')) {
$uri = um_user_uploads_uri() . 'profile_photo-' . $find . '.jpg?' . current_time('timestamp');
} else {
if (file_exists($ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo.jpg')) {
$uri = um_user_uploads_uri() . 'profile_photo.jpg?' . current_time('timestamp');
}
}
if ($attrs == 'original') {
$uri = um_user_uploads_uri() . 'profile_photo.jpg?' . current_time('timestamp');
}
}
return $uri;
}
示例3: um_profile_field_filter_hook__image
function um_profile_field_filter_hook__image($value, $data)
{
$uri = um_user_uploads_uri() . $value;
$title = isset($data['title']) ? $data['title'] : __('Untitled photo');
if (file_exists(um_user_uploads_dir() . $value)) {
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . $uri . '"><img src="' . $uri . '" alt="' . $title . '" title="' . $title . '" class="" /></a></div>';
} else {
$value = '';
}
return $value;
}
示例4: um_profile_dynamic_meta_desc
function um_profile_dynamic_meta_desc()
{
global $ultimatemember;
if (um_is_core_page('user') && um_get_requested_user()) {
um_fetch_user(um_get_requested_user());
$content = um_convert_tags(um_get_option('profile_desc'));
$user_id = um_user('ID');
$url = um_user_profile_url();
if (um_profile('profile_photo')) {
$avatar = um_user_uploads_uri() . um_profile('profile_photo');
} else {
$avatar = um_get_default_avatar_uri();
}
um_reset_user();
?>
<meta name="description" content="<?php
echo $content;
?>
">
<meta property="og:title" content="<?php
echo um_get_display_name($user_id);
?>
" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<?php
echo $avatar;
?>
" />
<meta property="og:url" content="<?php
echo $url;
?>
" />
<meta property="og:description" content="<?php
echo $content;
?>
" />
<?php
}
}
示例5: um_profile_field_filter_hook__image
function um_profile_field_filter_hook__image($value, $data)
{
$uri = um_user_uploads_uri() . $value;
$title = isset($data['title']) ? $data['title'] : __('Untitled photo');
// if value is an image tag
if (preg_match('/\\<img.*src=\\"([^"]+).*/', $value, $matches)) {
$uri = $matches[1];
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . $uri . '"><img src="' . $uri . '" alt="' . $title . '" title="' . $title . '" class="" /></a></div>';
} else {
if (file_exists(um_user_uploads_dir() . $value)) {
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . $uri . '"><img src="' . $uri . '" alt="' . $title . '" title="' . $title . '" class="" /></a></div>';
} else {
$value = '';
}
}
return $value;
}
示例6: um_get_avatar_uri
function um_get_avatar_uri($image, $attrs)
{
global $ultimatemember;
$uri = false;
$find = false;
$ext = '.' . pathinfo($image, PATHINFO_EXTENSION);
$cache_time = apply_filters('um_filter_avatar_cache_time', current_time('timestamp'), um_user('ID'));
if (file_exists($ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $attrs . $ext)) {
$uri = um_user_uploads_uri() . 'profile_photo-' . $attrs . $ext . '?' . $cache_time;
} else {
$sizes = um_get_option('photo_thumb_sizes');
if (is_array($sizes)) {
$find = um_closest_num($sizes, $attrs);
}
if (file_exists($ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $find . $ext)) {
$uri = um_user_uploads_uri() . 'profile_photo-' . $find . $ext . '?' . $cache_time;
} else {
if (file_exists($ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo' . $ext)) {
$uri = um_user_uploads_uri() . 'profile_photo' . $ext . '?' . $cache_time;
}
}
if ($attrs == 'original') {
$uri = um_user_uploads_uri() . 'profile_photo' . $ext . '?' . $cache_time;
}
}
return $uri;
}