mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-12 03:06:23 +09:00
Mobile work and profile settings
This commit is contained in:
@@ -27,9 +27,10 @@
|
||||
|
||||
$save = '';
|
||||
$save[ $_metakey ]['roles'] = '';
|
||||
$save[ $_metakey ]['icon'] = '';
|
||||
foreach( $array['post'] as $key => $val){
|
||||
|
||||
if ( substr( $key, 0, 1) === '_' && $val != '' ) { // field attribute
|
||||
if ( substr( $key, 0, 1) === '_' && $val != '' ) { // field attribute
|
||||
$new_key = ltrim ($key,'_');
|
||||
|
||||
if ( $new_key == 'options' ) {
|
||||
|
||||
@@ -225,7 +225,7 @@ class UM_Admin_Builder {
|
||||
<div class="um-admin-drag-fld-title um-field-type-<?php echo $type; ?>">
|
||||
<?php if ( $type == 'group' ) { ?>
|
||||
<i class="um-icon-plus-add"></i>
|
||||
<?php } else if ( isset($keyarray['icon']) ) { ?>
|
||||
<?php } else if ( isset($keyarray['icon']) && !empty( $keyarray['icon'] ) ) { ?>
|
||||
<i class="<?php echo $keyarray['icon']; ?>"></i>
|
||||
<?php } ?><?php echo $title; ?></div>
|
||||
|
||||
|
||||
@@ -245,7 +245,8 @@ class UM_Admin_Metabox {
|
||||
add_meta_box('um-admin-form-profile_customize', __('<i class="um-icon-cog-1"></i>Customize this form'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
|
||||
add_meta_box('um-admin-form-login_customize', __('<i class="um-icon-cog-1"></i>Customize this form'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
|
||||
|
||||
add_meta_box('um-admin-form-login_settings', __('<i class="um-icon-tools"></i>Settings'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
|
||||
add_meta_box('um-admin-form-profile_settings', __('<i class="um-icon-tools"></i>Options'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
|
||||
add_meta_box('um-admin-form-login_settings', __('<i class="um-icon-tools"></i>Options'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
|
||||
|
||||
}
|
||||
|
||||
@@ -333,6 +334,7 @@ class UM_Admin_Metabox {
|
||||
$wpdb->update( $wpdb->posts, array( 'post_title' => $_POST['post_title'] ), $where );
|
||||
|
||||
// save
|
||||
delete_post_meta( $post_id, '_um_profile_metafields' );
|
||||
foreach( $_POST as $k => $v ) {
|
||||
if (strstr($k, '_um_')){
|
||||
update_post_meta( $post_id, $k, $v);
|
||||
@@ -968,7 +970,7 @@ class UM_Admin_Metabox {
|
||||
<select name="_crop" id="_crop" class="umaf-selectjs" style="width: 100%">
|
||||
<option value="0" <?php selected( '0', $this->edit_mode_value ); ?>>Turn Off (Default)</option>
|
||||
<option value="1" <?php selected( '1', $this->edit_mode_value ); ?>>Crop and force 1:1 ratio</option>
|
||||
<option value="2" <?php selected( '2', $this->edit_mode_value ); ?>>Crop and force user-defined ratio</option>
|
||||
<option value="3" <?php selected( '3', $this->edit_mode_value ); ?>>Crop and force user-defined ratio</option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<div class="um-admin-metabox">
|
||||
|
||||
<p>
|
||||
<label class=""><?php _e('Field(s) to show in user meta','ultimatemember'); ?></label>
|
||||
|
||||
<?php
|
||||
|
||||
$meta_test = get_post_meta( get_the_ID(), '_um_profile_metafields', true );
|
||||
$i = 0;
|
||||
if ( is_array( $meta_test ) ) {
|
||||
foreach( $meta_test as $val ) { $i++;
|
||||
?>
|
||||
|
||||
<span class="um-admin-field">
|
||||
|
||||
<select name="_um_profile_metafields[]" id="_um_profile_metafields" class="umaf-selectjs" style="width: 180px" data-placeholder="Choose a field">
|
||||
<?php foreach($ultimatemember->builtin->all_user_fields() as $key => $arr) { ?>
|
||||
<option value="<?php echo $key; ?>" <?php selected($key, $val ); ?>><?php echo isset( $arr['title'] ) ? $arr['title'] : ''; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
<?php if ( $i == 1 ) { ?>
|
||||
<a href="#" class="um-admin-clone button um-admin-tipsy-n" title="New Field"><i class="um-icon-plus-add" style="margin-right:0!important"></i></a>
|
||||
<?php } else { ?>
|
||||
<a href="#" class="um-admin-clone-remove button um-admin-tipsy-n" title="Remove Field"><i class="um-icon-remove" style="margin-right:0!important"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
</span>
|
||||
|
||||
<?php }
|
||||
|
||||
} else {
|
||||
?>
|
||||
|
||||
<span class="um-admin-field">
|
||||
|
||||
<select name="_um_profile_metafields[]" id="_um_profile_metafields" class="umaf-selectjs" style="width: 180px" data-placeholder="Choose a field">
|
||||
<?php foreach($ultimatemember->builtin->all_user_fields() as $key => $arr) { ?>
|
||||
<option value="<?php echo $key; ?>" <?php selected($key, $ultimatemember->query->get_meta_value('_um_profile_metafields', $key) ); ?>><?php echo isset( $arr['title'] ) ? $arr['title'] : ''; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
<a href="#" class="um-admin-clone button um-admin-tipsy-n" title="New Field"><i class="um-icon-plus-add" style="margin-right:0!important"></i></a>
|
||||
|
||||
</span>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</p><div class="um-admin-clear"></div>
|
||||
|
||||
<p>
|
||||
<label><?php _e('Show user description in profile header? ','ultimatemember'); ?></label>
|
||||
<span>
|
||||
|
||||
<?php $this->ui_on_off('_um_profile_show_bio', 1 ); ?>
|
||||
|
||||
</span>
|
||||
</p><div class="um-admin-clear"></div>
|
||||
|
||||
</div>
|
||||
+256
-26
@@ -1,41 +1,271 @@
|
||||
/*
|
||||
* imgAreaSelect default style
|
||||
*/
|
||||
.cropper-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.imgareaselect-border1 {
|
||||
background: url(../img/border-v.gif) repeat-y left top;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
|
||||
.imgareaselect-border2 {
|
||||
background: url(../img/border-h.gif) repeat-x left top;
|
||||
.cropper-container img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0 !important;
|
||||
min-height: 0 !important;
|
||||
max-width: none !important;
|
||||
max-height: none !important;
|
||||
}
|
||||
|
||||
.imgareaselect-border3 {
|
||||
background: url(../img/border-v.gif) repeat-y right top;
|
||||
.cropper-modal,
|
||||
.cropper-canvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.imgareaselect-border4 {
|
||||
background: url(../img/border-h.gif) repeat-x left bottom;
|
||||
.cropper-canvas {
|
||||
background-color: #fff;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity=0);
|
||||
}
|
||||
|
||||
.imgareaselect-border1, .imgareaselect-border2,
|
||||
.imgareaselect-border3, .imgareaselect-border4 {
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
.cropper-modal {
|
||||
background-color: #000;
|
||||
opacity: .5;
|
||||
filter: alpha(opacity=50);
|
||||
}
|
||||
|
||||
.imgareaselect-handle {
|
||||
background-color: #fff;
|
||||
border: solid 1px #000;
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
.cropper-dragger {
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
}
|
||||
|
||||
.imgareaselect-outer {
|
||||
background-color: #000;
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
.cropper-viewer {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
outline-width: 1px;
|
||||
outline-style: solid;
|
||||
outline-color: #69f;
|
||||
outline-color: rgba(51, 102, 255, .75);
|
||||
}
|
||||
|
||||
.imgareaselect-selection {
|
||||
}
|
||||
.cropper-dashed {
|
||||
position: absolute;
|
||||
display: block;
|
||||
border: 0 dashed #fff;
|
||||
opacity: .5;
|
||||
filter: alpha(opacity=50);
|
||||
}
|
||||
|
||||
.cropper-dashed.dashed-h {
|
||||
top: 33.3%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 33.3%;
|
||||
border-top-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
.cropper-dashed.dashed-v {
|
||||
top: 0;
|
||||
left: 33.3%;
|
||||
width: 33.3%;
|
||||
height: 100%;
|
||||
border-right-width: 1px;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
.cropper-face,
|
||||
.cropper-line,
|
||||
.cropper-point {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: .1;
|
||||
filter: alpha(opacity=10);
|
||||
}
|
||||
|
||||
.cropper-face {
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: move;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.cropper-line {
|
||||
background-color: #69f;
|
||||
}
|
||||
|
||||
.cropper-line.line-e {
|
||||
top: 0;
|
||||
right: -3px;
|
||||
width: 5px;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.cropper-line.line-n {
|
||||
top: -3px;
|
||||
left: 0;
|
||||
height: 5px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.cropper-line.line-w {
|
||||
top: 0;
|
||||
left: -3px;
|
||||
width: 5px;
|
||||
cursor: w-resize;
|
||||
}
|
||||
|
||||
.cropper-line.line-s {
|
||||
bottom: -3px;
|
||||
left: 0;
|
||||
height: 5px;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
.cropper-point {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
background-color: #69f;
|
||||
opacity: .75;
|
||||
filter: alpha(opacity=75);
|
||||
}
|
||||
|
||||
.cropper-point.point-e {
|
||||
top: 50%;
|
||||
right: -3px;
|
||||
margin-top: -3px;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.cropper-point.point-n {
|
||||
top: -3px;
|
||||
left: 50%;
|
||||
margin-left: -3px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.cropper-point.point-w {
|
||||
top: 50%;
|
||||
left: -3px;
|
||||
margin-top: -3px;
|
||||
cursor: w-resize;
|
||||
}
|
||||
|
||||
.cropper-point.point-s {
|
||||
bottom: -3px;
|
||||
left: 50%;
|
||||
margin-left: -3px;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
.cropper-point.point-ne {
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
cursor: ne-resize;
|
||||
}
|
||||
|
||||
.cropper-point.point-nw {
|
||||
top: -3px;
|
||||
left: -3px;
|
||||
cursor: nw-resize;
|
||||
}
|
||||
|
||||
.cropper-point.point-sw {
|
||||
bottom: -3px;
|
||||
left: -3px;
|
||||
cursor: sw-resize;
|
||||
}
|
||||
|
||||
.cropper-point.point-se {
|
||||
right: -3px;
|
||||
bottom: -3px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: se-resize;
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
|
||||
.cropper-point.point-se:before {
|
||||
position: absolute;
|
||||
right: -50%;
|
||||
bottom: -50%;
|
||||
display: block;
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
content: " ";
|
||||
background-color: #69f;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity=0);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.cropper-point.point-se {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.cropper-point.point-se {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.cropper-point.point-se {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
opacity: .75;
|
||||
filter: alpha(opacity=75);
|
||||
}
|
||||
}
|
||||
|
||||
/* Helper classes for JavaScript */
|
||||
|
||||
.cropper-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.cropper-invisible {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
width: auto !important;
|
||||
max-width: none !important;
|
||||
height: auto !important;
|
||||
max-height: none !important;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity=0);
|
||||
}
|
||||
|
||||
.cropper-move {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.cropper-crop {
|
||||
cursor: crosshair;
|
||||
}
|
||||
|
||||
.cropper-disabled .cropper-canvas,
|
||||
.cropper-disabled .cropper-face,
|
||||
.cropper-disabled .cropper-line,
|
||||
.cropper-disabled .cropper-point {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
@@ -7,14 +7,24 @@
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.um .um-single-image-preview > img {
|
||||
max-height: 200px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: auto;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.um-single-image-preview,
|
||||
.um-single-file-preview {
|
||||
display: none;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.um-single-image-preview > img {
|
||||
max-width: 100%;
|
||||
max-height: inherit;
|
||||
}
|
||||
|
||||
.um-single-image-preview a.cancel,
|
||||
@@ -27,8 +37,9 @@
|
||||
border-radius: 999px;
|
||||
background: #ddd;
|
||||
cursor: pointer;
|
||||
transition: 0.2s;
|
||||
text-decoration: none !important;
|
||||
z-index: 8888;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.um-single-image-preview a.cancel i,
|
||||
@@ -39,44 +50,40 @@
|
||||
top: 4px;
|
||||
}
|
||||
|
||||
.um-single-image-preview img {
|
||||
max-width: 100%;
|
||||
margin: 0 auto !important;
|
||||
padding: 0 !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
/*
|
||||
- file preview
|
||||
- file info
|
||||
*/
|
||||
|
||||
.um-single-fileinfo {
|
||||
padding: 36px 0 30px 0;
|
||||
padding: 26px 0 20px 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.um-single-fileinfo span.icon {
|
||||
font-size: 38px;
|
||||
font-size: 42px;
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
border-radius: 5px;
|
||||
border-radius: 3px;
|
||||
background-color: #666;
|
||||
color: #fff !important;
|
||||
}
|
||||
.um-single-fileinfo span.icon i {line-height: 1em !important;vertical-align: middle}
|
||||
.um-single-fileinfo span.icon i{vertical-align: middle}
|
||||
|
||||
.um-single-fileinfo span.filename {
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
color: #888;
|
||||
padding: 15px 0 0 0;
|
||||
}
|
||||
|
||||
.um-single-fileinfo a {text-decoration: none !important; opacity: 0.85 }
|
||||
.um-single-fileinfo a:hover { opacity: 1 }
|
||||
.um-single-fileinfo a {
|
||||
text-decoration: none !important;
|
||||
opacity: 0.9;
|
||||
}
|
||||
.um-single-fileinfo a:hover {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
/*
|
||||
- upload progress
|
||||
@@ -122,7 +129,7 @@
|
||||
|
||||
.ajax-upload-dragdrop span.str {
|
||||
display: block;
|
||||
margin: 0 0 12px 0;
|
||||
margin: 0 0 15px 0;
|
||||
}
|
||||
|
||||
.ajax-upload-dragdrop span.icon {
|
||||
|
||||
@@ -111,8 +111,14 @@
|
||||
|
||||
.um-gutter-sizer { width: 5% }
|
||||
|
||||
/*
|
||||
- Member cover
|
||||
*/
|
||||
|
||||
.um-member-cover {
|
||||
background-color: #eee;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.um-member-cover-e {
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
background: #3ba1da;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
font-size: 15px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.um-modal-footer {
|
||||
@@ -93,6 +93,7 @@
|
||||
display: inline-block;
|
||||
border-radius: 3px;
|
||||
padding: 0 20px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
background: #3ba1da;
|
||||
vertical-align: middle;
|
||||
|
||||
+112
-16
@@ -4,6 +4,19 @@
|
||||
|
||||
.um-profile {
|
||||
box-sizing: border-box;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.um-profile .um-cover-overlay {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.um-profile.um-editing .um-cover.has-cover .um-cover-overlay {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.um-profile.um-viewing .um-profile-photo-overlay {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.um-profile img {display: block;overflow:hidden;border-radius:0!important;margin: 0!important}
|
||||
@@ -33,21 +46,11 @@
|
||||
- Profile cover
|
||||
*/
|
||||
|
||||
.um-cover{
|
||||
.um-cover {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.um-cover-add span {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.um-cover-e {
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
.um-cover-e.empty {border: 2px dashed #ddd}
|
||||
.um-cover-e img {width: 100% !important}
|
||||
|
||||
.um-cover-add {
|
||||
color: #aaa;
|
||||
@@ -55,8 +58,61 @@
|
||||
width: 100%;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.um-cover-add span {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.um-cover-add:hover { color: #3ba1da }
|
||||
|
||||
.um-cover-e {
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-cover-e img {width: 100% !important}
|
||||
|
||||
.um-cover-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(0,0,0,.5);
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
padding: 0 40px;
|
||||
color: #fff;
|
||||
text-shadow: 0 2px #333;
|
||||
cursor: pointer !important;
|
||||
line-height: 21px;
|
||||
font-size: 16px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.um-cover-overlay:hover {
|
||||
background: rgba(0,0,0,.55);
|
||||
}
|
||||
|
||||
.um-cover-overlay span.um-cover-overlay-s {
|
||||
display: table;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.um-cover-overlay ins {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
height: 100%;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.um-cover-overlay i {
|
||||
font-size: 46px;
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
/*
|
||||
- Profile header
|
||||
*/
|
||||
@@ -70,7 +126,7 @@
|
||||
.um-profile-edit {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
right: 0;
|
||||
vertical-align: middle;
|
||||
z-index: 99;
|
||||
font-size: 30px;
|
||||
@@ -124,7 +180,6 @@
|
||||
|
||||
.um-profile-photo {
|
||||
float: left;
|
||||
width: 250px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -136,11 +191,51 @@
|
||||
left: 30px;
|
||||
}
|
||||
|
||||
.um-profile-photo img {
|
||||
.um-profile-photo a.um-profile-photo-img img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.um-profile-photo-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0,0,0,.5);
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
padding: 0 40px;
|
||||
color: #fff;
|
||||
line-height: 21px;
|
||||
font-size: 16px;
|
||||
text-shadow: 0 1px #333;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.um-profile-photo-overlay:hover {
|
||||
background: rgba(0,0,0,.55);
|
||||
}
|
||||
|
||||
.um-profile-photo-overlay span.um-profile-photo-overlay-s {
|
||||
display: table;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.um-profile-photo-overlay ins {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
height: 100%;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.um-profile-photo-overlay i {
|
||||
font-size: 46px;
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
/*
|
||||
- Profile meta
|
||||
*/
|
||||
@@ -164,12 +259,13 @@
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.um-meta span:first-child {margin: 0 5px 0 0}
|
||||
.um-meta span {
|
||||
margin: 0 5px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.um-meta-text {
|
||||
margin: 12px 0 0 0;
|
||||
margin: 6px 0 0 0;
|
||||
color: #666;
|
||||
}
|
||||
+296
-39
@@ -28,22 +28,31 @@ div.uimob960 .uimob960-hide
|
||||
|
||||
/********************************************/
|
||||
|
||||
.uimob340 .um-half {
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin: 0 0 10px 0;
|
||||
div.uimob340 .um-cover-overlay span.um-cover-overlay-t,
|
||||
div.uimob340 .um-profile-photo-overlay span.um-profile-photo-overlay-t
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.uimob340 .um-button.um-btn-auto-width {
|
||||
min-width: auto;
|
||||
max-width: auto;
|
||||
width: 100%;
|
||||
div.uimob340 .um-cover-overlay,
|
||||
div.uimob340 .um-profile-photo-overlay
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.uimob340 .um-cover-overlay i,
|
||||
div.uimob340 .um-profile-photo-overlay i
|
||||
{
|
||||
margin-bottom: 0;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.um-modal.uimob340 {
|
||||
width: 100% !important;
|
||||
margin: 0 !important;
|
||||
left: 0 !important;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.um-modal.uimob340,
|
||||
@@ -52,16 +61,181 @@ div.uimob960 .uimob960-hide
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.um-modal.uimob340 .um-modal-header {text-align: center}
|
||||
.um-modal.uimob340 .um-modal-footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.um-modal.uimob340 .um-modal-right {
|
||||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.um-modal.uimob340 .um-modal-footer a.um-modal-btn {
|
||||
width: 48%;
|
||||
margin: 0 1%;
|
||||
float: left;
|
||||
display: block;
|
||||
line-height: 44px !important;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
.um-modal.uimob340 .ajax-upload-dragdrop span.icon {
|
||||
font-size: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
div.uimob340 .um-profile-body {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
div.uimob340 .um-profile-photo {
|
||||
width: 100% !important;
|
||||
text-align: center !important;
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
div.uimob340 .um-profile-photo a.um-profile-photo-img {
|
||||
width: 100px !important;
|
||||
height: 100px !important;
|
||||
margin: 0 auto !important;
|
||||
float: none !important;
|
||||
display: inline-block !important;
|
||||
position: relative !important;
|
||||
top: auto !important;
|
||||
left: auto !important;
|
||||
}
|
||||
|
||||
div.uimob340 .um-header .um-profile-meta {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
text-align: center !important;
|
||||
padding-top: 90px !important;
|
||||
}
|
||||
|
||||
div.uimob340 .um-header .um-name {
|
||||
float: none !important;
|
||||
margin-right: 0 !important;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
div.uimob340 .um-header .um-meta-text {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
div.uimob340 .um-header .um-meta {padding: 0 20px}
|
||||
div.uimob340 .um-header .um-meta span:first-child {display: block}
|
||||
div.uimob340 .um-header .um-meta span {display: none}
|
||||
|
||||
div.uimob340 .um-col-121,
|
||||
div.uimob340 .um-col-122,
|
||||
div.uimob340 .um-col-131,
|
||||
div.uimob340 .um-col-132,
|
||||
div.uimob340 .um-col-133 {
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.uimob340 .um-field-half {
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.uimob340 .um-search {
|
||||
padding: 20px 0 !important;
|
||||
width: 100% !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.uimob340 .um-search .um-search-filter {
|
||||
width: 100% !important;
|
||||
float: none !important;
|
||||
padding: 0 0 15px 0 !important;
|
||||
}
|
||||
|
||||
div.uimob340 .um-search .um-search-submit .um-button {
|
||||
display: block !important;
|
||||
min-width: 100% !important;
|
||||
margin: 0 0 15px 0 !important;
|
||||
}
|
||||
|
||||
div.uimob340 .um-member {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.uimob340 .um-gutter-sizer { width: 0px }
|
||||
|
||||
div.uimob340 .um-account-main {
|
||||
float: none;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.uimob340 .um-account-tab {
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
div.uimob340 .um-account-main div.um-field {padding-top: 15px}
|
||||
|
||||
div.uimob340 .um-account-meta {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.uimob340 .um-half {
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.uimob340 .um-button.um-btn-auto-width {
|
||||
min-width: auto;
|
||||
max-width: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/**
|
||||
for 500px and below
|
||||
**/
|
||||
|
||||
/********************************************/
|
||||
|
||||
div.uimob500 .um-cover-overlay span.um-cover-overlay-t,
|
||||
div.uimob500 .um-profile-photo-overlay span.um-profile-photo-overlay-t
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
div.uimob500 .um-cover-overlay,
|
||||
div.uimob500 .um-profile-photo-overlay
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.uimob500 .um-cover-overlay i,
|
||||
div.uimob500 .um-profile-photo-overlay i
|
||||
{
|
||||
margin-bottom: 0;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.um-modal.uimob500 {
|
||||
width: 100% !important;
|
||||
margin: 0 !important;
|
||||
left: 0 !important;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.um-modal.uimob500,
|
||||
@@ -70,15 +244,41 @@ div.uimob960 .uimob960-hide
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.um-modal.uimob500 .um-modal-header {text-align: center}
|
||||
.um-modal.uimob500 .um-modal-footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.um-modal.uimob500 .um-modal-right {
|
||||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.um-modal.uimob500 .um-modal-footer a.um-modal-btn {
|
||||
width: 48%;
|
||||
margin: 0 1%;
|
||||
float: left;
|
||||
display: block;
|
||||
line-height: 44px !important;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
.um-modal.uimob500 .ajax-upload-dragdrop span.icon {
|
||||
font-size: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
div.uimob500 .um-profile-body {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
div.uimob500 .um-profile-edit {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
div.uimob500 .um-profile-photo {
|
||||
width: 100% !important;
|
||||
text-align: center !important;
|
||||
@@ -102,7 +302,7 @@ div.uimob500 .um-header .um-profile-meta {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
text-align: center !important;
|
||||
padding-top: 70px !important;
|
||||
padding-top: 80px !important;
|
||||
}
|
||||
|
||||
div.uimob500 .um-header .um-name {
|
||||
@@ -112,13 +312,12 @@ div.uimob500 .um-header .um-name {
|
||||
}
|
||||
|
||||
div.uimob500 .um-header .um-meta-text {
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
div.uimob500 .um-header .um-meta {padding: 0 20px}
|
||||
div.uimob500 .um-header .um-meta span {display: block}
|
||||
div.uimob500 .um-header .um-meta span.b {display: none}
|
||||
div.uimob500 .um-header .um-meta span:first-child {display: block}
|
||||
div.uimob500 .um-header .um-meta span {display: none}
|
||||
|
||||
div.uimob500 .um-col-121,
|
||||
div.uimob500 .um-col-122,
|
||||
@@ -157,7 +356,7 @@ div.uimob500 .um-member {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.uimob500 .um-gutter-sizer { width: 0px }
|
||||
div.uimob500 .um-gutter-sizer { width: 0px }
|
||||
|
||||
div.uimob500 .um-account-main {
|
||||
float: none;
|
||||
@@ -246,6 +445,32 @@ div.uimob800 .um-account-meta img {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
div.uimob800 .um-profile-photo {
|
||||
width: 200px !important;
|
||||
}
|
||||
|
||||
div.uimob800 .um-profile-photo a.um-profile-photo-img {
|
||||
width: 140px !important;
|
||||
height: 140px !important;
|
||||
top: -70px !important;
|
||||
}
|
||||
|
||||
div.uimob800 .um-header .um-profile-meta {
|
||||
padding-left: 200px;
|
||||
}
|
||||
|
||||
div.uimob800 .um-cover-overlay span.um-cover-overlay-t,
|
||||
div.uimob800 .um-profile-photo-overlay span.um-profile-photo-overlay-t
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
div.uimob800 .um-cover-overlay,
|
||||
div.uimob800 .um-profile-photo-overlay
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/********************************************/
|
||||
|
||||
/**
|
||||
@@ -296,30 +521,62 @@ div.uimob960 .um-gutter-sizer { width: 4% }
|
||||
|
||||
/************************************************/
|
||||
|
||||
@media screen and ( max-height: 900px ){
|
||||
.um-single-image-preview img {max-height: 500px}
|
||||
@media screen and (max-height: 400px) {
|
||||
|
||||
.ajax-upload-dragdrop span.icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.um-modal {
|
||||
width: 100% !important;
|
||||
margin: 0 !important;
|
||||
left: 0 !important;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.um-modal,
|
||||
.um-modal .um-modal-body,
|
||||
.um-modal .um-modal-header {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.um-modal .um-modal-header {text-align: center; font-size: 14px}
|
||||
.um-modal .um-modal-footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.um-modal .um-modal-right {
|
||||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.um-modal .um-modal-footer a.um-modal-btn {
|
||||
width: 48%;
|
||||
margin: 0 1%;
|
||||
float: left;
|
||||
display: block;
|
||||
line-height: 44px !important;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media screen and ( max-height: 800px ){
|
||||
.um-single-image-preview img {max-height: 500px}
|
||||
}
|
||||
@media screen and (max-height: 300px) {
|
||||
|
||||
@media screen and ( max-height: 700px ){
|
||||
.um-single-image-preview img {max-height: 350px}
|
||||
}
|
||||
.um-modal-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ajax-upload-dragdrop span.icon,
|
||||
.ajax-upload-dragdrop span.str {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and ( max-height: 600px ){
|
||||
.um-single-image-preview img {max-height: 300px}
|
||||
}
|
||||
|
||||
@media screen and ( max-height: 500px ){
|
||||
.um-single-image-preview img {max-height: 250px}
|
||||
}
|
||||
|
||||
@media screen and ( max-height: 400px ){
|
||||
.um-single-image-preview img {max-height: 200px}
|
||||
}
|
||||
|
||||
@media screen and ( max-height: 300px ){
|
||||
.um-single-image-preview img {max-height: 150px}
|
||||
}
|
||||
@@ -25,7 +25,8 @@
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.um a:focus {
|
||||
.um a:focus,
|
||||
.um-modal a:focus {
|
||||
outline: 0 !important;
|
||||
}
|
||||
|
||||
@@ -209,8 +210,17 @@ p.um-notice.success {
|
||||
}
|
||||
|
||||
.um-tip i {
|
||||
font-size: 18px;
|
||||
font-size: 20px;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.um-tip-text {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
line-height: 15px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -264,7 +274,6 @@ p.um-notice.success {
|
||||
|
||||
.um-field-icon {
|
||||
position: absolute;
|
||||
z-index: 888;
|
||||
cursor: default;
|
||||
text-align: center !important;
|
||||
top: 2px;
|
||||
@@ -485,4 +494,60 @@ a.um-link-alt {
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
}
|
||||
a.um-link-alt:hover {text-decoration: underline !important;}
|
||||
a.um-link-alt:hover {text-decoration: underline !important;}
|
||||
|
||||
/*
|
||||
- Dropdown menu
|
||||
*/
|
||||
|
||||
.um-dropdown {
|
||||
position: absolute;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
z-index: 555;
|
||||
display: none;
|
||||
border: 1px solid #e5e5e5;
|
||||
box-sizing: border-box;
|
||||
-webkit-box-shadow: 0 0 2px rgba(0,0,0,0.1);
|
||||
box-shadow: 0 0 1px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.um-dropdown ul,
|
||||
.um-dropdown li {
|
||||
list-style-type: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.um-dropdown li a {
|
||||
display: block;
|
||||
padding: 8px 12px;
|
||||
color: #666;
|
||||
z-index: 4;
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.um-dropdown li:last-child a {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.um-dropdown li a:hover {
|
||||
color: #3ba1da;
|
||||
}
|
||||
|
||||
.um-dropdown-b {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.um-dropdown-arr {
|
||||
position: absolute;
|
||||
color: #fff;
|
||||
font-size: 24px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
z-index: 2;
|
||||
}
|
||||
@@ -6,17 +6,35 @@ $photosize_up = ( $photosize / 2 ) + 10;
|
||||
$meta_padding = ( $photosize + 60 ) . 'px';
|
||||
|
||||
if ( $photocorner == 1 ) {
|
||||
print ".um-$form_id.um .um-profile-photo a.um-profile-photo-img, .um-profile-photo img { border-radius: 999px !important }";
|
||||
print "
|
||||
.um-$form_id.um .um-profile-photo a.um-profile-photo-img,
|
||||
.um-$form_id.um .um-profile-photo img,
|
||||
.um-$form_id.um .um-profile-photo span.um-profile-photo-overlay
|
||||
{ border-radius: 999px !important }";
|
||||
}
|
||||
|
||||
if ( $photocorner == 2 ) {
|
||||
print ".um-$form_id.um .um-profile-photo a.um-profile-photo-img, .um-profile-photo img { border-radius: 4px !important }";
|
||||
print "
|
||||
.um-$form_id.um .um-profile-photo a.um-profile-photo-img,
|
||||
.um-$form_id.um .um-profile-photo img,
|
||||
.um-$form_id.um .um-profile-photo span.um-profile-photo-overlay
|
||||
{ border-radius: 4px !important }";
|
||||
}
|
||||
|
||||
if ( $photocorner == 3 ) {
|
||||
print ".um-$form_id.um .um-profile-photo a.um-profile-photo-img, .um-profile-photo img { border-radius: 0px !important }";
|
||||
print "
|
||||
.um-$form_id.um .um-profile-photo a.um-profile-photo-img,
|
||||
.um-$form_id.um .um-profile-photo img,
|
||||
.um-$form_id.um .um-profile-photo span.um-profile-photo-overlay
|
||||
{ border-radius: 0px !important }";
|
||||
}
|
||||
|
||||
print "
|
||||
.um-$form_id.um .um-profile-photo {
|
||||
width: $meta_padding;
|
||||
}
|
||||
";
|
||||
|
||||
print "
|
||||
.um-$form_id.um .um-header.no-cover a.um-profile-photo-img img,
|
||||
.um-$form_id.um .um-profile-photo a.um-profile-photo-img {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 84 KiB |
+1569
-1
File diff suppressed because one or more lines are too long
+101
-19
@@ -1,11 +1,3 @@
|
||||
function initCrop_UM() {
|
||||
|
||||
jQuery('.um-single-image-preview.crop img').imgAreaSelect({
|
||||
handles: true,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function initImageUpload_UM( trigger ) {
|
||||
|
||||
if (trigger.data('upload_help_text')){
|
||||
@@ -43,7 +35,7 @@ function initImageUpload_UM( trigger ) {
|
||||
showAbort: false,
|
||||
showDone: false,
|
||||
showFileCounter: false,
|
||||
showStatusAfterSuccess: false,
|
||||
showStatusAfterSuccess: true,
|
||||
onSubmit:function(files){
|
||||
|
||||
trigger.parents('.um-modal-body').find('.um-error-block').remove();
|
||||
@@ -57,24 +49,114 @@ function initImageUpload_UM( trigger ) {
|
||||
if (data.error && data.error != '') {
|
||||
|
||||
trigger.parents('.um-modal-body').append('<div class="um-error-block">'+data.error+'</div>');
|
||||
trigger.parents('.um-modal-body').find('.upload-statusbar').hide(0);
|
||||
um_modal_responsive();
|
||||
|
||||
} else {
|
||||
|
||||
jQuery.each( data, function(key, value) {
|
||||
trigger.parents('.um-modal-body').find('.um-single-image-preview img').attr('src', value);
|
||||
|
||||
var img_id = trigger.parents('.um-modal-body').find('.um-single-image-preview img');
|
||||
var img_id_h = trigger.parents('.um-modal-body').find('.um-single-image-preview');
|
||||
|
||||
img_id.attr("src", value);
|
||||
img_id.load(function(){
|
||||
|
||||
trigger.parents('.um-modal-body').find('.um-modal-btn.um-finish-upload.disabled').removeClass('disabled');
|
||||
trigger.parents('.um-modal-body').find('.ajax-upload-dragdrop,.upload-statusbar').hide(0);
|
||||
img_id_h.show(0);
|
||||
um_modal_responsive();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
trigger.parents('.um-modal-body').find('.ajax-upload-dragdrop').fadeOut( function () {
|
||||
trigger.parents('.um-modal-body').find('.um-single-image-preview').show();
|
||||
trigger.parents('.um-modal-body').find('.um-modal-btn.um-finish-upload.disabled').removeClass('disabled');
|
||||
um_modal_responsive();
|
||||
} );
|
||||
|
||||
initCrop_UM();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function initFileUpload_UM( trigger ) {
|
||||
|
||||
if (trigger.data('upload_help_text')){
|
||||
upload_help_text = '<span class="help">' + trigger.data('upload_help_text') + '</span>';
|
||||
} else {
|
||||
upload_help_text = '';
|
||||
}
|
||||
|
||||
if ( trigger.data('icon') ) {
|
||||
icon = '<span class="icon"><i class="'+ trigger.data('icon') + '"></i></span>';
|
||||
} else {
|
||||
icon = '';
|
||||
}
|
||||
|
||||
if ( trigger.data('upload_text') ) {
|
||||
upload_text = '<span class="str">' + trigger.data('upload_text') + '</span>';
|
||||
} else {
|
||||
upload_text = '';
|
||||
}
|
||||
|
||||
trigger.uploadFile({
|
||||
url: ultimatemember_file_upload_url,
|
||||
method: "POST",
|
||||
multiple: false,
|
||||
formData: {key: trigger.data('key'), set_id: trigger.data('set_id'), set_mode: trigger.data('set_mode') },
|
||||
fileName: trigger.data('key'),
|
||||
allowedTypes: trigger.data('allowed_types'),
|
||||
maxFileSize: trigger.data('max_size'),
|
||||
dragDropStr: icon + upload_text + upload_help_text,
|
||||
sizeErrorStr: trigger.data('max_size_error'),
|
||||
extErrorStr: trigger.data('extension_error'),
|
||||
maxFileCountErrorStr: trigger.data('max_files_error'),
|
||||
maxFileCount: 1,
|
||||
showDelete: false,
|
||||
showAbort: false,
|
||||
showDone: false,
|
||||
showFileCounter: false,
|
||||
showStatusAfterSuccess: true,
|
||||
onSubmit:function(files){
|
||||
|
||||
trigger.parents('.um-modal-body').find('.um-error-block').remove();
|
||||
|
||||
},
|
||||
onSuccess:function(files,data,xhr){
|
||||
|
||||
trigger.selectedFiles = 0;
|
||||
|
||||
data = jQuery.parseJSON(data);
|
||||
if (data.error && data.error != '') {
|
||||
|
||||
trigger.parents('.um-modal-body').append('<div class="um-error-block">'+data.error+'</div>');
|
||||
trigger.parents('.um-modal-body').find('.upload-statusbar').hide(0);
|
||||
um_modal_responsive();
|
||||
|
||||
} else {
|
||||
|
||||
jQuery.each( data, function(key, value) {
|
||||
|
||||
trigger.parents('.um-modal-body').find('.um-modal-btn.um-finish-upload.disabled').removeClass('disabled');
|
||||
trigger.parents('.um-modal-body').find('.ajax-upload-dragdrop,.upload-statusbar').hide(0);
|
||||
trigger.parents('.um-modal-body').find('.um-single-file-preview').show(0);
|
||||
|
||||
if (key == 'icon') {
|
||||
trigger.parents('.um-modal-body').find('.um-single-fileinfo i').removeClass().addClass(value);
|
||||
} else if ( key == 'icon_bg' ) {
|
||||
trigger.parents('.um-modal-body').find('.um-single-fileinfo span.icon').css({'background-color' : value } );
|
||||
} else if ( key == 'filename' ) {
|
||||
trigger.parents('.um-modal-body').find('.um-single-fileinfo span.filename').html(value);
|
||||
} else {
|
||||
trigger.parents('.um-modal-body').find('.um-single-fileinfo a').attr('href', value);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
um_modal_responsive();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
+217
-15
@@ -1,10 +1,103 @@
|
||||
function initCrop_UM() {
|
||||
|
||||
// only when a crop image is in view
|
||||
var target_img = jQuery('.um-modal:visible .um-single-image-preview.crop img');
|
||||
var target_img_parent = jQuery('.um-modal:visible .um-single-image-preview.crop');
|
||||
|
||||
var crop_data = target_img.parent().attr('data-crop');
|
||||
var min_width = target_img.parent().attr('data-min_width');
|
||||
var min_height = target_img.parent().attr('data-min_height');
|
||||
var ratio = target_img.parent().attr('data-ratio');
|
||||
|
||||
// custom defined ratio maybe
|
||||
if ( jQuery('.um-modal').find('#um_upload_single').attr('data-ratio') ) {
|
||||
var ratio = jQuery('.um-modal').find('#um_upload_single').attr('data-ratio');
|
||||
var ratio_split = ratio.split(':');
|
||||
var ratio = ratio_split[0];
|
||||
}
|
||||
|
||||
if ( target_img.length ) {
|
||||
|
||||
if ( target_img.attr('src') != '' ) {
|
||||
|
||||
var max_height = jQuery(window).height() - ( jQuery('.um-modal-footer a').height() + 20 ) - 50 - ( jQuery('.um-modal-header:visible').height() );
|
||||
|
||||
target_img.css({'height' : 'auto'});
|
||||
target_img_parent.css({'height' : 'auto'});
|
||||
|
||||
if ( jQuery(window).height() <= 400 ) {
|
||||
target_img_parent.css({ 'height': max_height +'px', 'max-height' : max_height + 'px' });
|
||||
target_img.css({ 'height' : 'auto' });
|
||||
} else {
|
||||
target_img.css({ 'height': 'auto', 'max-height' : max_height + 'px' });
|
||||
target_img_parent.css({ 'height': target_img.height(), 'max-height' : max_height + 'px' });
|
||||
}
|
||||
|
||||
if ( crop_data == 'square' ) {
|
||||
|
||||
var opts = {
|
||||
minWidth: min_width,
|
||||
minHeight: min_height,
|
||||
dragCrop: false,
|
||||
aspectRatio: 1.0,
|
||||
zoomable: false,
|
||||
rotatable: false,
|
||||
dashed: false,
|
||||
done: function(data) {
|
||||
target_img.parent().attr('data-coord', Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height) );
|
||||
}
|
||||
};
|
||||
|
||||
} else if ( crop_data == 'cover' ) {
|
||||
|
||||
var opts = {
|
||||
minWidth: min_width,
|
||||
minHeight: Math.round( min_width / ratio ),
|
||||
dragCrop: false,
|
||||
aspectRatio: ratio,
|
||||
zoomable: false,
|
||||
rotatable: false,
|
||||
dashed: false,
|
||||
done: function(data) {
|
||||
target_img.parent().attr('data-coord', Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height) );
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
var opts = {
|
||||
dragCrop: true,
|
||||
aspectRatio: "auto",
|
||||
zoomable: false,
|
||||
rotatable: false,
|
||||
dashed: false,
|
||||
done: function(data) {
|
||||
target_img.parent().attr('data-coord', Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height) );
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
target_img.cropper( opts );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function um_new_modal( id, size ){
|
||||
|
||||
var modal = jQuery('body').find('.um-modal-overlay');
|
||||
|
||||
jQuery('.tipsy').hide();
|
||||
|
||||
jQuery('.um-dropdown').hide();
|
||||
|
||||
jQuery('body,html').css("overflow", "hidden");
|
||||
|
||||
jQuery(document).bind("touchmove", function(e){e.preventDefault();});
|
||||
jQuery('.um-modal').on('touchmove', function(e){e.stopPropagation();});
|
||||
|
||||
jQuery('body').append('<div class="um-modal-overlay" /><div class="um-modal" />');
|
||||
|
||||
jQuery('#' + id).prependTo('.um-modal');
|
||||
@@ -14,6 +107,8 @@ function um_new_modal( id, size ){
|
||||
um_modal_size( size );
|
||||
|
||||
initImageUpload_UM( jQuery('.um-modal:visible').find('.um-single-image-upload') );
|
||||
|
||||
initFileUpload_UM( jQuery('.um-modal:visible').find('.um-single-file-upload') );
|
||||
|
||||
um_modal_responsive();
|
||||
|
||||
@@ -22,13 +117,9 @@ function um_new_modal( id, size ){
|
||||
function um_modal_responsive() {
|
||||
|
||||
var modal = jQuery('.um-modal:visible');
|
||||
|
||||
|
||||
if ( modal.length ) {
|
||||
|
||||
var window_height_diff = jQuery(window).height() - modal.innerHeight();
|
||||
|
||||
var half_gap = window_height_diff / 2 + 'px';
|
||||
|
||||
|
||||
var element_width = jQuery(window).width();
|
||||
|
||||
modal.removeClass('uimob340');
|
||||
@@ -37,35 +128,49 @@ function um_modal_responsive() {
|
||||
if ( element_width <= 340 ) {
|
||||
|
||||
modal.addClass('uimob340');
|
||||
initCrop_UM();
|
||||
modal.animate({ 'bottom' : 0 }, 300);
|
||||
|
||||
} else if ( element_width <= 500 ) {
|
||||
|
||||
modal.addClass('uimob500');
|
||||
initCrop_UM();
|
||||
modal.animate({ 'bottom' : 0 }, 300);
|
||||
|
||||
} else if ( element_width <= 800 ) {
|
||||
|
||||
initCrop_UM();
|
||||
var half_gap = ( jQuery(window).height() - modal.innerHeight() ) / 2 + 'px';
|
||||
modal.animate({ 'bottom' : half_gap }, 300);
|
||||
|
||||
} else if ( element_width <= 960 ) {
|
||||
|
||||
initCrop_UM();
|
||||
var half_gap = ( jQuery(window).height() - modal.innerHeight() ) / 2 + 'px';
|
||||
modal.animate({ 'bottom' : half_gap }, 300);
|
||||
|
||||
} else if ( element_width > 960 ) {
|
||||
|
||||
initCrop_UM();
|
||||
var half_gap = ( jQuery(window).height() - modal.innerHeight() ) / 2 + 'px';
|
||||
modal.animate({ 'bottom' : half_gap }, 300);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function um_remove_modal(){
|
||||
jQuery('.um-single-image-preview.crop img').imgAreaSelect({ hide: true });
|
||||
|
||||
jQuery('.um-single-image-preview img').cropper("destroy");
|
||||
|
||||
jQuery('body,html').css("overflow", "auto");
|
||||
|
||||
jQuery(document).unbind('touchmove');
|
||||
|
||||
jQuery('.um-modal div[id^="um_"]').hide().appendTo('body');
|
||||
jQuery('.um-modal,.um-modal-overlay').remove();
|
||||
|
||||
}
|
||||
|
||||
function um_modal_size( aclass ) {
|
||||
@@ -97,6 +202,25 @@ jQuery(document).ready(function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
remove uploaded file
|
||||
**/
|
||||
jQuery(document).on('click', '.um-modal .um-single-file-preview a.cancel', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
var parent = jQuery(this).parents('.um-modal-body');
|
||||
|
||||
parent.find('.um-single-file-preview').hide();
|
||||
|
||||
parent.find('.ajax-upload-dragdrop').show();
|
||||
|
||||
parent.find('.um-modal-btn.um-finish-upload').addClass('disabled');
|
||||
|
||||
um_modal_responsive();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
remove uploaded image
|
||||
**/
|
||||
@@ -105,6 +229,10 @@ jQuery(document).ready(function() {
|
||||
|
||||
var parent = jQuery(this).parents('.um-modal-body');
|
||||
|
||||
parent.find('.um-single-image-preview img').cropper("destroy");
|
||||
|
||||
parent.find('.um-single-image-preview img').attr('src', '');
|
||||
|
||||
parent.find('.um-single-image-preview').hide();
|
||||
|
||||
parent.find('.ajax-upload-dragdrop').show();
|
||||
@@ -117,19 +245,80 @@ jQuery(document).ready(function() {
|
||||
});
|
||||
|
||||
/**
|
||||
finish upload
|
||||
finish file upload
|
||||
**/
|
||||
jQuery(document).on('click', '.um-finish-upload', function(){
|
||||
jQuery(document).on('click', '.um-finish-upload.file', function(){
|
||||
|
||||
var key = jQuery(this).attr('data-key');
|
||||
|
||||
var src = jQuery(this).parents('.um-modal-body').find('.um-single-image-preview img').attr('src');
|
||||
|
||||
jQuery('.um-single-image-preview[data-key='+key+']').fadeIn().find('img').attr('src', src);
|
||||
var preview = jQuery(this).parents('.um-modal-body').find('.um-single-file-preview').html();
|
||||
|
||||
um_remove_modal();
|
||||
|
||||
jQuery('.um-single-image-preview[data-key='+key+']').parents('.um-field').find('.um-btn-auto-width').html('Change/Modify Photo');
|
||||
jQuery('.um-single-file-preview[data-key='+key+']').fadeIn().html( preview );
|
||||
|
||||
jQuery('.um-single-file-preview[data-key='+key+']').parents('.um-field').find('.um-btn-auto-width').html( jQuery(this).attr('data-change') );
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
finish image upload
|
||||
**/
|
||||
jQuery(document).on('click', '.um-finish-upload.image', function(){
|
||||
|
||||
var elem = jQuery(this);
|
||||
var key = jQuery(this).attr('data-key');
|
||||
var img_c = jQuery(this).parents('.um-modal-body').find('.um-single-image-preview');
|
||||
var src = img_c.find('img').attr('src');
|
||||
var coord = img_c.attr('data-coord');
|
||||
|
||||
if ( jQuery(this).parents('#um_upload_single').attr('data-user_id') ) {
|
||||
var user_id = jQuery(this).parents('#um_upload_single').attr('data-user_id');
|
||||
} else {
|
||||
var user_id = 0;
|
||||
}
|
||||
|
||||
if ( coord ) { // crop image first before processing
|
||||
|
||||
jQuery(this).html( jQuery(this).attr('data-processing') ).addClass('disabled');
|
||||
|
||||
jQuery.ajax({
|
||||
url: ultimatemember_ajax_url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action: 'ultimatemember_resize_image',
|
||||
src : src,
|
||||
coord : coord,
|
||||
user_id : user_id,
|
||||
key: key,
|
||||
},
|
||||
success: function(data){
|
||||
|
||||
d = new Date();
|
||||
|
||||
if ( key == 'profile_photo') {
|
||||
jQuery('.um-profile-photo-img img').attr('src', data + "?"+d.getTime());
|
||||
}
|
||||
|
||||
if ( key == 'cover_photo') {
|
||||
jQuery('.um-cover-e').empty().html('<a href="#"><img src="' + data + "?"+d.getTime() + '" alt="" /></a>');
|
||||
jQuery('.um-cover-overlay').show();
|
||||
}
|
||||
|
||||
jQuery('.um-single-image-preview[data-key='+key+']').fadeIn().find('img').attr('src', data + "?"+d.getTime());
|
||||
um_remove_modal();
|
||||
jQuery('.um-single-image-preview[data-key='+key+']').parents('.um-field').find('.um-btn-auto-width').html( elem.attr('data-change') );
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
d = new Date();
|
||||
jQuery('.um-single-image-preview[data-key='+key+']').fadeIn().find('img').attr('src', src + "?"+d.getTime());
|
||||
um_remove_modal();
|
||||
jQuery('.um-single-image-preview[data-key='+key+']').parents('.um-field').find('.um-btn-auto-width').html( elem.attr('data-change') );
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -148,6 +337,19 @@ jQuery(document).ready(function() {
|
||||
|
||||
if ( jQuery(this).data('modal-copy') ) {
|
||||
jQuery('#' + modal_id).html( jQuery(this).parents('.um-field').find('.um-modal-hidden-content').html() );
|
||||
|
||||
if ( jQuery(this).parents('.um-profile-photo').attr('data-user_id') ) {
|
||||
jQuery('#' + modal_id).attr('data-user_id', jQuery(this).parents('.um-profile-photo').attr('data-user_id') );
|
||||
}
|
||||
|
||||
if ( jQuery(this).parents('.um-cover').attr('data-ratio') ) {
|
||||
jQuery('#' + modal_id).attr('data-ratio', jQuery(this).parents('.um-cover').attr('data-ratio') );
|
||||
}
|
||||
|
||||
if ( jQuery(this).parents('.um-cover').attr('data-user_id') ) {
|
||||
jQuery('#' + modal_id).attr('data-user_id', jQuery(this).parents('.um-cover').attr('data-user_id') );
|
||||
}
|
||||
|
||||
um_new_modal( modal_id, size );
|
||||
} else {
|
||||
um_new_modal( modal_id, size );
|
||||
|
||||
@@ -8,5 +8,57 @@ jQuery(document).ready(function() {
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/* No need to allow # */
|
||||
jQuery(document).on('click', '.um-cover a', function(e){
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Reset profile photo */
|
||||
jQuery(document).on('click', '.um-reset-profile-photo', function(e){
|
||||
|
||||
jQuery('.um-profile-photo-img img').attr('src', jQuery(this).attr('data-default_src') );
|
||||
|
||||
user_id = jQuery(this).attr('data-user_id');
|
||||
metakey = 'profile_photo';
|
||||
|
||||
jQuery.ajax({
|
||||
url: ultimatemember_ajax_url,
|
||||
type: 'post',
|
||||
data: {
|
||||
action: 'ultimatemember_delete_profile_photo',
|
||||
metakey: metakey,
|
||||
user_id: user_id
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* Reset cover photo */
|
||||
jQuery(document).on('click', '.um-reset-cover-photo', function(e){
|
||||
|
||||
jQuery('.um-cover-overlay').hide();
|
||||
|
||||
jQuery('.um-cover-e').html('<a href="#" class="um-cover-add um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width"><span class="um-cover-add-i"><i class="um-icon-plus-add um-tip-n" title="Upload a cover photo"></i></span></a>');
|
||||
|
||||
jQuery('.um-dropdown').hide();
|
||||
|
||||
um_responsive();
|
||||
|
||||
user_id = jQuery(this).attr('data-user_id');
|
||||
metakey = 'cover_photo';
|
||||
|
||||
jQuery.ajax({
|
||||
url: ultimatemember_ajax_url,
|
||||
type: 'post',
|
||||
data: {
|
||||
action: 'ultimatemember_delete_cover_photo',
|
||||
metakey: metakey,
|
||||
user_id: user_id
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,5 +1,57 @@
|
||||
function um_responsive(){
|
||||
function UM_domenus(){
|
||||
|
||||
jQuery('.um-dropdown').each(function(){
|
||||
|
||||
var menu = jQuery(this);
|
||||
var element = jQuery(this).attr('data-element');
|
||||
var position = jQuery(this).attr('data-position');
|
||||
|
||||
jQuery(element).addClass('um-trigger-menu-on-'+menu.attr('data-trigger'));
|
||||
|
||||
if ( position == 'bc' ){
|
||||
|
||||
if ( 200 > jQuery(element).find('img').width() ) {
|
||||
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 ) + ( ( jQuery(element).find('img').width() - 200 ) / 2 );
|
||||
} else {
|
||||
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 );
|
||||
}
|
||||
|
||||
top_ = parseInt( jQuery(element).find('a').css('top') );
|
||||
|
||||
if ( top_ ) {
|
||||
top_p = jQuery(element).find('img').height() + 4 + top_;
|
||||
left_gap = 4;
|
||||
} else {
|
||||
top_p = jQuery(element).find('img').height() + 4;
|
||||
left_gap = 0;
|
||||
}
|
||||
|
||||
if ( top_p == 4 && element == 'div.um-cover' ) {
|
||||
top_p = jQuery(element).height() / 2 + ( menu.height() / 2 );
|
||||
}
|
||||
|
||||
menu.css({
|
||||
'top' : top_p,
|
||||
'width': 200,
|
||||
'left': left_p + left_gap,
|
||||
'text-align' : 'center',
|
||||
});
|
||||
|
||||
menu.find('.um-dropdown-arr').find('i').addClass('um-icon-arrow-sans-up');
|
||||
|
||||
menu.find('.um-dropdown-arr').css({
|
||||
'top' : '-18px',
|
||||
'left' : ( menu.width() / 2 ) - 12,
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function um_responsive(){
|
||||
|
||||
// responsive um shortcode
|
||||
jQuery('.um').each(function(){
|
||||
|
||||
element_width = jQuery(this).width();
|
||||
@@ -48,19 +100,39 @@ function um_responsive(){
|
||||
jQuery(this).removeClass('uimob960');
|
||||
|
||||
}
|
||||
|
||||
jQuery('.um-members').each(function(){
|
||||
UM_Member_Grid( jQuery(this) );
|
||||
});
|
||||
|
||||
// account nav
|
||||
if ( jQuery('.um-account-nav').length > 0 && jQuery('.um-account-side').is(':visible') && jQuery('.um-account-tab:visible').length == 0 ) {
|
||||
jQuery('.um-account-side li a.current').trigger('click');
|
||||
}
|
||||
|
||||
// show
|
||||
jQuery(this).css('opacity',1);
|
||||
|
||||
});
|
||||
|
||||
// responsive cover
|
||||
jQuery('.um-cover, .um-member-cover').each(function(){
|
||||
|
||||
var elem = jQuery(this);
|
||||
var ratio = elem.data('ratio');
|
||||
var width = elem.width();
|
||||
var ratios = ratio.split(':');
|
||||
|
||||
calcHeight = Math.round( width / ratios[0] ) + 'px';
|
||||
elem.height( calcHeight );
|
||||
elem.find('.um-cover-add').height( calcHeight );
|
||||
|
||||
});
|
||||
|
||||
// members directory
|
||||
jQuery('.um-members').each(function(){
|
||||
UM_Member_Grid( jQuery(this) );
|
||||
});
|
||||
|
||||
// menus
|
||||
UM_domenus();
|
||||
|
||||
}
|
||||
|
||||
/* Run only when window is loaded */
|
||||
@@ -74,6 +146,8 @@ jQuery(window).load(function() {
|
||||
/* Run only when window is resized */
|
||||
jQuery(window).resize(function() {
|
||||
|
||||
jQuery('.um-single-image-preview.crop:visible img').cropper("destroy");
|
||||
|
||||
um_responsive();
|
||||
um_modal_responsive();
|
||||
|
||||
|
||||
+38
-100
@@ -1,12 +1,40 @@
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
/* Tooltips */
|
||||
/* dropdown menu links */
|
||||
jQuery(document).on('click', '.um-dropdown a', function(e){
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
/* trigger dropdown on click */
|
||||
jQuery(document).on('click', '.um-trigger-menu-on-click', function(e){
|
||||
e.preventDefault();
|
||||
jQuery('.um-dropdown').hide();
|
||||
menu = jQuery(this).find('.um-dropdown');
|
||||
menu.show();
|
||||
return false;
|
||||
});
|
||||
|
||||
/* hide dropdown */
|
||||
jQuery(document).on('click', '.um-dropdown-hide', function(e){
|
||||
menu = jQuery(this).parents('.um-dropdown');
|
||||
menu.hide();
|
||||
});
|
||||
|
||||
/* manual triggers */
|
||||
jQuery(document).on('click', 'a.um-manual-trigger', function(){
|
||||
var child = jQuery(this).attr('data-child');
|
||||
var parent = jQuery(this).attr('data-parent');
|
||||
jQuery(this).parents( parent ).find( child ).trigger('click');
|
||||
});
|
||||
|
||||
/* tooltips */
|
||||
jQuery('.um-tip-n').tipsy({gravity: 'n', opacity: 1, live: true, offset: 3 });
|
||||
jQuery('.um-tip-w').tipsy({gravity: 'w', opacity: 1, live: true, offset: 3 });
|
||||
jQuery('.um-tip-e').tipsy({gravity: 'e', opacity: 1, live: true, offset: 3 });
|
||||
jQuery('.um-tip-s').tipsy({gravity: 's', opacity: 1, live: true, offset: 3 });
|
||||
|
||||
/* Custom Radio Buttons */
|
||||
/* custom radio buttons */
|
||||
jQuery('.um-field-radio').mouseenter(function(){
|
||||
if (!jQuery(this).hasClass('active')) {
|
||||
jQuery(this).find('i').removeClass().addClass('um-icon-check-3');
|
||||
@@ -26,7 +54,7 @@ jQuery(document).ready(function() {
|
||||
this_field.find('i').removeClass('um-icon-blank').addClass('um-icon-check-3');
|
||||
});
|
||||
|
||||
/* Custom Checkbox Buttons */
|
||||
/* custom checkbox buttons */
|
||||
jQuery('.um-field-checkbox').mouseenter(function(){
|
||||
if (!jQuery(this).hasClass('active')) {
|
||||
jQuery(this).find('i').removeClass().addClass('um-icon-cross');
|
||||
@@ -51,7 +79,7 @@ jQuery(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
/* Date picker */
|
||||
/* datepicker */
|
||||
jQuery('.um-datepicker').pickadate({
|
||||
min: [1900,1,1],
|
||||
max: true,
|
||||
@@ -60,7 +88,7 @@ jQuery(document).ready(function() {
|
||||
hiddenSuffix: '__true'
|
||||
});
|
||||
|
||||
/* Time picker */
|
||||
/* timepicker */
|
||||
jQuery('.um-timepicker').pickatime({
|
||||
formatSubmit: 'HH:i',
|
||||
hiddenSuffix: '__true'
|
||||
@@ -95,108 +123,18 @@ jQuery(document).ready(function() {
|
||||
/* remove uploaded image */
|
||||
jQuery(document).on('click', '.um .um-single-image-preview a.cancel', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
var parent = jQuery(this).parents('.um-field');
|
||||
|
||||
parent.find('.um-single-image-preview').hide();
|
||||
|
||||
parent.find('.um-btn-auto-width').html('Upload');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/* File Upload */
|
||||
jQuery(".um-single-file-upload").each(function(){
|
||||
|
||||
var trigger = jQuery(this);
|
||||
|
||||
if (trigger.data('upload_help_text')){
|
||||
upload_help_text = '<span class="help">' + trigger.data('upload_help_text') + '</span>';
|
||||
} else {
|
||||
upload_help_text = '';
|
||||
}
|
||||
|
||||
if ( trigger.data('icon') ) {
|
||||
icon = '<span class="icon"><i class="'+ trigger.data('icon') + '"></i></span>';
|
||||
} else {
|
||||
icon = '';
|
||||
}
|
||||
|
||||
if ( trigger.data('upload_text') ) {
|
||||
upload_text = '<span class="str">' + trigger.data('upload_text') + '</span>';
|
||||
} else {
|
||||
upload_text = '';
|
||||
}
|
||||
|
||||
trigger.uploadFile({
|
||||
url: ultimatemember_file_upload_url,
|
||||
method: "POST",
|
||||
multiple: false,
|
||||
formData: {key: trigger.data('key'), set_id: trigger.data('set_id'), set_mode: trigger.data('set_mode') },
|
||||
fileName: trigger.data('key'),
|
||||
allowedTypes: trigger.data('allowed_types'),
|
||||
maxFileSize: trigger.data('max_size'),
|
||||
dragDropStr: icon + upload_text + upload_help_text,
|
||||
sizeErrorStr: trigger.data('max_size_error'),
|
||||
extErrorStr: trigger.data('extension_error'),
|
||||
maxFileCountErrorStr: trigger.data('max_files_error'),
|
||||
maxFileCount: 1,
|
||||
showDelete: false,
|
||||
showAbort: false,
|
||||
showDone: false,
|
||||
showFileCounter: false,
|
||||
showStatusAfterSuccess: false,
|
||||
onSubmit:function(files){
|
||||
|
||||
trigger.parents('.um-field').find('.um-error-block').remove();
|
||||
|
||||
},
|
||||
onSuccess:function(files,data,xhr){
|
||||
|
||||
trigger.selectedFiles = 0;
|
||||
|
||||
data = jQuery.parseJSON(data);
|
||||
if (data.error && data.error != '') {
|
||||
|
||||
trigger.parents('.um-field').append('<div class="um-error-block">'+data.error+'</div>');
|
||||
|
||||
} else {
|
||||
|
||||
trigger.parents('.um-field').find('.ajax-upload-dragdrop').fadeOut( function() {
|
||||
trigger.parents('.um-field').find('.um-single-file-preview').fadeIn();
|
||||
});
|
||||
|
||||
jQuery.each( data, function(key, value) {
|
||||
|
||||
if (key == 'icon') {
|
||||
trigger.parents('.um-field').find('.um-single-fileinfo i').removeClass().addClass(value);
|
||||
} else if ( key == 'icon_bg' ) {
|
||||
trigger.parents('.um-field').find('.um-single-fileinfo span.icon').css({'background-color' : value } );
|
||||
} else if ( key == 'filename' ) {
|
||||
trigger.parents('.um-field').find('.um-single-fileinfo span.filename').html(value);
|
||||
} else {
|
||||
trigger.parents('.um-field').find('.um-single-fileinfo a').attr('href', value);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* Remove a single file upload */
|
||||
jQuery(document).on('click', '.um-single-file-preview a.cancel', function(e){
|
||||
/* remove uploaded file */
|
||||
jQuery(document).on('click', '.um .um-single-file-preview a.cancel', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
var trigger = jQuery(this).parents('.um-field').find('.um-single-file-upload');
|
||||
|
||||
trigger.parents('.um-field').find('.um-single-file-preview').fadeOut(function(){
|
||||
trigger.parents('.um-field').find('.ajax-upload-dragdrop').fadeIn();
|
||||
});
|
||||
|
||||
var parent = jQuery(this).parents('.um-field');
|
||||
parent.find('.um-single-file-preview').hide();
|
||||
parent.find('.um-btn-auto-width').html('Upload');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -16,4 +16,69 @@
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/***
|
||||
*** @remove profile photo silently
|
||||
***/
|
||||
add_action('wp_ajax_nopriv_ultimatemember_delete_profile_photo', 'ultimatemember_delete_profile_photo');
|
||||
add_action('wp_ajax_ultimatemember_delete_profile_photo', 'ultimatemember_delete_profile_photo');
|
||||
function ultimatemember_delete_profile_photo(){
|
||||
global $ultimatemember;
|
||||
extract($_REQUEST);
|
||||
|
||||
if ( !um_can_edit_profile( $user_id ) ) die( __('You can not edit this user') );
|
||||
|
||||
$ultimatemember->files->delete_core_user_photo( $user_id, 'profile_photo' );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @remove cover photo silently
|
||||
***/
|
||||
add_action('wp_ajax_nopriv_ultimatemember_delete_cover_photo', 'ultimatemember_delete_cover_photo');
|
||||
add_action('wp_ajax_ultimatemember_delete_cover_photo', 'ultimatemember_delete_cover_photo');
|
||||
function ultimatemember_delete_cover_photo(){
|
||||
global $ultimatemember;
|
||||
extract($_REQUEST);
|
||||
|
||||
if ( !um_can_edit_profile( $user_id ) ) die( __('You can not edit this user') );
|
||||
|
||||
$ultimatemember->files->delete_core_user_photo( $user_id, 'cover_photo' );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @resampling/crop images
|
||||
***/
|
||||
add_action('wp_ajax_nopriv_ultimatemember_resize_image', 'ultimatemember_resize_image');
|
||||
add_action('wp_ajax_ultimatemember_resize_image', 'ultimatemember_resize_image');
|
||||
function ultimatemember_resize_image(){
|
||||
global $ultimatemember;
|
||||
$output = 0;
|
||||
|
||||
extract($_REQUEST);
|
||||
|
||||
if ( !isset($src) || !isset($coord) ) die( __('Invalid parameters') );
|
||||
|
||||
$coord_n = substr_count($coord, ",");
|
||||
if ( $coord_n != 3 ) die( __('Invalid coordinates') );
|
||||
|
||||
$um_is_temp_image = um_is_temp_image( $src );
|
||||
if ( !$um_is_temp_image ) die( __('Invalid Image file') );
|
||||
|
||||
$crop = explode(',', $coord );
|
||||
$crop = array_map('intval', $crop);
|
||||
|
||||
$uri = $ultimatemember->files->resize_image( $um_is_temp_image, $crop );
|
||||
|
||||
// If you're updating a user
|
||||
if ( isset( $user_id ) && $user_id > 0 ) {
|
||||
$uri = $ultimatemember->files->new_user_upload( $user_id, $um_is_temp_image, $key );
|
||||
}
|
||||
|
||||
$output = $uri;
|
||||
|
||||
if(is_array($output)){ print_r($output); }else{ echo $output; } die;
|
||||
|
||||
}
|
||||
@@ -191,6 +191,8 @@
|
||||
|
||||
if ( um_members('users_per_page') ) {
|
||||
|
||||
$default_size = str_replace( 'px', '', um_get_option('profile_photosize') );
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-members">
|
||||
@@ -202,13 +204,13 @@
|
||||
<div class="um-member <?php if ($cover_photos) { echo 'with-cover'; } ?>">
|
||||
|
||||
<?php if ($cover_photos) { ?>
|
||||
<div class="um-member-cover">
|
||||
<div class="um-member-cover-e"><?php echo um_user('cover_photo'); ?></div>
|
||||
<div class="um-member-cover" data-ratio="<?php echo um_get_option('profile_cover_ratio'); ?>">
|
||||
<div class="um-member-cover-e"><?php echo um_user('cover_photo', 300); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($profile_photo) { ?>
|
||||
<div class="um-member-photo"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('profile_photo', 90); ?></a></div>
|
||||
<div class="um-member-photo"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('profile_photo', $default_size ); ?></a></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-member-card <?php if (!$profile_photo) { echo 'no-photo'; } ?>">
|
||||
|
||||
+99
-18
@@ -46,21 +46,62 @@
|
||||
add_action('um_profile_header_cover_area', 'um_profile_header_cover_area' );
|
||||
function um_profile_header_cover_area( $args ) {
|
||||
global $ultimatemember;
|
||||
|
||||
|
||||
if ( $args['cover_enabled'] == 1 ) {
|
||||
|
||||
$overlay = '<span class="um-cover-overlay">
|
||||
<span class="um-cover-overlay-s">
|
||||
<ins>
|
||||
<i class="um-icon-photo-2"></i>
|
||||
<span class="um-cover-overlay-t">'.__('Change your cover photo').'</span>
|
||||
</ins>
|
||||
</span>
|
||||
</span>';
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-cover">
|
||||
|
||||
<div class="um-cover <?php if ( um_profile('cover_photo') ) echo 'has-cover'; ?>" data-user_id="<?php echo um_profile_id(); ?>" data-ratio="<?php echo $args['cover_ratio']; ?>">
|
||||
|
||||
<?php
|
||||
|
||||
echo $ultimatemember->menu->new_ui( 'bc', 'div.um-cover', 'click', array(
|
||||
'<a href="#" class="um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width">'.__('Change cover photo','ultimatemember').'</a>',
|
||||
'<a href="#" class="um-reset-cover-photo" data-user_id="'.um_profile_id().'">'.__('Remove','ultimatemember').'</a>',
|
||||
'<a href="#" class="um-dropdown-hide">'.__('Cancel','ultimatemember').'</a>',
|
||||
), 'can_edit_user' );
|
||||
|
||||
?>
|
||||
|
||||
<?php $ultimatemember->fields->add_hidden_field( 'cover_photo' ); ?>
|
||||
|
||||
<?php echo $overlay; ?>
|
||||
|
||||
<div class="um-cover-e">
|
||||
<?php if ( um_user('cover_photo') ) { echo um_user('cover_photo'); } else { ?>
|
||||
<a href="#" class="um-cover-add"><span class="um-cover-add-i"><i class="um-icon-plus-add um-tip-n" title="Upload a cover photo"></i></span></a>
|
||||
|
||||
<?php if ( um_profile('cover_photo') ) { ?>
|
||||
|
||||
<?php
|
||||
|
||||
if( $ultimatemember->mobile->isMobile() ){
|
||||
echo um_user('cover_photo', 300);
|
||||
} else {
|
||||
echo um_user('cover_photo', 1000);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<a href="#" class="um-cover-add um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width"><span class="um-cover-add-i"><i class="um-icon-plus-add um-tip-n" title="<?php _e('Upload a cover photo','ultimatemember'); ?>"></i></span></a>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,14 +119,54 @@
|
||||
$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-icon-camera-5"></i>
|
||||
<span class="um-profile-photo-overlay-t">'.__('Change your profile photo').'</span>
|
||||
</ins>
|
||||
</span>
|
||||
</span>';
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-header<?php echo $classes; ?>">
|
||||
|
||||
<?php do_action('um_pre_header_editprofile', $args); ?>
|
||||
|
||||
<div class="um-profile-photo">
|
||||
<a href="<?php echo um_user_profile_url(); ?>" class="um-profile-photo-img"><?php echo um_user('profile_photo'); ?></a>
|
||||
<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"><?php echo $overlay . um_user('profile_photo', $default_size ); ?></a>
|
||||
|
||||
<?php
|
||||
|
||||
if ( um_can_edit_profile( um_profile_id() ) ) {
|
||||
|
||||
$ultimatemember->fields->add_hidden_field( 'profile_photo' );
|
||||
|
||||
if ( !um_profile('profile_photo') ) { // has profile photo
|
||||
|
||||
echo $ultimatemember->menu->new_ui( 'bc', 'div.um-profile-photo', 'click', 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>',
|
||||
), 'can_edit_user' );
|
||||
|
||||
} else if ( $ultimatemember->fields->editing == true ) {
|
||||
|
||||
echo $ultimatemember->menu->new_ui( 'bc', 'div.um-profile-photo', 'click', 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>',
|
||||
), 'can_edit_user' );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="um-profile-meta">
|
||||
@@ -95,15 +176,15 @@
|
||||
<div class="um-clear"></div>
|
||||
</div>
|
||||
|
||||
<?php if ( isset( $args['metafields'] ) && !empty( $args['metafields'] ) ) { ?>
|
||||
<div class="um-meta">
|
||||
<span>Chief Executive Officer of Ultimate Member</span>
|
||||
<span class="b">•</span>
|
||||
<span>28 Years Old</span>
|
||||
<span class="b">•</span>
|
||||
<span>United Kingdom</span>
|
||||
|
||||
<?php echo $ultimatemember->profile->show_meta( $args['metafields'] ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( um_user('description') ) { ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( um_user('description') && $args['show_bio'] ) { ?>
|
||||
<div class="um-meta-text"><?php echo um_user('description'); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
@@ -161,9 +242,9 @@
|
||||
if ( isset( $ultimatemember->user->cannot_edit ) && $ultimatemember->user->cannot_edit == 1 ) return;
|
||||
|
||||
if ( $ultimatemember->fields->editing == true ) {
|
||||
$output .= '<div class="um-profile-edit um-profile-headericon"><a href="#" title="Save Profile" class="um-profile-save um-tip-n"><i class="um-icon-check"></i></a></div>';
|
||||
$output .= '<div class="um-profile-edit um-profile-headericon"><a href="#" title="Save Profile" class="um-profile-save um-tip-e"><i class="um-icon-check"></i></a></div>';
|
||||
} else {
|
||||
$output .= '<div class="um-profile-edit um-profile-headericon"><a href="'.um_edit_my_profile_uri().'" title="Edit Profile" class="um-tip-n"><i class="um-icon-cog-2"></i></a></div>';
|
||||
$output .= '<div class="um-profile-edit um-profile-headericon"><a href="'.um_edit_my_profile_uri().'" title="Edit Profile" class="um-tip-e"><i class="um-icon-cog-2"></i></a></div>';
|
||||
}
|
||||
|
||||
echo $output;
|
||||
|
||||
@@ -520,6 +520,31 @@ class UM_Builtin {
|
||||
'placeholder' => 'Enter a bit about yourself...',
|
||||
),
|
||||
|
||||
'profile_photo' => array(
|
||||
'title' => 'Profile Photo',
|
||||
'metakey' => 'profile_photo',
|
||||
'type' => 'image',
|
||||
'label' => 'Change your profile photo',
|
||||
'upload_text' => 'Upload your photo here',
|
||||
'icon' => 'um-icon-camera-5',
|
||||
'crop' => 1,
|
||||
'min_width' => str_replace('px','',um_get_option('profile_photosize')),
|
||||
'min_height' => str_replace('px','',um_get_option('profile_photosize')),
|
||||
),
|
||||
|
||||
'cover_photo' => array(
|
||||
'title' => 'Cover Photo',
|
||||
'metakey' => 'cover_photo',
|
||||
'type' => 'image',
|
||||
'label' => 'Change your cover photo',
|
||||
'upload_text' => 'Upload profile cover here',
|
||||
'icon' => 'um-icon-photo-2',
|
||||
'crop' => 2,
|
||||
'modal_size' => 'large',
|
||||
'ratio' => str_replace(':1','',um_get_option('profile_cover_ratio')),
|
||||
'min_width' => 1000,
|
||||
),
|
||||
|
||||
'birth_date' => array(
|
||||
'title' => 'Birth Date',
|
||||
'metakey' => 'birth_date',
|
||||
|
||||
+131
-35
@@ -11,6 +11,27 @@ class UM_Fields {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @hidden fields inside shortcode
|
||||
***/
|
||||
function add_hidden_field( $field ) {
|
||||
global $ultimatemember;
|
||||
echo '<div style="display: none !important;">';
|
||||
|
||||
$fields = $ultimatemember->builtin->get_specific_fields( $field );
|
||||
|
||||
$output = null;
|
||||
|
||||
foreach( $fields as $key => $data ) {
|
||||
$output .= $ultimatemember->fields->edit_field( $key, $data );
|
||||
}
|
||||
|
||||
echo $output;
|
||||
|
||||
echo '</div>';
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @detect if we're editing profile in shortcode
|
||||
***/
|
||||
@@ -221,13 +242,23 @@ class UM_Fields {
|
||||
$output = null;
|
||||
$output .= '<div class="um-field-label">';
|
||||
|
||||
if ( isset($data['icon']) && $data['icon'] != '' && ( $this->field_icons == 'label' || $this->viewing == true ) ) {
|
||||
if ( isset($data['icon']) && $data['icon'] != '' && isset( $this->field_icons ) && ( $this->field_icons == 'label' || $this->viewing == true ) ) {
|
||||
$output .= '<div class="um-field-label-icon"><i class="'.$data['icon'].'"></i></div>';
|
||||
}
|
||||
|
||||
$output .= '<label for="'.$key.$ultimatemember->form->form_suffix.'">'.$label.'</label>';
|
||||
|
||||
if ( isset( $data['help'] ) && $this->viewing == false ) {$output .= '<span class="um-tip um-tip-s" title="'.$data['help'].'"><i class="um-icon-help-circled"></i></span>';}
|
||||
if ( isset( $data['help'] ) && !empty( $data['help'] ) && $this->viewing == false ) {
|
||||
|
||||
if ( !$ultimatemember->mobile->isMobile() ) {
|
||||
$output .= '<span class="um-tip um-tip-w" title="'.$data['help'].'"><i class="um-icon-help-circled"></i></span>';
|
||||
}
|
||||
|
||||
if ( $ultimatemember->mobile->isMobile() ) {
|
||||
$output .= '<span class="um-tip-text">'. $data['help'] . '</span>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$output .= '<div class="um-clear"></div></div>';
|
||||
|
||||
@@ -260,7 +291,7 @@ class UM_Fields {
|
||||
$classes .= 'um-timepicker ';
|
||||
}
|
||||
|
||||
if ( isset($data['icon']) && $this->field_icons == 'field' ) {
|
||||
if ( isset($data['icon']) && $data['icon'] && $this->field_icons == 'field' ) {
|
||||
$classes .= 'um-iconed';
|
||||
}
|
||||
|
||||
@@ -594,7 +625,29 @@ class UM_Fields {
|
||||
case 'image':
|
||||
|
||||
if ( !isset( $array['crop'] ) ) $array['crop'] = 0;
|
||||
|
||||
|
||||
if ( $array['crop'] == 0 ) {
|
||||
$array['crop_data'] = 0;
|
||||
} else if ( $array['crop'] == 1 ) {
|
||||
$array['crop_data'] = 'square';
|
||||
} else if ( $array['crop'] == 2 ) {
|
||||
$array['crop_data'] = 'cover';
|
||||
} else {
|
||||
$array['crop_data'] = 'user';
|
||||
}
|
||||
|
||||
if ( !isset( $array['modal_size'] ) ) $array['modal_size'] = 'normal';
|
||||
|
||||
if ( $array['crop'] > 0 ) {
|
||||
$array['crop_class'] = 'crop';
|
||||
} else {
|
||||
$array['crop_class'] = '';
|
||||
}
|
||||
|
||||
if ( !isset( $array['ratio'] ) ) $array['ratio'] = 1.0;
|
||||
if ( !isset( $array['min_width'] ) ) $array['min_width'] = '';
|
||||
if ( !isset( $array['min_height'] ) ) $array['min_height'] = '';
|
||||
|
||||
if (!isset($array['invalid_image'])) $array['invalid_image'] = "Please upload a valid image!";
|
||||
if (!isset($array['allowed_types'])) {
|
||||
$array['allowed_types'] = "gif,jpg,jpeg,png";
|
||||
@@ -615,6 +668,8 @@ class UM_Fields {
|
||||
|
||||
case 'file':
|
||||
|
||||
if ( !isset( $array['modal_size'] ) ) $array['modal_size'] = 'normal';
|
||||
|
||||
if (!isset($array['allowed_types'])) {
|
||||
$array['allowed_types'] = "pdf,txt";
|
||||
} else {
|
||||
@@ -685,7 +740,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -719,7 +774,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -748,7 +803,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -782,7 +837,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -809,7 +864,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -842,7 +897,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -870,7 +925,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -898,7 +953,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
if ( isset($icon) && $this->field_icons == 'field' ) {
|
||||
if ( isset($icon) && $icon && $this->field_icons == 'field' ) {
|
||||
|
||||
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
|
||||
|
||||
@@ -977,19 +1032,13 @@ class UM_Fields {
|
||||
$output .= $this->field_label($label, $key, $data);
|
||||
}
|
||||
|
||||
if ( $crop ) {
|
||||
$crop_class = 'crop';
|
||||
} else {
|
||||
$crop_class = '';
|
||||
}
|
||||
|
||||
$modal_label = ( isset( $data['label'] ) ) ? $data['label'] : __('Upload Photo','ultimatemember');
|
||||
|
||||
$output .= '<div class="um-field-area" style="text-align: center">
|
||||
|
||||
<div class="um-single-image-preview '. $crop_class .'" data-key="'.$key.'"><a href="#" class="cancel"><i class="um-icon-remove"></i></a><img src="" alt="" /></div>
|
||||
<div class="um-single-image-preview '. $crop_class .'" data-crop="'.$crop_data.'" data-key="'.$key.'"><a href="#" class="cancel"><i class="um-icon-remove"></i></a><img src="" alt="" /></div>
|
||||
|
||||
<a href="#" data-modal="um_upload_image" data-modal-copy="1" class="um-button um-btn-auto-width">'. $button_text . '</a>
|
||||
<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>
|
||||
|
||||
</div>';
|
||||
|
||||
@@ -1000,12 +1049,20 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-modal-body">';
|
||||
|
||||
$output .= '<div class="um-single-image-preview '. $crop_class .'"><a href="#" class="cancel"><i class="um-icon-remove"></i></a><img src="" alt="" /></div>';
|
||||
$output .= '<div class="um-single-image-upload" data-icon="'.$icon.'" data-set_id="'.$this->set_id.'" data-set_mode="'.$this->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>';
|
||||
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-remove"></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 disabled" data-key="'.$key.'"> ' . __('Apply','ultimatemember') . '</a>
|
||||
<a href="#" class="um-modal-btn um-finish-upload image disabled" data-key="'.$key.'" data-change="'.__('Change photo').'" data-processing="'.__('Processing...','ultimatemember').'"> ' . __('Apply','ultimatemember') . '</a>
|
||||
<a href="#" class="um-modal-btn alt" data-action="um_remove_modal"> ' . __('Cancel','ultimatemember') . '</a>
|
||||
</div>
|
||||
<div class="um-clear"></div>
|
||||
@@ -1033,9 +1090,34 @@ class UM_Fields {
|
||||
$output .= $this->field_label($label, $key, $data);
|
||||
}
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
$modal_label = ( isset( $data['label'] ) ) ? $data['label'] : __('Upload Photo','ultimatemember');
|
||||
|
||||
$output .= '<div class="um-field-area" style="text-align: center">
|
||||
|
||||
<div class="um-single-file-preview" data-key="'.$key.'">
|
||||
|
||||
</div>
|
||||
|
||||
$output .= '<div class="um-single-file-preview">
|
||||
<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>
|
||||
|
||||
</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-file-preview">
|
||||
<a href="#" class="cancel"><i class="um-icon-remove"></i></a>
|
||||
<div class="um-single-fileinfo">
|
||||
<a href="#" target="_blank">
|
||||
@@ -1043,17 +1125,29 @@ class UM_Fields {
|
||||
<span class="filename"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
$output .= '<div class="um-single-file-upload" data-icon="'.$icon.'" data-set_id="'.$this->set_id.'" data-set_mode="'.$this->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>';
|
||||
|
||||
if ( $this->is_error($key) ) {
|
||||
$output .= $this->field_error( $this->show_error($key) );
|
||||
}
|
||||
</div>';
|
||||
$output .= '<div class="um-single-file-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 file disabled" data-key="'.$key.'" data-change="'.__('Change file').'" data-processing="'.__('Processing...','ultimatemember').'"> ' . __('Save','ultimatemember') . '</a>
|
||||
<a href="#" class="um-modal-btn alt" data-action="um_remove_modal"> ' . __('Cancel','ultimatemember') . '</a>
|
||||
</div>
|
||||
<div class="um-clear"></div>
|
||||
</div>';
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
/* end */
|
||||
|
||||
if ( $this->is_error($key) ) {
|
||||
$output .= $this->field_error( $this->show_error($key) );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
$output .= '</div>';
|
||||
break;
|
||||
|
||||
/* Select dropdown */
|
||||
@@ -1323,7 +1417,9 @@ class UM_Fields {
|
||||
}
|
||||
|
||||
// Custom filter for field output
|
||||
if ( isset( $this->set_mode ) ) {
|
||||
$output = apply_filters("um_{$key}_form_edit_field", $output, $this->set_mode);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
+183
-28
@@ -89,29 +89,20 @@ class UM_Files {
|
||||
$this->upload_dir = wp_upload_dir();
|
||||
|
||||
$this->upload_basedir = $this->upload_dir['basedir'] . '/ultimatemember/';
|
||||
|
||||
$this->upload_baseurl = $this->upload_dir['baseurl'] . '/ultimatemember/';
|
||||
|
||||
$this->upload_temp = $this->upload_basedir . 'temp/';
|
||||
$this->upload_temp_url = $this->upload_baseurl . 'temp/';
|
||||
|
||||
// create plugin uploads directory
|
||||
if (!file_exists( $this->upload_basedir )) {
|
||||
@mkdir( $this->upload_basedir, 0777, true);
|
||||
}
|
||||
|
||||
if (!file_exists( $this->upload_temp )) {
|
||||
@mkdir( $this->upload_temp , 0777, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Return upload directory
|
||||
***/
|
||||
function upload_dir(){
|
||||
return $this->upload_basedir;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Return upload URL
|
||||
***/
|
||||
function upload_url(){
|
||||
return $this->upload_baseurl;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Generate unique temp directory
|
||||
@@ -119,34 +110,41 @@ class UM_Files {
|
||||
function unique_dir(){
|
||||
global $ultimatemember;
|
||||
$unique_number = $ultimatemember->validation->generate();
|
||||
$array['dir'] = $this->upload_basedir . 'temp/'. $unique_number . '/';
|
||||
$array['url'] = $this->upload_baseurl . 'temp/'. $unique_number . '/';
|
||||
$array['dir'] = $this->upload_temp . $unique_number . '/';
|
||||
$array['url'] = $this->upload_temp_url . $unique_number . '/';
|
||||
return $array;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Fix image orientation
|
||||
*** @get path only without file name
|
||||
***/
|
||||
function fix_image_orientation(&$image, $source){
|
||||
function path_only( $file ) {
|
||||
return trailingslashit( dirname( $file ) );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @fix image orientation
|
||||
***/
|
||||
function fix_image_orientation($rotate, $source){
|
||||
$exif = @exif_read_data($source);
|
||||
|
||||
if (isset($exif['Orientation'])) {
|
||||
switch ($exif['Orientation']) {
|
||||
case 3:
|
||||
$image = imagerotate($image, 180, 0);
|
||||
$rotate = imagerotate($rotate, 180, 0);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$image = imagerotate($image, -90, 0);
|
||||
$rotate = imagerotate($rotate, -90, 0);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
$image = imagerotate($image, 90, 0);
|
||||
$rotate = imagerotate($rotate, 90, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $image;
|
||||
return $rotate;
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -154,7 +152,7 @@ class UM_Files {
|
||||
***/
|
||||
function create_and_copy_image($source, $destination, $quality = 100) {
|
||||
|
||||
$info = getimagesize($source);
|
||||
$info = @getimagesize($source);
|
||||
|
||||
if ($info['mime'] == 'image/jpeg'){
|
||||
|
||||
@@ -169,11 +167,26 @@ class UM_Files {
|
||||
$image = imagecreatefrompng($source);
|
||||
|
||||
}
|
||||
|
||||
list($w, $h) = @getimagesize( $source );
|
||||
if ( $w > um_get_option('image_max_width') ) {
|
||||
|
||||
$this->fix_image_orientation($image, $source);
|
||||
$ratio = round( $w / $h, 2 );
|
||||
$new_w = um_get_option('image_max_width');
|
||||
$new_h = round( $new_w / $ratio, 2 );
|
||||
|
||||
$image_p = imagecreatetruecolor( $new_w, $new_h );
|
||||
imagecopyresampled( $image_p, $image, 0, 0, 0, 0, $new_w, $new_h, $w, $h );
|
||||
$image_p = $this->fix_image_orientation($image_p, $source);
|
||||
imagejpeg( $image_p, $destination, $quality);
|
||||
|
||||
imagejpeg($image, $destination, $quality);
|
||||
|
||||
} else {
|
||||
|
||||
$image = $this->fix_image_orientation($image, $source);
|
||||
imagejpeg( $image, $destination, $quality);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -292,6 +305,10 @@ class UM_Files {
|
||||
$error = $data['extension_error'];
|
||||
} elseif ( isset($data['min_size']) && ( $fileinfo['size'] < $data['min_size'] ) ) {
|
||||
$error = $data['min_size_error'];
|
||||
} elseif ( isset($data['min_width']) && ( $fileinfo['width'] < $data['min_width'] ) ) {
|
||||
$error = sprintf(__('Your photo is too small. It must be at least %spx wide.'), $data['min_width']);
|
||||
} elseif ( isset($data['min_height']) && ( $fileinfo['height'] < $data['min_height'] ) ) {
|
||||
$error = sprintf(__('Your photo is too small. It must be at least %spx wide.'), $data['min_height']);
|
||||
}
|
||||
|
||||
return $error;
|
||||
@@ -325,4 +342,142 @@ class UM_Files {
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @delete a main user photo
|
||||
***/
|
||||
function delete_core_user_photo( $user_id, $type ) {
|
||||
|
||||
delete_user_meta( $user_id, $type );
|
||||
|
||||
$dir = $this->upload_basedir . $user_id . '/';
|
||||
$prefix = $type;
|
||||
chdir($dir);
|
||||
$matches = glob($prefix.'*',GLOB_MARK);
|
||||
|
||||
if( is_array($matches) && !empty($matches)) {
|
||||
foreach($matches as $match) {
|
||||
if( is_file($dir.$match) ) unlink($dir.$match);
|
||||
}
|
||||
}
|
||||
|
||||
if ( count(glob("$dir/*")) === 0) {
|
||||
rmdir( $dir );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @resize a local image
|
||||
***/
|
||||
function resize_image( $file, $crop ) {
|
||||
|
||||
$targ_x1 = $crop[0];
|
||||
$targ_y1 = $crop[1];
|
||||
$targ_x2 = $crop[2];
|
||||
$targ_y2 = $crop[3];
|
||||
|
||||
$img_r = imagecreatefromjpeg($file);
|
||||
$dst_r = imagecreatetruecolor( $targ_x2, $targ_y2 );
|
||||
|
||||
imagecopy( $dst_r, $img_r, 0, 0, $targ_x1, $targ_y1, $targ_x2, $targ_y2 );
|
||||
imagejpeg( $dst_r, $this->path_only( $file ) . basename( $file ), 100);
|
||||
|
||||
$split = explode('/ultimatemember/temp/', $file);
|
||||
return $this->upload_temp_url . $split[1];
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @new user upload
|
||||
***/
|
||||
function new_user_upload( $user_id, $source, $key ) {
|
||||
|
||||
// if he does not have uploads dir yet
|
||||
if ( !file_exists( $this->upload_basedir . $user_id . '/' ) ) {
|
||||
@mkdir( $this->upload_basedir . $user_id . '/' , 0777, true);
|
||||
}
|
||||
|
||||
// name and extension stuff
|
||||
$source_name = basename( $source );
|
||||
|
||||
if ( $key == 'profile_photo' ) {
|
||||
$source_name = 'profile_photo.jpg';
|
||||
}
|
||||
|
||||
if ( $key == 'cover_photo' ) {
|
||||
$source_name = 'cover_photo.jpg';
|
||||
}
|
||||
|
||||
$ext = '.' . pathinfo($source_name, PATHINFO_EXTENSION);
|
||||
$name = str_replace( $ext, '', $source_name );
|
||||
$filename = $name . $ext;
|
||||
|
||||
// copy image
|
||||
copy( $source, $this->upload_basedir . $user_id . '/' . $filename );
|
||||
|
||||
// thumbs
|
||||
if ( $key == 'profile_photo' ) {
|
||||
|
||||
list($w, $h) = @getimagesize( $source );
|
||||
|
||||
$sizes = um_get_option('photo_thumb_sizes');
|
||||
foreach( $sizes as $size ) {
|
||||
|
||||
if ( file_exists( $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext ) ) {
|
||||
unlink( $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext );
|
||||
}
|
||||
|
||||
if ( $size < $w ) {
|
||||
|
||||
$thumb_s = imagecreatefromjpeg( $source );
|
||||
$thumb = imagecreatetruecolor( $size, $size );
|
||||
imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $size, $w, $h );
|
||||
imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 100);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( $key == 'cover_photo' ) {
|
||||
|
||||
list($w, $h) = @getimagesize( $source );
|
||||
|
||||
$sizes = um_get_option('cover_thumb_sizes');
|
||||
foreach( $sizes as $size ) {
|
||||
|
||||
$ratio = round( $w / $h, 2 );
|
||||
$height = round( $size / $ratio, 2 );
|
||||
|
||||
if ( file_exists( $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext ) ) {
|
||||
unlink( $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext );
|
||||
}
|
||||
|
||||
if ( $size < $w ) {
|
||||
|
||||
$thumb_s = imagecreatefromjpeg( $source );
|
||||
$thumb = imagecreatetruecolor( $size, $height );
|
||||
imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h );
|
||||
imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 100);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// clean up temp
|
||||
$dir = dirname( $source );
|
||||
unlink( $source );
|
||||
rmdir( $dir );
|
||||
|
||||
// update user's meta
|
||||
update_user_meta( $user_id, $key, $filename );
|
||||
|
||||
// the url of upload
|
||||
return $this->upload_baseurl . $user_id . '/' . $filename;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,16 +4,23 @@
|
||||
*** @filter for shortcode args
|
||||
***/
|
||||
add_filter('um_shortcode_args_filter', 'um_shortcode_args_filter', 99);
|
||||
function um_shortcode_args_filter( $array ) {
|
||||
function um_shortcode_args_filter( $args ) {
|
||||
global $ultimatemember;
|
||||
|
||||
// checks for message mode
|
||||
|
||||
if ($ultimatemember->shortcodes->message_mode == true) {
|
||||
$array['template'] = 'message';
|
||||
$args['template'] = 'message';
|
||||
$ultimatemember->shortcodes->custom_message = um_user( um_user('status') . '_message' );
|
||||
um_reset_user();
|
||||
}
|
||||
|
||||
return $array;
|
||||
foreach( $args as $k => $v ) {
|
||||
if ( $ultimatemember->validation->is_serialized( $args[$k] ) ) {
|
||||
if ( !empty( $args[$k] ) ) {
|
||||
$args[$k] = unserialize( $args[$k] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $args;
|
||||
|
||||
}
|
||||
@@ -11,7 +11,11 @@
|
||||
$form_id = (isset ( $ultimatemember->fields->set_id ) ) ? $ultimatemember->fields->set_id : null;
|
||||
$mode = (isset( $ultimatemember->fields->set_mode ) ) ? $ultimatemember->fields->set_mode : null;
|
||||
|
||||
if ( $form_id && $mode ) {
|
||||
$array = $ultimatemember->query->get_attr('custom_fields', $form_id );
|
||||
} else {
|
||||
$array = '';
|
||||
}
|
||||
|
||||
return $array;
|
||||
|
||||
|
||||
@@ -1,23 +1,4 @@
|
||||
<?php
|
||||
|
||||
/***
|
||||
*** @member directory settings/args
|
||||
***/
|
||||
add_filter('um_members_directory_arguments', 'um_members_directory_arguments' );
|
||||
function um_members_directory_arguments( $args ){
|
||||
|
||||
global $ultimatemember;
|
||||
|
||||
foreach( $args as $k => $v ) {
|
||||
if ( $ultimatemember->validation->is_serialized( $args[$k] ) ) {
|
||||
if ( !empty( $args[$k] ) ) {
|
||||
$args[$k] = unserialize( $args[$k] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @prepare the query args to show members
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
class UM_Menu {
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @new menu
|
||||
***/
|
||||
function new_ui( $position, $element, $trigger, $items, $permission ) {
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-dropdown" data-element="<?php echo $element; ?>" data-position="<?php echo $position; ?>" data-trigger="<?php echo $trigger; ?>">
|
||||
<div class="um-dropdown-b">
|
||||
<div class="um-dropdown-arr"><i class=""></i></div>
|
||||
<ul>
|
||||
<?php foreach( $items as $k => $v ) { ?>
|
||||
|
||||
<li><?php echo $v; ?></li>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
class UM_Profile {
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
function show_meta( $array ) {
|
||||
$output = '';
|
||||
|
||||
foreach( $array as $k ) {
|
||||
if ( $k ) {
|
||||
$items[] = '<span>' . um_user( $k ) . '</span>';
|
||||
$items[] = '<span class="b">•</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $items ) ) {
|
||||
array_pop($items);
|
||||
foreach( $items as $item ) {
|
||||
$output .= $item;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,6 +84,7 @@ class UM_Setup {
|
||||
'_um_secondary_btn_color' => '#eee',
|
||||
'_um_secondary_btn_hover' => '#e5e5e5',
|
||||
'_um_secondary_btn_text' => '#666',
|
||||
'_um_profile_show_bio' => 1,
|
||||
'_um_profile_role' => '0',
|
||||
'_um_profile_template' => 'profile',
|
||||
'_um_profile_max_width' => '1000px',
|
||||
|
||||
+93
-11
@@ -1,5 +1,40 @@
|
||||
<?php
|
||||
|
||||
/***
|
||||
*** @profile user ID
|
||||
***/
|
||||
function um_profile_id() {
|
||||
|
||||
if ( um_get_requested_user() ) {
|
||||
return um_get_requested_user();
|
||||
} else if ( is_user_logged_in() && get_current_user_id() ) {
|
||||
return get_current_user_id();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Check that temp image is valid
|
||||
***/
|
||||
function um_is_temp_image( $url ) {
|
||||
global $ultimatemember;
|
||||
$url = explode('/ultimatemember/temp/', $url);
|
||||
if ( isset( $url[1] ) ) {
|
||||
|
||||
$src = $ultimatemember->files->upload_temp . $url[1];
|
||||
|
||||
if ( !file_exists( $src ) )
|
||||
return false;
|
||||
|
||||
list($width, $height, $type, $attr) = @getimagesize($src);
|
||||
if ( isset( $width ) && isset( $height ) )
|
||||
return $src;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Get core page url
|
||||
***/
|
||||
@@ -396,6 +431,56 @@
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*** @user uploads uri
|
||||
***/
|
||||
function um_user_uploads_uri() {
|
||||
global $ultimatemember;
|
||||
$uri = $ultimatemember->files->upload_baseurl . um_user('ID') . '/';
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @get cover uri
|
||||
***/
|
||||
function um_get_cover_uri( $image, $attrs ) {
|
||||
global $ultimatemember;
|
||||
$uri = false;
|
||||
if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/cover_photo.jpg' ) ) {
|
||||
$uri = um_user_uploads_uri() . 'cover_photo.jpg?' . time();
|
||||
}
|
||||
if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/cover_photo-' . $attrs. '.jpg' ) ){
|
||||
$uri = um_user_uploads_uri() . 'cover_photo-'.$attrs.'.jpg?' . time();
|
||||
}
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @get avatar uri
|
||||
***/
|
||||
function um_get_avatar_uri( $image, $attrs ) {
|
||||
global $ultimatemember;
|
||||
$uri = false;
|
||||
if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo.jpg' ) ) {
|
||||
$uri = um_user_uploads_uri() . 'profile_photo.jpg?' . time();
|
||||
}
|
||||
if ( file_exists( $ultimatemember->files->upload_basedir . um_user('ID') . '/profile_photo-' . $attrs. '.jpg' ) ){
|
||||
$uri = um_user_uploads_uri() . 'profile_photo-'.$attrs.'.jpg?' . time();
|
||||
}
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @default avatar
|
||||
***/
|
||||
function um_get_default_avatar_uri() {
|
||||
$uri = um_get_option('default_avatar');
|
||||
$uri = $uri['url'];
|
||||
if ( !$uri )
|
||||
$uri = um_url . 'assets/img/default_avatar.png';
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @get user data
|
||||
***/
|
||||
@@ -526,24 +611,21 @@
|
||||
|
||||
case 'profile_photo':
|
||||
|
||||
$default_avatar_uri = um_get_option('default_avatar');
|
||||
$default_avatar_uri = $default_avatar_uri['url'];
|
||||
|
||||
if ( !$default_avatar_uri ) {
|
||||
$default_avatar_uri = um_url . 'assets/img/default_avatar.png';
|
||||
if ( um_profile('profile_photo') ) {
|
||||
$avatar_uri = um_get_avatar_uri( um_profile('profile_photo'), $attrs );
|
||||
} else {
|
||||
$avatar_uri = um_get_default_avatar_uri();
|
||||
}
|
||||
|
||||
$default_avatar_uri = um_url . 'assets/img/Dollarphotoclub_57189843.jpg';
|
||||
|
||||
return '<img src="' . $default_avatar_uri . '" class="gravatar avatar avatar-'.$attrs.' um-avatar" width="'.$attrs.'" height="'.$attrs.'" alt="" />';
|
||||
|
||||
return '<img src="' . $avatar_uri . '" class="gravatar avatar avatar-'.$attrs.' um-avatar" width="'.$attrs.'" height="'.$attrs.'" alt="" />';
|
||||
|
||||
break;
|
||||
|
||||
case 'cover_photo':
|
||||
if ( um_profile('cover_photo') ) {
|
||||
return '<a href="#"><img src="'.um_profile('cover_photo').'" alt="" /></a>';
|
||||
$cover_uri = um_get_cover_uri( um_profile('cover_photo'), $attrs );
|
||||
return '<a href="#"><img src="'. $cover_uri .'" alt="" /></a>';
|
||||
}
|
||||
return '<a href="#"><img src="'.um_url . 'assets/img/best-hd-wallpapers-2.jpg" alt="" /></a>';
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ class UM_Uninstall {
|
||||
|
||||
foreach( wp_load_alloptions() as $k => $v ) {
|
||||
|
||||
if ( substr( $k, 0, 3 ) == 'um_' || substr( $k, 0, 3 ) == 'UM_' ) {
|
||||
if ( substr( $k, 0, 3 ) == 'um_' ) {
|
||||
|
||||
if ( $k == 'um_core_forms' || $k == 'um_core_pages' || $k == 'um_core_directories' ) {
|
||||
if ( $k == 'um_core_pages' ) {
|
||||
$v = unserialize( $v );
|
||||
foreach( $v as $post_id ) {
|
||||
wp_delete_post( $post_id, 1 );
|
||||
@@ -29,10 +29,14 @@ class UM_Uninstall {
|
||||
|
||||
}
|
||||
|
||||
$forms = get_posts( array( 'post_type' => 'um_form', 'numberposts' => -1 ) );
|
||||
foreach( $forms as $form ) {wp_delete_post( $form->ID, 1 );}
|
||||
|
||||
$directories = get_posts( array( 'post_type' => 'um_directory', 'numberposts' => -1 ) );
|
||||
foreach( $directories as $directory ) {wp_delete_post( $directory->ID, 1 );}
|
||||
|
||||
$roles = get_posts( array( 'post_type' => 'um_role', 'numberposts' => -1 ) );
|
||||
foreach( $roles as $role ) {
|
||||
wp_delete_post( $role->ID, 1 );
|
||||
}
|
||||
foreach( $roles as $role ) {wp_delete_post( $role->ID, 1 );}
|
||||
|
||||
if ( is_plugin_active( um_plugin ) ) {
|
||||
deactivate_plugins( um_plugin );
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
<div class="um-form">
|
||||
|
||||
<?php $args = apply_filters('um_members_directory_arguments', $args ); ?>
|
||||
|
||||
<?php do_action('um_members_directory_search', $args ); ?>
|
||||
|
||||
<?php do_action('um_members_directory_head', $args ); ?>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<div id="um_upload_image" style="display:none">
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div id="um_upload_single" style="display:none">
|
||||
|
||||
</div>
|
||||
+38
-1
@@ -738,10 +738,30 @@ $this->sections[] = array(
|
||||
|
||||
$this->sections[] = array(
|
||||
|
||||
'icon' => 'um-icon-files',
|
||||
'icon' => 'um-icon-photo-2',
|
||||
'title' => __( 'Image & File Uploads'),
|
||||
'fields' => array(
|
||||
|
||||
array(
|
||||
'id' => 'photo_thumb_sizes',
|
||||
'type' => 'multi_text',
|
||||
'title' => __( 'Profile Photo Thumbnail Sizes' ),
|
||||
'desc' => __( 'Here you can define which thumbnail sizes will be created for each profile photo upload.' ),
|
||||
'default' => array( 40, 80, str_replace('px','',um_get_option('profile_photosize') ) ),
|
||||
'validate' => 'numeric',
|
||||
'add_text' => __('Add New Size'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'cover_thumb_sizes',
|
||||
'type' => 'multi_text',
|
||||
'title' => __( 'Cover Photo Thumbnail Sizes' ),
|
||||
'desc' => __( 'Here you can define which thumbnail sizes will be created for each cover photo upload.' ),
|
||||
'default' => array( 300, 600 ),
|
||||
'validate' => 'numeric',
|
||||
'add_text' => __('Add New Size'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'image_compression',
|
||||
'type' => 'text',
|
||||
@@ -750,6 +770,15 @@ $this->sections[] = array(
|
||||
'default' => 60,
|
||||
'validate' => 'numeric',
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'image_max_width',
|
||||
'type' => 'text',
|
||||
'title' => __( 'Image Upload Maximum Width' ),
|
||||
'desc' => __( 'Any image upload above this width will be resized to this limit automatically.' ),
|
||||
'default' => 1000,
|
||||
'validate' => 'numeric',
|
||||
),
|
||||
|
||||
)
|
||||
|
||||
@@ -1163,6 +1192,14 @@ $this->sections[] = array(
|
||||
'transparent' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'profile_show_bio',
|
||||
'type' => 'switch',
|
||||
'title' => __( 'Show user description in header' ),
|
||||
'default' => um_get_metadefault('profile_show_bio'),
|
||||
'desc' => 'Switch on/off the user description on profile header',
|
||||
),
|
||||
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
@@ -36,6 +36,7 @@ class UM_API {
|
||||
require_once um_path . 'core/um-fields.php';
|
||||
require_once um_path . 'core/um-form.php';
|
||||
require_once um_path . 'core/um-user.php';
|
||||
require_once um_path . 'core/um-profile.php';
|
||||
require_once um_path . 'core/um-query.php';
|
||||
require_once um_path . 'core/um-datetime.php';
|
||||
require_once um_path . 'core/um-chart.php';
|
||||
@@ -44,6 +45,7 @@ class UM_API {
|
||||
require_once um_path . 'core/um-taxonomies.php';
|
||||
require_once um_path . 'core/um-validation.php';
|
||||
require_once um_path . 'core/um-navmenu.php';
|
||||
require_once um_path . 'core/um-menu.php';
|
||||
require_once um_path . 'core/um-access.php';
|
||||
require_once um_path . 'core/um-permalinks.php';
|
||||
require_once um_path . 'core/um-mail.php';
|
||||
@@ -51,6 +53,8 @@ class UM_API {
|
||||
require_once um_path . 'core/um-logout.php';
|
||||
require_once um_path . 'core/um-modal.php';
|
||||
|
||||
require_once um_path . 'core/lib/mobiledetect/Mobile_Detect.php';
|
||||
|
||||
require_once um_path . 'core/um-actions-form.php';
|
||||
require_once um_path . 'core/um-actions-wpadmin.php';
|
||||
require_once um_path . 'core/um-actions-core.php';
|
||||
@@ -93,6 +97,7 @@ class UM_API {
|
||||
$this->register = new UM_Register();
|
||||
$this->fields = new UM_Fields();
|
||||
$this->user = new UM_User();
|
||||
$this->profile = new UM_Profile();
|
||||
$this->datetime = new UM_DateTime();
|
||||
$this->chart = new UM_Chart();
|
||||
$this->builtin = new UM_Builtin();
|
||||
@@ -101,12 +106,14 @@ class UM_API {
|
||||
$this->taxonomies = new UM_Taxonomies();
|
||||
$this->validation = new UM_Validation();
|
||||
$this->query = new UM_Query();
|
||||
$this->menu = new UM_Menu();
|
||||
$this->access = new UM_Access();
|
||||
$this->permalinks = new UM_Permalinks();
|
||||
$this->mail = new UM_Mail();
|
||||
$this->members = new UM_Members();
|
||||
$this->logout = new UM_Logout();
|
||||
$this->modal = new UM_Modal();
|
||||
$this->mobile = new Mobile_Detect;
|
||||
|
||||
$this->options = get_option('um_options');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user