mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- member directory;
This commit is contained in:
@@ -372,8 +372,7 @@ a.um-edit-profile-btn {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.um-member a.um-follow-btn:before {content: "\f234"}
|
|
||||||
.um-member a.um-unfollow-btn:before {content: "\f235"}
|
|
||||||
.um-member a.um-friend-btn:before {content: "\f234"}
|
.um-member a.um-friend-btn:before {content: "\f234"}
|
||||||
.um-member a.um-unfriend-btn:before {content: "\f235"}
|
.um-member a.um-unfriend-btn:before {content: "\f235"}
|
||||||
|
|
||||||
@@ -543,7 +542,7 @@ a.um-edit-profile-btn {
|
|||||||
|
|
||||||
.um-members-list .um-member {
|
.um-members-list .um-member {
|
||||||
width:100% !important;
|
width:100% !important;
|
||||||
padding: 15px 0;
|
padding: 15px 10px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-10
@@ -149,24 +149,25 @@ function um_ajax_get_members( directory, args ) {
|
|||||||
* 1) Page - getting from directory data 'page'
|
* 1) Page - getting from directory data 'page'
|
||||||
* 2) Sort - getting from 'um-member-directory-sorting-options' field value
|
* 2) Sort - getting from 'um-member-directory-sorting-options' field value
|
||||||
* 3) Search - getting from 'um-search-line' field value
|
* 3) Search - getting from 'um-search-line' field value
|
||||||
* 4) Filters - ?????
|
* 4) Filters - getting from URL data by 'um_get_data_for_directory' function
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
var hash = um_members_get_hash( directory );
|
var hash = um_members_get_hash( directory );
|
||||||
var search = um_get_search( directory );
|
|
||||||
var page = um_get_current_page( directory );
|
var page = um_get_current_page( directory );
|
||||||
|
var search = um_get_search( directory );
|
||||||
var sorting = um_get_sort( directory );
|
var sorting = um_get_sort( directory );
|
||||||
|
|
||||||
var local_date = new Date();
|
var local_date = new Date();
|
||||||
var gmt_hours = -local_date.getTimezoneOffset()/60;
|
var gmt_hours = -local_date.getTimezoneOffset() / 60;
|
||||||
|
|
||||||
var request = {
|
var request = {
|
||||||
directory_id: hash,
|
directory_id: hash,
|
||||||
page: page,
|
page: page,
|
||||||
search: search,
|
search: search,
|
||||||
sorting: sorting,
|
sorting: sorting,
|
||||||
|
gmt_offset: gmt_hours,
|
||||||
nonce: um_scripts.nonce
|
nonce: um_scripts.nonce
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -179,21 +180,21 @@ function um_ajax_get_members( directory, args ) {
|
|||||||
|
|
||||||
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
|
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
|
||||||
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
|
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
|
||||||
if ( typeof value != 'undefined' ) {
|
if ( typeof value_from != 'undefined' || typeof value_to != 'undefined' ) {
|
||||||
request[ filter_name ] = [ value_from, value_to ];
|
request[ filter_name ] = [ value_from, value_to ];
|
||||||
}
|
}
|
||||||
} else if ( filter.find( '.um-datepicker-filter' ).length ) {
|
} else if ( filter.find( '.um-datepicker-filter' ).length ) {
|
||||||
var filter_name = filter.find( '.um-datepicker-filter' ).data('filter_name');
|
var filter_name = filter.find( '.um-datepicker-filter' ).data('filter_name');
|
||||||
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
|
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
|
||||||
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
|
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
|
||||||
if ( typeof value != 'undefined' ) {
|
if ( typeof value_from != 'undefined' || typeof value_to != 'undefined') {
|
||||||
request[ filter_name ] = [ value_from, value_to ];
|
request[ filter_name ] = [ value_from, value_to ];
|
||||||
}
|
}
|
||||||
} else if ( filter.find( '.um-timepicker-filter' ).length ) {
|
} else if ( filter.find( '.um-timepicker-filter' ).length ) {
|
||||||
var filter_name = filter.find( '.um-timepicker-filter' ).data('filter_name');
|
var filter_name = filter.find( '.um-timepicker-filter' ).data('filter_name');
|
||||||
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
|
var value_from = um_get_data_for_directory( directory, 'filter_' + filter_name + '_from' );
|
||||||
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
|
var value_to = um_get_data_for_directory( directory, 'filter_' + filter_name + '_to' );
|
||||||
if ( typeof value != 'undefined' ) {
|
if ( typeof value_from != 'undefined' || typeof value_to != 'undefined' ) {
|
||||||
request[ filter_name ] = [ value_from, value_to ];
|
request[ filter_name ] = [ value_from, value_to ];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -212,7 +213,7 @@ function um_ajax_get_members( directory, args ) {
|
|||||||
//set last data hard for using on layouts reloading
|
//set last data hard for using on layouts reloading
|
||||||
um_member_directory_last_data[ hash ] = answer;
|
um_member_directory_last_data[ hash ] = answer;
|
||||||
|
|
||||||
um_build_template( directory, answer );
|
um_build_template( directory, answer.users );
|
||||||
|
|
||||||
um_members_hide_preloader( directory );
|
um_members_hide_preloader( directory );
|
||||||
|
|
||||||
@@ -225,6 +226,8 @@ function um_ajax_get_members( directory, args ) {
|
|||||||
},
|
},
|
||||||
error: function( data ) {
|
error: function( data ) {
|
||||||
console.log( data );
|
console.log( data );
|
||||||
|
|
||||||
|
um_members_hide_preloader( directory );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -506,7 +509,7 @@ jQuery(document).ready( function() {
|
|||||||
um_set_url_from_data( directory, 'view_type', layout );
|
um_set_url_from_data( directory, 'view_type', layout );
|
||||||
directory.data( 'view_type', layout );
|
directory.data( 'view_type', layout );
|
||||||
|
|
||||||
um_build_template( directory, data );
|
um_build_template( directory, data.users );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -972,8 +975,6 @@ jQuery(document).ready( function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$input.clear();
|
|
||||||
|
|
||||||
um_set_url_from_data( directory, 'filter_' + filter_name + '_from', current_value_from );
|
um_set_url_from_data( directory, 'filter_' + filter_name + '_from', current_value_from );
|
||||||
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', current_value_to );
|
um_set_url_from_data( directory, 'filter_' + filter_name + '_to', current_value_to );
|
||||||
|
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ if ( ! class_exists( 'UM' ) ) {
|
|||||||
$this->register();
|
$this->register();
|
||||||
$this->user_posts();
|
$this->user_posts();
|
||||||
$this->access();
|
$this->access();
|
||||||
$this->members();
|
//$this->members();
|
||||||
$this->logout();
|
$this->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1336,11 +1336,15 @@ if ( ! class_exists( 'UM' ) ) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated 2.1.0
|
||||||
|
*
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*
|
*
|
||||||
* @return um\core\Members
|
* @return um\core\Members
|
||||||
*/
|
*/
|
||||||
function members() {
|
function members() {
|
||||||
|
um_deprecated_function( 'UM()->members()', '2.1.0', 'UM()->member_directory()' );
|
||||||
|
|
||||||
if ( empty( $this->classes['members'] ) ) {
|
if ( empty( $this->classes['members'] ) ) {
|
||||||
$this->classes['members'] = new um\core\Members();
|
$this->classes['members'] = new um\core\Members();
|
||||||
}
|
}
|
||||||
@@ -1463,7 +1467,9 @@ if ( ! class_exists( 'UM' ) ) {
|
|||||||
require_once 'core/um-filters-navmenu.php';
|
require_once 'core/um-filters-navmenu.php';
|
||||||
require_once 'core/um-filters-avatars.php';
|
require_once 'core/um-filters-avatars.php';
|
||||||
require_once 'core/um-filters-user.php';
|
require_once 'core/um-filters-user.php';
|
||||||
require_once 'core/um-filters-members.php';
|
|
||||||
|
//require_once 'core/um-filters-members.php';
|
||||||
|
|
||||||
require_once 'core/um-filters-profile.php';
|
require_once 'core/um-filters-profile.php';
|
||||||
require_once 'core/um-filters-account.php';
|
require_once 'core/um-filters-account.php';
|
||||||
require_once 'core/um-filters-misc.php';
|
require_once 'core/um-filters-misc.php';
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -26,310 +26,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
|
|||||||
*/
|
*/
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
|
||||||
add_filter( 'user_search_columns', array( &$this, 'user_search_columns' ), 99 );
|
|
||||||
add_action( 'template_redirect', array( &$this, 'access_members' ), 555 );
|
|
||||||
|
|
||||||
$this->core_search_fields = array(
|
|
||||||
'user_login',
|
|
||||||
'user_url',
|
|
||||||
'display_name',
|
|
||||||
'user_email',
|
|
||||||
'user_nicename',
|
|
||||||
);
|
|
||||||
|
|
||||||
add_filter( 'um_search_select_fields', array( &$this, 'um_search_select_fields' ), 10, 1 );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show filter
|
|
||||||
*
|
|
||||||
* @todo make UM:Groups members list via general directory
|
|
||||||
*
|
|
||||||
* @deprecated since 2.1.0 - Use only in UM Groups extension
|
|
||||||
* @param $filter
|
|
||||||
*/
|
|
||||||
function show_filter( $filter ) {
|
|
||||||
/**
|
|
||||||
* @var $type
|
|
||||||
* @var $attrs
|
|
||||||
*/
|
|
||||||
extract( $this->prepare_filter( $filter ) );
|
|
||||||
|
|
||||||
switch ( $type ) {
|
|
||||||
|
|
||||||
case 'select':
|
|
||||||
/*if( isset($attrs) && is_array( $attrs['options'] ) ){
|
|
||||||
asort( $attrs['options'] );
|
|
||||||
}*/
|
|
||||||
if ( isset( $attrs['label'] ) ) {
|
|
||||||
$label = $attrs['label'];
|
|
||||||
} else {
|
|
||||||
$label = isset( $attrs['title'] ) ? $attrs['title'] : '';
|
|
||||||
} ?>
|
|
||||||
|
|
||||||
<select name="<?php echo esc_attr( $filter ); ?>" id="<?php echo esc_attr( $filter ); ?>" class="um-s1"
|
|
||||||
style="width: 100%" data-placeholder="<?php esc_attr_e( stripslashes( $label ), 'ultimate-member' ); ?>" <?php if ( ! empty( $attrs['custom_dropdown_options_source'] ) ) { ?> data-um-parent="<?php echo esc_attr( $attrs['parent_dropdown_relationship'] ); ?>" data-mebers-directory="yes" data-um-ajax-source="<?php echo esc_attr( $attrs['custom_dropdown_options_source'] ) ?>"<?php } ?>>
|
|
||||||
|
|
||||||
<option></option>
|
|
||||||
|
|
||||||
<?php foreach ( $attrs['options'] as $k => $v ) {
|
|
||||||
|
|
||||||
$v = stripslashes( $v );
|
|
||||||
|
|
||||||
$opt = $v;
|
|
||||||
|
|
||||||
if ( strstr( $filter, 'role_' ) ) {
|
|
||||||
$opt = $k;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isset( $attrs['custom'] ) ) {
|
|
||||||
$opt = $k;
|
|
||||||
} ?>
|
|
||||||
|
|
||||||
<option value="<?php echo esc_attr( $opt ); ?>" <?php um_select_if_in_query_params( $filter, $opt ); ?> <?php selected( isset( $_GET[ $filter ] ) && $_GET[ $filter ] == $v ) ?>><?php esc_html_e( $v, 'ultimate-member'); ?></option>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'text':
|
|
||||||
?>
|
|
||||||
|
|
||||||
<input type="text" autocomplete="off" name="<?php echo esc_attr( $filter ); ?>" id="<?php echo esc_attr( $filter ); ?>"
|
|
||||||
placeholder="<?php echo isset( $attrs['label'] ) ? esc_attr__( $attrs['label'], 'ultimate-member' ) : ''; ?>"
|
|
||||||
value="<?php echo esc_attr( um_queried_search_value( $filter, false ) ); ?>" />
|
|
||||||
|
|
||||||
<?php
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User_search_columns
|
|
||||||
*
|
|
||||||
* @param $search_columns
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function user_search_columns( $search_columns ) {
|
|
||||||
if ( is_admin() ) {
|
|
||||||
$search_columns[] = 'display_name';
|
|
||||||
}
|
|
||||||
return $search_columns;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Members page allowed?
|
|
||||||
*/
|
|
||||||
function access_members() {
|
|
||||||
if ( UM()->options()->get( 'members_page' ) == 0 && um_is_core_page( 'members' ) ) {
|
|
||||||
um_redirect_home();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tag conversion for member directory
|
|
||||||
*
|
|
||||||
* @param $string
|
|
||||||
* @param $array
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
function convert_tags( $string, $array ) {
|
|
||||||
|
|
||||||
$search = array(
|
|
||||||
'{total_users}',
|
|
||||||
);
|
|
||||||
|
|
||||||
$replace = array(
|
|
||||||
$array['total_users'],
|
|
||||||
);
|
|
||||||
|
|
||||||
$string = str_replace( $search, $replace, $string );
|
|
||||||
return $string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prepare filter data
|
|
||||||
*
|
|
||||||
* @param $filter
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function prepare_filter( $filter ) {
|
|
||||||
$fields = UM()->builtin()->all_user_fields;
|
|
||||||
|
|
||||||
if ( isset( $fields[ $filter ] ) ) {
|
|
||||||
$attrs = $fields[ $filter ];
|
|
||||||
} else {
|
|
||||||
/**
|
|
||||||
* UM hook
|
|
||||||
*
|
|
||||||
* @type filter
|
|
||||||
* @title um_custom_search_field_{$filter}
|
|
||||||
* @description Custom search settings by $filter
|
|
||||||
* @input_vars
|
|
||||||
* [{"var":"$settings","type":"array","desc":"Search Settings"}]
|
|
||||||
* @change_log
|
|
||||||
* ["Since: 2.0"]
|
|
||||||
* @usage
|
|
||||||
* <?php add_filter( 'um_custom_search_field_{$filter}', 'function_name', 10, 1 ); ?>
|
|
||||||
* @example
|
|
||||||
* <?php
|
|
||||||
* add_filter( 'um_custom_search_field_{$filter}', 'my_custom_search_field', 10, 1 );
|
|
||||||
* function my_change_email_template_file( $settings ) {
|
|
||||||
* // your code here
|
|
||||||
* return $settings;
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
*/
|
|
||||||
$attrs = apply_filters( "um_custom_search_field_{$filter}", array() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// additional filter for search field attributes
|
|
||||||
/**
|
|
||||||
* UM hook
|
|
||||||
*
|
|
||||||
* @type filter
|
|
||||||
* @title um_search_field_{$filter}
|
|
||||||
* @description Extend search settings by $filter
|
|
||||||
* @input_vars
|
|
||||||
* [{"var":"$settings","type":"array","desc":"Search Settings"}]
|
|
||||||
* @change_log
|
|
||||||
* ["Since: 2.0"]
|
|
||||||
* @usage
|
|
||||||
* <?php add_filter( 'um_search_field_{$filter}', 'function_name', 10, 1 ); ?>
|
|
||||||
* @example
|
|
||||||
* <?php
|
|
||||||
* add_filter( 'um_search_field_{$filter}', 'my_search_field', 10, 1 );
|
|
||||||
* function my_change_email_template_file( $settings ) {
|
|
||||||
* // your code here
|
|
||||||
* return $settings;
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
*/
|
|
||||||
$attrs = apply_filters( "um_search_field_{$filter}", $attrs );
|
|
||||||
|
|
||||||
$type = UM()->builtin()->is_dropdown_field( $filter, $attrs ) ? 'select' : 'text';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UM hook
|
|
||||||
*
|
|
||||||
* @type filter
|
|
||||||
* @title um_search_field_type
|
|
||||||
* @description Change search field type
|
|
||||||
* @input_vars
|
|
||||||
* [{"var":"$type","type":"string","desc":"Search field type"},
|
|
||||||
* {"var":"$settings","type":"array","desc":"Search Settings"}]
|
|
||||||
* @change_log
|
|
||||||
* ["Since: 2.0"]
|
|
||||||
* @usage
|
|
||||||
* <?php add_filter( 'um_search_field_type', 'function_name', 10, 2 ); ?>
|
|
||||||
* @example
|
|
||||||
* <?php
|
|
||||||
* add_filter( 'um_search_field_type', 'my_search_field_type', 10, 2 );
|
|
||||||
* function my_search_field_type( $type, $settings ) {
|
|
||||||
* // your code here
|
|
||||||
* return $type;
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
*/
|
|
||||||
$type = apply_filters( 'um_search_field_type', $type, $attrs );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UM hook
|
|
||||||
*
|
|
||||||
* @type filter
|
|
||||||
* @title um_search_fields
|
|
||||||
* @description Filter all search fields
|
|
||||||
* @input_vars
|
|
||||||
* [{"var":"$settings","type":"array","desc":"Search Fields"}]
|
|
||||||
* @change_log
|
|
||||||
* ["Since: 2.0"]
|
|
||||||
* @usage
|
|
||||||
* <?php add_filter( 'um_search_fields', 'function_name', 10, 1 ); ?>
|
|
||||||
* @example
|
|
||||||
* <?php
|
|
||||||
* add_filter( 'um_search_fields', 'my_search_fields', 10, 1 );
|
|
||||||
* function my_search_fields( $settings ) {
|
|
||||||
* // your code here
|
|
||||||
* return $settings;
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
*/
|
|
||||||
$attrs = apply_filters( 'um_search_fields', $attrs );
|
|
||||||
|
|
||||||
if ( $type == 'select' ) {
|
|
||||||
if ( isset( $attrs ) && is_array( $attrs['options'] ) ) {
|
|
||||||
asort( $attrs['options'] );
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* UM hook
|
|
||||||
*
|
|
||||||
* @type filter
|
|
||||||
* @title um_search_select_fields
|
|
||||||
* @description Filter all search fields for select field type
|
|
||||||
* @input_vars
|
|
||||||
* [{"var":"$settings","type":"array","desc":"Search Fields"}]
|
|
||||||
* @change_log
|
|
||||||
* ["Since: 2.0"]
|
|
||||||
* @usage
|
|
||||||
* <?php add_filter( 'um_search_select_fields', 'function_name', 10, 1 ); ?>
|
|
||||||
* @example
|
|
||||||
* <?php
|
|
||||||
* add_filter( 'um_search_select_fields', 'my_search_select_fields', 10, 1 );
|
|
||||||
* function my_search_select_fields( $settings ) {
|
|
||||||
* // your code here
|
|
||||||
* return $settings;
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
*/
|
|
||||||
$attrs = apply_filters( 'um_search_select_fields', $attrs );
|
|
||||||
}
|
|
||||||
|
|
||||||
return compact( 'type', 'attrs' );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display assigned roles in search filter 'role' field
|
|
||||||
* @param array $attrs
|
|
||||||
* @return array
|
|
||||||
* @uses add_filter 'um_search_select_fields'
|
|
||||||
* @since 1.3.83
|
|
||||||
*/
|
|
||||||
function um_search_select_fields( $attrs ) {
|
|
||||||
|
|
||||||
if ( ! empty( $attrs['metakey'] ) && strstr( $attrs['metakey'], 'role_' ) ) {
|
|
||||||
|
|
||||||
$shortcode_roles = get_post_meta( UM()->shortcodes()->form_id, '_um_roles', true );
|
|
||||||
$um_roles = UM()->roles()->get_roles( false );
|
|
||||||
|
|
||||||
if ( ! empty( $shortcode_roles ) && is_array( $shortcode_roles ) ) {
|
|
||||||
|
|
||||||
$attrs['options'] = array();
|
|
||||||
|
|
||||||
foreach ( $um_roles as $key => $value ) {
|
|
||||||
if ( in_array( $key, $shortcode_roles ) ) {
|
|
||||||
$attrs['options'][ $key ] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return $attrs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +1,6 @@
|
|||||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WP API user search
|
|
||||||
*
|
|
||||||
* @param $query_args
|
|
||||||
* @param $args
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
//function um_search_usernames_emails( $query_args, $args ) {
|
|
||||||
// extract( $args );
|
|
||||||
//
|
|
||||||
// $query = UM()->permalinks()->get_query_array();
|
|
||||||
// $arr_columns = array();
|
|
||||||
//
|
|
||||||
// foreach ( UM()->members()->core_search_fields as $key ) {
|
|
||||||
// if ( ! empty( $query[ $key ] ) ) {
|
|
||||||
// $arr_columns[] = $key;
|
|
||||||
// $query_args['search'] = '*' . $query[ $key ] .'*';
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if ( ! empty( $arr_columns ) )
|
|
||||||
// $query_args['search_columns'] = $arr_columns;
|
|
||||||
//
|
|
||||||
// return $query_args;
|
|
||||||
//}
|
|
||||||
//add_filter( 'um_prepare_user_query_args', 'um_search_usernames_emails', 51, 2 );
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove users we do not need to show in directory
|
* Remove users we do not need to show in directory
|
||||||
*
|
*
|
||||||
@@ -99,173 +70,4 @@ function um_remove_special_users_from_list( $query_args, $args ) {
|
|||||||
|
|
||||||
return $query_args;
|
return $query_args;
|
||||||
}
|
}
|
||||||
//add_filter( 'um_prepare_user_query_args', 'um_remove_special_users_from_list', 99, 2 );
|
//add_filter( 'um_prepare_user_query_args', 'um_remove_special_users_from_list', 99, 2 );
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds main parameters
|
|
||||||
*
|
|
||||||
* @param $query_args
|
|
||||||
* @param $args
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
function um_prepare_user_query_args( $query_args, $args ) {
|
|
||||||
extract( $args );
|
|
||||||
|
|
||||||
$query_args['fields'] = 'ID';
|
|
||||||
|
|
||||||
$query_args['number'] = 0;
|
|
||||||
|
|
||||||
$query_args['meta_query']['relation'] = 'AND';
|
|
||||||
|
|
||||||
// must have a profile photo
|
|
||||||
if ( $has_profile_photo == 1 ) {
|
|
||||||
if ( UM()->options()->get( 'use_gravatars' ) ) {
|
|
||||||
$query_args['meta_query'][] = array(
|
|
||||||
'relation' => 'OR',
|
|
||||||
array(
|
|
||||||
'key' => 'synced_profile_photo', // addons
|
|
||||||
'value' => '',
|
|
||||||
'compare' => '!='
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'key' => 'profile_photo', // from upload form
|
|
||||||
'value' => '',
|
|
||||||
'compare' => '!='
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'key' => 'synced_gravatar_hashed_id', // gravatar
|
|
||||||
'value' => '',
|
|
||||||
'compare' => '!='
|
|
||||||
)
|
|
||||||
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$query_args['meta_query'][] = array(
|
|
||||||
'relation' => 'OR',
|
|
||||||
array(
|
|
||||||
'key' => 'synced_profile_photo', // addons
|
|
||||||
'value' => '',
|
|
||||||
'compare' => '!='
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'key' => 'profile_photo', // from upload form
|
|
||||||
'value' => '',
|
|
||||||
'compare' => '!='
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// must have a cover photo
|
|
||||||
if ( $has_cover_photo == 1 ) {
|
|
||||||
$query_args['meta_query'][] = array(
|
|
||||||
'key' => 'cover_photo',
|
|
||||||
'value' => '',
|
|
||||||
'compare' => '!='
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// show specific usernames
|
|
||||||
if ( isset( $show_these_users ) && $show_these_users && is_array( $show_these_users ) ) {
|
|
||||||
foreach ( $show_these_users as $username ) {
|
|
||||||
$users_array[] = username_exists( $username );
|
|
||||||
}
|
|
||||||
$query_args['include'] = $users_array;
|
|
||||||
}
|
|
||||||
|
|
||||||
// add roles to appear in directory
|
|
||||||
if ( ! empty( $roles ) ) {
|
|
||||||
//since WP4.4 use 'role__in' argument
|
|
||||||
$query_args['role__in'] = $roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
// sort members by
|
|
||||||
$query_args['order'] = 'ASC';
|
|
||||||
|
|
||||||
if ( isset( $sortby ) ) {
|
|
||||||
|
|
||||||
if ( $sortby == 'other' && $sortby_custom ) {
|
|
||||||
|
|
||||||
$query_args['meta_key'] = $sortby_custom;
|
|
||||||
$query_args['orderby'] = 'meta_value, display_name';
|
|
||||||
|
|
||||||
} elseif ( 'display_name' == $sortby ) {
|
|
||||||
|
|
||||||
$display_name = UM()->options()->get( 'display_name' );
|
|
||||||
if ( $display_name == 'username' ) {
|
|
||||||
$query_args['orderby'] = 'user_login';
|
|
||||||
$order = 'ASC';
|
|
||||||
} else {
|
|
||||||
$query_args['meta_query'][] = array(
|
|
||||||
'relation' => 'OR',
|
|
||||||
'full_name' => array(
|
|
||||||
'key' => 'full_name',
|
|
||||||
'compare' => 'EXISTS'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'key' => 'full_name',
|
|
||||||
'compare' => 'NOT EXISTS'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$query_args['orderby'] = 'full_name, display_name';
|
|
||||||
$order = 'ASC';
|
|
||||||
}
|
|
||||||
|
|
||||||
} elseif ( in_array( $sortby, array( 'last_name', 'first_name' ) ) ) {
|
|
||||||
|
|
||||||
$query_args['meta_key'] = $sortby;
|
|
||||||
$query_args['orderby'] = 'meta_value';
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if ( strstr( $sortby, '_desc' ) ) {
|
|
||||||
$sortby = str_replace( '_desc', '', $sortby );
|
|
||||||
$order = 'DESC';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( strstr( $sortby, '_asc' ) ) {
|
|
||||||
$sortby = str_replace('_asc','',$sortby);
|
|
||||||
$order = 'ASC';
|
|
||||||
}
|
|
||||||
|
|
||||||
$query_args['orderby'] = $sortby;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isset( $order ) ) {
|
|
||||||
$query_args['order'] = $order;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UM hook
|
|
||||||
*
|
|
||||||
* @type filter
|
|
||||||
* @title um_modify_sortby_parameter
|
|
||||||
* @description Change query sort by attributes for search at Members Directory
|
|
||||||
* @input_vars
|
|
||||||
* [{"var":"$query_args","type":"array","desc":"Query Arguments"},
|
|
||||||
* {"var":"$sortby","type":"string","desc":"Sort by"}]
|
|
||||||
* @change_log
|
|
||||||
* ["Since: 2.0"]
|
|
||||||
* @usage
|
|
||||||
* <?php add_filter( 'um_modify_sortby_parameter', 'function_name', 10, 2 ); ?>
|
|
||||||
* @example
|
|
||||||
* <?php
|
|
||||||
* add_filter( 'um_modify_sortby_parameter', 'my_modify_sortby_parameter', 10, 2 );
|
|
||||||
* function my_modify_sortby_parameter( $query_args, $sortby ) {
|
|
||||||
* // your code here
|
|
||||||
* return $query_args;
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
*/
|
|
||||||
$query_args = apply_filters( 'um_modify_sortby_parameter', $query_args, $sortby );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return $query_args;
|
|
||||||
}
|
|
||||||
//add_filter( 'um_prepare_user_query_args', 'um_prepare_user_query_args', 10, 2 );
|
|
||||||
@@ -417,4 +417,25 @@ function um_time_diff( $time1, $time2 ) {
|
|||||||
//um_deprecated_function( 'um_time_diff', '2.0.30', 'UM()->datetime()->time_diff' );
|
//um_deprecated_function( 'um_time_diff', '2.0.30', 'UM()->datetime()->time_diff' );
|
||||||
|
|
||||||
return UM()->datetime()->time_diff( $time1, $time2 );
|
return UM()->datetime()->time_diff( $time1, $time2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get members to show in directory
|
||||||
|
*
|
||||||
|
* @deprecated 2.1.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param $argument
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function um_members( $argument ) {
|
||||||
|
//um_deprecated_function( 'um_members', '2.1.0', 'UM()->member_directory()' );
|
||||||
|
|
||||||
|
$result = null;
|
||||||
|
if ( isset( UM()->members()->results[ $argument ] ) ) {
|
||||||
|
$result = UM()->members()->results[ $argument ];
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -1285,22 +1285,6 @@ function um_get_display_name( $user_id ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get members to show in directory
|
|
||||||
*
|
|
||||||
* @param $argument
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
function um_members( $argument ) {
|
|
||||||
$result = null;
|
|
||||||
if ( isset( UM()->members()->results[ $argument ] ) ) {
|
|
||||||
$result = UM()->members()->results[ $argument ];
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the user data. You need to fetch a user manually after using this function.
|
* Clears the user data. You need to fetch a user manually after using this function.
|
||||||
*
|
*
|
||||||
|
|||||||
+118
-112
@@ -1,140 +1,146 @@
|
|||||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||||
|
|
||||||
<script type="text/template" id="tmpl-um-member-grid">
|
<script type="text/template" id="tmpl-um-member-grid">
|
||||||
<div class="um-members-grid">
|
<div class="um-members um-members-grid">
|
||||||
<div class="um-members-intro">
|
<div class="um-gutter-sizer"></div>
|
||||||
<div class="um-members-total">
|
|
||||||
<# if ( data.args.show_count ) { #>
|
|
||||||
<# if ( data.users.length == 1 ) { #>
|
|
||||||
{{{data.pagination.header_single}}}
|
|
||||||
<# } else if ( data.users.length > 1 ) { #>
|
|
||||||
{{{data.pagination.header}}}
|
|
||||||
<# } #>
|
|
||||||
<# } #>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="um-members">
|
<# if ( data.length > 0 ) { #>
|
||||||
<div class="um-gutter-sizer"></div>
|
<# _.each( data, function( user, key, list ) { #>
|
||||||
|
|
||||||
<# if ( data.users.length > 0 ) { #>
|
<div class="um-member um-role-{{{user.role}}} {{{user.account_status}}} <?php if ( $cover_photos ) { echo 'with-cover'; } ?>">
|
||||||
<# _.each( data.users, function( user, key, list ) { #>
|
|
||||||
|
|
||||||
<div class="um-member um-role-{{{user.role}}} {{{user.account_status}}} <?php if ( $cover_photos ) { echo 'with-cover'; } ?>">
|
<span class="um-member-status {{{user.account_status}}}">
|
||||||
<span class="um-member-status {{{user.account_status}}}">{{{user.account_status_name}}}</span>
|
{{{user.account_status_name}}}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<?php if ( $cover_photos ) { ?>
|
||||||
<?php if ( $cover_photos ) :
|
<div class="um-member-cover" data-ratio="<?php echo esc_attr( UM()->options()->get( 'profile_cover_ratio' ) ); ?>">
|
||||||
$sizes = UM()->options()->get( 'cover_thumb_sizes' );
|
<div class="um-member-cover-e">
|
||||||
$cover_size = UM()->mobile()->isTablet() ? $sizes[1] : $sizes[0];
|
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
||||||
?>
|
{{{user.cover_photo}}}
|
||||||
<div class="um-member-cover" data-ratio="<?php echo UM()->options()->get( 'profile_cover_ratio' ); ?>">
|
</a>
|
||||||
<div class="um-member-cover-e">
|
|
||||||
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
|
||||||
{{{user.cover_photo}}}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php if ( $profile_photo ) : ?>
|
|
||||||
<div class="um-member-photo radius-<?php echo UM()->options()->get( 'profile_photocorner' ); ?>">
|
|
||||||
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
|
||||||
{{{user.avatar}}}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="um-member-card <?php if ( ! $profile_photo ) { echo 'no-photo'; } ?>">
|
|
||||||
<?php if ( $show_name ) : ?>
|
|
||||||
<div class="um-member-name">
|
|
||||||
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
|
||||||
{{{user.display_name_html}}}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php do_action( 'um_members_just_after_name_tmpl', $args ); ?>
|
|
||||||
{{{user.hook_just_after_name}}}
|
|
||||||
|
|
||||||
|
|
||||||
<# if ( user.can_edit ) { #>
|
|
||||||
<div class="um-members-edit-btn">
|
|
||||||
<a href="{{{user.edit_profile_url}}}" class="um-edit-profile-btn um-button um-alt"> <?php _e( 'Edit profile','ultimate-member' ) ?> </a>
|
|
||||||
</div>
|
|
||||||
<# } #>
|
|
||||||
|
|
||||||
|
|
||||||
<?php do_action( 'um_members_after_user_name_tmpl', $args ); ?>
|
|
||||||
{{{user.hook_after_user_name}}}
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
if ( $show_tagline && is_array( $tagline_fields ) ) :
|
|
||||||
foreach ( $tagline_fields as $key ) :
|
|
||||||
if ( empty( $key ) ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<# if ( user.<?php echo $key;?> ) { #>
|
|
||||||
<div class="um-member-tagline um-member-tagline-<?php echo $key;?>" data-key="<?php echo $key;?>">
|
|
||||||
{{{user.<?php echo $key;?>}}}
|
|
||||||
</div>
|
</div>
|
||||||
<# } #>
|
</div>
|
||||||
|
<?php }
|
||||||
|
|
||||||
<?php
|
if ( $profile_photo ) { ?>
|
||||||
endforeach;
|
<div class="um-member-photo radius-<?php echo esc_attr( UM()->options()->get( 'profile_photocorner' ) ); ?>">
|
||||||
endif;
|
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
||||||
?>
|
{{{user.avatar}}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<?php if ( $show_userinfo ) : ?>
|
<div class="um-member-card <?php if ( ! $profile_photo ) { echo 'no-photo'; } ?>">
|
||||||
<div class="um-member-meta-main">
|
<?php if ( $show_name ) { ?>
|
||||||
<?php if ( $userinfo_animate ) { ?>
|
<div class="um-member-name">
|
||||||
<div class="um-member-more"><a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a></div>
|
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
||||||
|
{{{user.display_name_html}}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
do_action( 'um_members_just_after_name_tmpl', $args ); ?>
|
||||||
|
{{{user.hook_just_after_name}}}
|
||||||
|
|
||||||
|
|
||||||
|
<# if ( user.can_edit ) { #>
|
||||||
|
<div class="um-members-edit-btn">
|
||||||
|
<a href="{{{user.edit_profile_url}}}" class="um-edit-profile-btn um-button um-alt">
|
||||||
|
<?php _e( 'Edit profile','ultimate-member' ) ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
|
|
||||||
|
|
||||||
|
<?php do_action( 'um_members_after_user_name_tmpl', $args ); ?>
|
||||||
|
{{{user.hook_after_user_name}}}
|
||||||
|
|
||||||
|
|
||||||
|
<?php if ( $show_tagline && ! empty( $tagline_fields ) && is_array( $tagline_fields ) ) {
|
||||||
|
foreach ( $tagline_fields as $key ) {
|
||||||
|
if ( empty( $key ) ) {
|
||||||
|
continue;
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||||
|
<div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>"
|
||||||
|
data-key="<?php echo esc_attr( $key ); ?>">
|
||||||
|
{{{user.<?php echo $key; ?>}}}
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
|
|
||||||
|
<?php }
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $show_userinfo ) { ?>
|
||||||
|
|
||||||
|
<# var $show_block = false; #>
|
||||||
|
|
||||||
|
<?php foreach ( $reveal_fields as $k => $key ) {
|
||||||
|
if ( empty( $key ) ) {
|
||||||
|
unset( $reveal_fields[ $k ] );
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
<# $show_block = typeof user.<?php echo $key; ?> !== 'undefined'; #>
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
if ( $show_social ) { ?>
|
||||||
|
<# if ( ! $show_block ) { #>
|
||||||
|
<# $show_block = user.social_urls #>
|
||||||
|
<# } #>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div class="um-member-meta <?php if ( !$userinfo_animate ) { echo 'no-animate'; } ?>">
|
<# if ( $show_block ) { #>
|
||||||
|
<div class="um-member-meta-main">
|
||||||
|
|
||||||
<?php
|
<?php if ( $userinfo_animate ) { ?>
|
||||||
foreach ( $reveal_fields as $key ) :
|
<div class="um-member-more">
|
||||||
if ( empty( $key ) ) {
|
<a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a>
|
||||||
continue;
|
</div>
|
||||||
}
|
<?php } ?>
|
||||||
?>
|
|
||||||
<# if ( user.<?php echo $key;?> ) { #>
|
|
||||||
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>"> <span><strong>{{{user.label_<?php echo $key;?>}}}:</strong> {{{user.<?php echo $key;?>}}} </span> </div>
|
|
||||||
<# } #>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
<div class="um-member-meta <?php if ( ! $userinfo_animate ) { echo 'no-animate'; } ?>">
|
||||||
|
|
||||||
<?php if ( $show_social ) : ?>
|
<?php foreach ( $reveal_fields as $key ) { ?>
|
||||||
<div class="um-member-connect">
|
|
||||||
{{{user.social_urls}}}
|
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||||
|
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>">
|
||||||
|
<strong>{{{user.label_<?php echo $key;?>}}}:</strong> {{{user.<?php echo $key;?>}}}
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
|
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
if ( $show_social ) { ?>
|
||||||
|
<div class="um-member-connect">
|
||||||
|
{{{user.social_urls}}}
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="um-member-less"><a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a></div>
|
<?php if ( $userinfo_animate ) { ?>
|
||||||
</div>
|
<div class="um-member-less">
|
||||||
<?php endif; ?>
|
<a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<# }); #>
|
<# }); #>
|
||||||
<# } else { #>
|
<# } else { #>
|
||||||
|
|
||||||
<div class="um-members-none">
|
<div class="um-members-none">
|
||||||
<p><?php echo $args['no_users']; ?></p>
|
<p><?php echo $no_users; ?></p>
|
||||||
</div>
|
</div>
|
||||||
<# } #>
|
|
||||||
|
|
||||||
<div class="um-clear"></div>
|
<# } #>
|
||||||
</div>
|
|
||||||
|
<div class="um-clear"></div>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/template" id="tmpl-um-members-header">
|
||||||
|
<div class="um-members-intro">
|
||||||
|
<div class="um-members-total">
|
||||||
|
<# if ( data.args.show_count ) { #>
|
||||||
|
<# if ( data.users.length == 1 ) { #>
|
||||||
|
{{{data.pagination.header_single}}}
|
||||||
|
<# } else if ( data.users.length > 1 ) { #>
|
||||||
|
{{{data.pagination.header}}}
|
||||||
|
<# } #>
|
||||||
|
<# } #>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="um-clear"></div>
|
||||||
|
</script>
|
||||||
+101
-96
@@ -3,125 +3,130 @@
|
|||||||
|
|
||||||
<script type="text/template" id="tmpl-um-member-list">
|
<script type="text/template" id="tmpl-um-member-list">
|
||||||
<div class="um-members-list">
|
<div class="um-members-list">
|
||||||
<div class="um-clear"></div>
|
|
||||||
|
|
||||||
<div class="um-members-intro">
|
<# if ( data.length > 0 ) { #>
|
||||||
<div class="um-members-total">
|
<# _.each( data, function( user, key, list ) { #>
|
||||||
<# if ( data.args.show_count ) { #>
|
|
||||||
<# if ( data.users.length == 1 ) { #>
|
|
||||||
{{{data.pagination.header_single}}}
|
|
||||||
<# } else if ( data.users.length > 1 ) { #>
|
|
||||||
{{{data.pagination.header}}}
|
|
||||||
<# } #>
|
|
||||||
<# } #>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="um-clear"></div>
|
<div class="um-member um-role-{{{user.role}}} {{{user.account_status}}} <?php if ( $cover_photos ) { echo 'with-cover'; } ?>">
|
||||||
|
<div class="um-clear"></div>
|
||||||
|
|
||||||
<# if ( data.users.length > 0 ) { #>
|
<span class="um-member-status {{{user.account_status}}}">
|
||||||
<# _.each( data.users, function( user, key, list ) { #>
|
{{{user.account_status_name}}}
|
||||||
|
</span>
|
||||||
|
|
||||||
<div class="um-member um-role-{{{user.role}}} {{{user.account_status}}} <?php if ( $cover_photos ) { echo 'with-cover'; } ?>">
|
<?php if ( $profile_photo ) { ?>
|
||||||
<div class="um-clear"></div>
|
<div class="um-member-photo radius-<?php echo esc_attr( UM()->options()->get( 'profile_photocorner' ) ); ?>">
|
||||||
|
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
||||||
<span class="um-member-status {{{user.account_status}}}">{{{user.account_status_name}}}</span>
|
{{{user.avatar}}}
|
||||||
|
</a>
|
||||||
<?php if ( $profile_photo ) :
|
|
||||||
$default_size = str_replace( 'px', '', UM()->options()->get( 'profile_photosize' ) );
|
|
||||||
$corner = UM()->options()->get( 'profile_photocorner' );
|
|
||||||
?>
|
|
||||||
<div class="um-member-photo radius-<?php echo $corner; ?>">
|
|
||||||
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}"> {{{user.avatar}}} </a>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="um-member-card <?php echo ! $profile_photo ? 'no-photo' : '' ?>">
|
|
||||||
<div class="um-member-card-header">
|
|
||||||
<?php if ( $show_name ) : ?>
|
|
||||||
<div class="um-member-name">
|
|
||||||
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}"> {{{user.display_name_html}}} </a>
|
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php do_action( 'um_members_after_user_name_tmpl', $args ); ?>
|
<div class="um-member-card <?php echo ! $profile_photo ? 'no-photo' : '' ?>">
|
||||||
{{{user.hook_after_user_name}}}
|
<div class="um-member-card-header">
|
||||||
</div>
|
<?php if ( $show_name ) { ?>
|
||||||
|
<div class="um-member-name">
|
||||||
|
<a href="{{{user.profile_url}}}" title="{{{user.display_name}}}">
|
||||||
|
{{{user.display_name_html}}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
do_action( 'um_members_after_user_name_tmpl', $args ); ?>
|
||||||
|
{{{user.hook_after_user_name}}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="um-member-card-content">
|
||||||
|
<?php if ( $show_tagline && ! empty( $tagline_fields ) && is_array( $tagline_fields ) ) {
|
||||||
|
foreach ( $tagline_fields as $key ) {
|
||||||
|
if ( empty( $key ) ) {
|
||||||
|
continue;
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||||
|
<div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>"
|
||||||
|
data-key="<?php echo esc_attr( $key ); ?>">
|
||||||
|
{{{user.<?php echo $key; ?>}}}
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
|
|
||||||
|
<?php }
|
||||||
|
} ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="um-member-card-content">
|
<?php if ( $show_userinfo ) { ?>
|
||||||
<?php
|
|
||||||
if ( $show_tagline && is_array( $tagline_fields ) ) :
|
|
||||||
foreach ( $tagline_fields as $key ) :
|
|
||||||
if ( empty( $key ) ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<# if ( user.<?php echo $key;?> ) { #>
|
<# var $show_block = false; #>
|
||||||
<div class="um-member-tagline um-member-tagline-<?php echo $key;?>"> {{{user.<?php echo $key;?>}}} </div>
|
|
||||||
<# } #>
|
|
||||||
|
|
||||||
<?php
|
<?php foreach ( $reveal_fields as $k => $key ) {
|
||||||
endforeach;
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?php if ( $show_userinfo ) : ?>
|
|
||||||
<div class="um-member-meta-main">
|
|
||||||
<div class="um-member-meta no-animate">
|
|
||||||
<?php
|
|
||||||
foreach ( $reveal_fields as $key ) :
|
|
||||||
if ( empty( $key ) ) {
|
if ( empty( $key ) ) {
|
||||||
continue;
|
unset( $reveal_fields[ $k ] );
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
|
|
||||||
<# if ( user.<?php echo $key;?> ) { #>
|
<# $show_block = typeof user.<?php echo $key; ?> !== 'undefined'; #>
|
||||||
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>"> <span> <strong>{{{user.label_<?php echo $key;?>}}}: </strong> {{{user.<?php echo $key;?>}}} </span> </div>
|
<?php }
|
||||||
|
|
||||||
|
if ( $show_social ) { ?>
|
||||||
|
<# if ( ! $show_block ) { #>
|
||||||
|
<# $show_block = user.social_urls #>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<# if ( $show_block ) { #>
|
||||||
|
<div class="um-member-meta-main">
|
||||||
|
<div class="um-member-meta no-animate">
|
||||||
|
<?php foreach ( $reveal_fields as $key ) { ?>
|
||||||
|
|
||||||
<?php if ( $show_social ) : ?>
|
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||||
<div class="um-member-connect">{{{user.social_urls}}}</div>
|
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>">
|
||||||
<?php endif; ?>
|
<strong>{{{user.label_<?php echo $key;?>}}}:</strong> {{{user.<?php echo $key;?>}}}
|
||||||
</div>
|
</div>
|
||||||
|
<# } #>
|
||||||
|
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
if ( $show_social ) { ?>
|
||||||
|
<div class="um-member-connect">
|
||||||
|
{{{user.social_urls}}}
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="um-member-card-actions">
|
<div class="um-member-card-actions">
|
||||||
<# if ( user.actions.length > 0 ) { #>
|
|
||||||
<# _.each( user.actions, function( action, action_key, action_list ) { #>
|
<# if ( user.actions.length > 0 ) { #>
|
||||||
<div class="{{{action.wrapper_class}}}">
|
<# _.each( user.actions, function( action, action_key, action_list ) { #>
|
||||||
<a href="{{{action.url}}}" class="{{{action.class}}}">
|
<div class="{{{action.wrapper_class}}}">
|
||||||
{{{action.title}}}
|
<a href="{{{action.url}}}" class="{{{action.class}}}">
|
||||||
</a>
|
{{{action.title}}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<# }); #>
|
||||||
|
<# } #>
|
||||||
|
|
||||||
|
<?php do_action( 'um_members_just_after_name_tmpl', $args ); ?>
|
||||||
|
{{{user.hook_just_after_name}}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="um-clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<# }); #>
|
|
||||||
<# } #>
|
|
||||||
|
|
||||||
<?php do_action( 'um_members_just_after_name_tmpl', $args ); ?>
|
<div class="um-clear"></div>
|
||||||
{{{user.hook_just_after_name}}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<# }); #>
|
||||||
<div class="um-clear"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="um-clear"></div>
|
|
||||||
|
|
||||||
<# }); #>
|
|
||||||
<# } else { #>
|
<# } else { #>
|
||||||
|
|
||||||
<div class="um-members-none">
|
<div class="um-members-none">
|
||||||
<p><?php echo $args['no_users']; ?></p>
|
<p><?php echo $no_users; ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<?php _e( 'Jump to page:','ultimate-member' ); ?>
|
<?php _e( 'Jump to page:','ultimate-member' ); ?>
|
||||||
<select class="um-s2 um-members-pagi-dropdown" style="width: 100px;display:inline-block;">
|
<select class="um-s2 um-members-pagi-dropdown" style="width: 100px;display:inline-block;">
|
||||||
<# _.each( data.pagination.pages_to_show, function( page, key, list ) { #>
|
<# _.each( data.pagination.pages_to_show, function( page, key, list ) { #>
|
||||||
<option value="{{{page}}}" <# if ( page == data.pagination.current_page ) { #>selected<# } #>>{{{page}}} <?php _e( 'of','ultimate-member' ) ?> {{{data.pagination.total_pages}}}</option>
|
<option value="{{{page}}}" <# if ( page == data.pagination.current_page ) { #>selected<# } #>>{{{page}}} <?php _e( 'of','ultimate-member' ) ?> {{{data.pagination.total_pages}}}</option>
|
||||||
<# }); #>
|
<# }); #>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ foreach ( $args['view_types'] as $type ) {
|
|||||||
$basename = UM()->member_directory()->get_type_basename( $type );
|
$basename = UM()->member_directory()->get_type_basename( $type );
|
||||||
UM()->get_template( 'members-' . $type . '.php', $basename, $args, true );
|
UM()->get_template( 'members-' . $type . '.php', $basename, $args, true );
|
||||||
}
|
}
|
||||||
|
UM()->get_template( 'members-header.php', '', $args, true );
|
||||||
UM()->get_template( 'members-pagination.php', '', $args, true ); ?>
|
UM()->get_template( 'members-pagination.php', '', $args, true ); ?>
|
||||||
|
|
||||||
<div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( substr( md5( $form_id ), 10, 5 ) ); ?>"
|
<div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( substr( md5( $form_id ), 10, 5 ) ); ?>"
|
||||||
|
|||||||
Reference in New Issue
Block a user