當前位置: 首頁>>代碼示例>>PHP>>正文


PHP um_user_uploads_uri函數代碼示例

本文整理匯總了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>
開發者ID:Ksajikyan,項目名稱:poiskuslug,代碼行數:67,代碼來源:um-fields.php

示例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;
}
開發者ID:lytranuit,項目名稱:wordpress,代碼行數:25,代碼來源:um-short-functions.php

示例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;
}
開發者ID:shramee,項目名稱:ultimatemember,代碼行數:11,代碼來源:um-filters-fields.php

示例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 
    }
}
開發者ID:TeamSubjectMatter,項目名稱:juddfoundation,代碼行數:42,代碼來源:um-actions-profile.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;
}
開發者ID:TeamSubjectMatter,項目名稱:juddfoundation,代碼行數:17,代碼來源:um-filters-fields.php

示例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;
}
開發者ID:TeamSubjectMatter,項目名稱:juddfoundation,代碼行數:27,代碼來源:um-short-functions.php


注:本文中的um_user_uploads_uri函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。