mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- member directory;
This commit is contained in:
+769
-345
File diff suppressed because it is too large
Load Diff
@@ -1452,7 +1452,6 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
require_once 'core/um-actions-register.php';
|
||||
require_once 'core/um-actions-profile.php';
|
||||
require_once 'core/um-actions-account.php';
|
||||
require_once 'core/um-actions-members.php';
|
||||
require_once 'core/um-actions-global.php';
|
||||
require_once 'core/um-actions-user.php';
|
||||
require_once 'core/um-actions-save-profile.php';
|
||||
|
||||
@@ -54,6 +54,9 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) {
|
||||
|
||||
add_action( 'wp_ajax_nopriv_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
|
||||
add_action( 'wp_ajax_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
|
||||
|
||||
add_action( 'wp_ajax_nopriv_um_get_members', array( UM()->member_directory(), 'ajax_get_members' ) );
|
||||
add_action( 'wp_ajax_um_get_members', array( UM()->member_directory(), 'ajax_get_members' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+42
-1366
File diff suppressed because it is too large
Load Diff
@@ -1,255 +0,0 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
|
||||
/**
|
||||
* Member Directory Search
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
function um_members_directory_search( $args ) {
|
||||
$search_filters = array();
|
||||
|
||||
if ( isset( $args['search_fields'] ) ) {
|
||||
foreach ( $args['search_fields'] as $k => $testfilter ) {
|
||||
if ( $testfilter && ! in_array( $testfilter, (array) $search_filters ) ) {
|
||||
$search_filters[] = $testfilter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type filter
|
||||
* @title um_frontend_member_search_filters
|
||||
* @description Extend Member Directory Search filter
|
||||
* @input_vars
|
||||
* [{"var":"$search_filters","type":"array","desc":"Search Filters"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage
|
||||
* <?php add_filter( 'um_frontend_member_search_filters', 'function_name', 10, 1 ); ?>
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_frontend_member_search_filters', 'my_frontend_member_search_filters', 10, 1 );
|
||||
* function my_frontend_member_search_filters( $search_filters ) {
|
||||
* // your code here
|
||||
* return $search_filters;
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$search_filters = apply_filters( 'um_frontend_member_search_filters', $search_filters );
|
||||
|
||||
if ( $args['search'] == 1 && is_array( $search_filters ) ) { // search on
|
||||
|
||||
$current_user_roles = um_user( 'roles' );
|
||||
if ( ! empty( $args['roles_can_search'] ) && ( empty( $current_user_roles ) || count( array_intersect( $current_user_roles, $args['roles_can_search'] ) ) <= 0 ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$count = count( $search_filters ); ?>
|
||||
|
||||
<div class="um-search um-search-<?php echo esc_attr( $count ); ?>">
|
||||
|
||||
<form method="get" action="">
|
||||
|
||||
<?php if ( isset( $_REQUEST['page_id'] ) && get_option( 'permalink_structure' ) == 0 ) { ?>
|
||||
|
||||
<input type="hidden" name="page_id" id="page_id" value="<?php echo esc_attr( $_REQUEST['page_id'] ); ?>" />
|
||||
|
||||
<?php }
|
||||
|
||||
$i = 0;
|
||||
foreach ( $search_filters as $filter ) {
|
||||
$i++;
|
||||
|
||||
if ( $i % 2 == 0 ) {
|
||||
$add_class = 'um-search-filter-2';
|
||||
} else {
|
||||
$add_class = '';
|
||||
} ?>
|
||||
|
||||
<div class="um-search-filter <?php echo esc_attr( $add_class ) ?>">
|
||||
<?php UM()->members()->show_filter( $filter ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-clear"></div>
|
||||
|
||||
<div class="um-search-submit">
|
||||
|
||||
<input type="hidden" name="um_search" id="um_search" value="1" />
|
||||
|
||||
<a href="javascript:void(0);" class="um-button um-do-search"><?php _e('Search','ultimate-member' ); ?></a>
|
||||
<a href="<?php echo esc_url( UM()->permalinks()->get_current_url( true ) ); ?>" class="um-button um-alt"><?php _e( 'Reset', 'ultimate-member' ); ?></a>
|
||||
|
||||
</div>
|
||||
<div class="um-clear"></div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
//add_action( 'um_members_directory_search', 'um_members_directory_search' );
|
||||
|
||||
|
||||
/**
|
||||
* Pre-display Member Directory
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
function um_pre_directory_shortcode( $args ) {
|
||||
extract( $args );
|
||||
UM()->members()->results = UM()->members()->get_members( $args );
|
||||
}
|
||||
add_action( 'um_pre_directory_shortcode', 'um_pre_directory_shortcode' );
|
||||
|
||||
|
||||
/**
|
||||
* Member Directory Header
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
function um_members_directory_head( $args ) {
|
||||
extract( $args );
|
||||
|
||||
if ( isset( $_REQUEST['um_search'] ) ) {
|
||||
$is_filtering = 1;
|
||||
} elseif ( UM()->is_filtering == 1 ) {
|
||||
$is_filtering = 1;
|
||||
} else {
|
||||
$is_filtering = 0;
|
||||
}
|
||||
|
||||
if ( um_members( 'header' ) && $is_filtering && um_members( 'users_per_page' ) ) { ?>
|
||||
|
||||
<div class="um-members-intro">
|
||||
|
||||
<div class="um-members-total"><?php echo ( um_members( 'total_users' ) > 1 ) ? um_members( 'header' ) : um_members( 'header_single' ); ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
}
|
||||
add_action( 'um_members_directory_head', 'um_members_directory_head' );
|
||||
|
||||
|
||||
/**
|
||||
* Member Directory Pagination
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
function um_members_directory_pagination( $args ) {
|
||||
extract( $args );
|
||||
|
||||
|
||||
if ( isset( $args['search'] ) && $args['search'] == 1 && isset( $args['must_search'] ) && $args['must_search'] == 1 && ! isset( $_REQUEST['um_search'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( um_members('total_pages') > 1 ) { // needs pagination
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-members-pagidrop uimob340-show uimob500-show">
|
||||
|
||||
<?php _e( 'Jump to page:', 'ultimate-member' ); ?>
|
||||
|
||||
<?php if ( um_members( 'pages_to_show' ) && is_array( um_members( 'pages_to_show' ) ) ) { ?>
|
||||
<select onChange="window.location.href=this.value" class="um-s2" style="width: 100px">
|
||||
<?php foreach( um_members( 'pages_to_show' ) as $i ) { ?>
|
||||
<option value="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', $i ) ); ?>" <?php selected( $i, um_members( 'page' ) ); ?>><?php printf( __( '%s of %d', 'ultimate-member' ), $i, um_members( 'total_pages' ) ); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="um-members-pagi uimob340-hide uimob500-hide">
|
||||
|
||||
<?php if ( um_members( 'page' ) != 1 ) { ?>
|
||||
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', 1 ) ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e( 'First Page', 'ultimate-member' ); ?>"><i class="um-faicon-angle-double-left"></i></a>
|
||||
<?php } else { ?>
|
||||
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-double-left"></i></span>
|
||||
<?php }
|
||||
|
||||
if ( um_members( 'page' ) > 1 ) { ?>
|
||||
<a href="<?php echo UM()->permalinks()->add_query( 'members_page', um_members( 'page' ) - 1 ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e( 'Previous', 'ultimate-member'); ?>"><i class="um-faicon-angle-left"></i></a>
|
||||
<?php } else { ?>
|
||||
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-left"></i></span>
|
||||
<?php }
|
||||
|
||||
if ( um_members('pages_to_show') && is_array( um_members( 'pages_to_show' ) ) ) {
|
||||
foreach ( um_members( 'pages_to_show' ) as $i ) {
|
||||
|
||||
if ( um_members('page') == $i ) { ?>
|
||||
|
||||
<span class="pagi current"><?php echo $i; ?></span>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', $i ) ); ?>" class="pagi"><?php echo $i; ?></a>
|
||||
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
|
||||
if ( um_members('page') != um_members( 'total_pages' ) ) { ?>
|
||||
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', um_members( 'page' ) + 1 ) ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e('Next','ultimate-member'); ?>"><i class="um-faicon-angle-right"></i></a>
|
||||
<?php } else { ?>
|
||||
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-right"></i></span>
|
||||
<?php }
|
||||
|
||||
if ( um_members( 'page' ) != um_members( 'total_pages' ) ) { ?>
|
||||
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', um_members( 'total_pages' ) ) ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e('Last Page','ultimate-member'); ?>"><i class="um-faicon-angle-double-right"></i></a>
|
||||
<?php } else { ?>
|
||||
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-double-right"></i></span>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
add_action( 'um_members_directory_footer', 'um_members_directory_pagination' );
|
||||
|
||||
|
||||
/**
|
||||
* Member Directory Display
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
function um_members_directory_display( $args ) {
|
||||
extract( $args );
|
||||
|
||||
if ( isset( $args['search'] ) && $args['search'] == 1 && isset( $args['must_search'] ) && $args['must_search'] == 1 && ! isset( $_REQUEST['um_search'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( um_members( 'no_users' ) ) { ?>
|
||||
|
||||
<div class="um-members-none">
|
||||
<p><?php echo esc_html( $args['no_users'] ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
$file = um_path . 'templates/members-grid.php';
|
||||
$theme_file = get_stylesheet_directory() . '/ultimate-member/templates/members-grid.php';
|
||||
|
||||
if ( file_exists( $theme_file ) ) {
|
||||
$file = $theme_file;
|
||||
}
|
||||
|
||||
include $file;
|
||||
|
||||
}
|
||||
add_action( 'um_members_directory_display', 'um_members_directory_display' );
|
||||
@@ -9,25 +9,25 @@
|
||||
*
|
||||
* @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 );
|
||||
//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 );
|
||||
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ function um_remove_special_users_from_list( $query_args, $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 );
|
||||
|
||||
|
||||
/**
|
||||
@@ -283,7 +283,7 @@ function um_add_search_to_query( $query_args, $args ) {
|
||||
return $query_args;
|
||||
|
||||
}
|
||||
add_filter( 'um_prepare_user_query_args', 'um_add_search_to_query', 50, 2 );
|
||||
//add_filter( 'um_prepare_user_query_args', 'um_add_search_to_query', 50, 2 );
|
||||
|
||||
|
||||
/**
|
||||
@@ -452,116 +452,4 @@ function um_prepare_user_query_args( $query_args, $args ) {
|
||||
|
||||
return $query_args;
|
||||
}
|
||||
add_filter( 'um_prepare_user_query_args', 'um_prepare_user_query_args', 10, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Sorting by last login date
|
||||
*
|
||||
* @param $query_args
|
||||
* @param $sortby
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function um_sortby_last_login( $query_args, $sortby ) {
|
||||
if ( $sortby == 'last_login' ) {
|
||||
$query_args['orderby'] = array( 'um_last_login' => 'DESC' );
|
||||
$query_args['meta_query'][] = array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => '_um_last_login',
|
||||
'compare' => 'EXISTS',
|
||||
),
|
||||
'um_last_login' => array(
|
||||
'key' => '_um_last_login',
|
||||
'compare' => 'NOT EXISTS',
|
||||
),
|
||||
);
|
||||
}
|
||||
return $query_args;
|
||||
}
|
||||
add_filter( 'um_modify_sortby_parameter', 'um_sortby_last_login', 100, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Sorting random
|
||||
*
|
||||
* @param $query
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function um_modify_sortby_randomly( $query ) {
|
||||
|
||||
if( 'random' == $query->query_vars["orderby"] ) {
|
||||
|
||||
if( um_is_session_started() === false ){
|
||||
@session_start();
|
||||
}
|
||||
|
||||
// Reset seed on load of initial
|
||||
if( ! isset( $_REQUEST['members_page'] ) || $_REQUEST['members_page'] == 0 || $_REQUEST['members_page'] == 1 ) {
|
||||
if( isset( $_SESSION['seed'] ) ) {
|
||||
unset( $_SESSION['seed'] );
|
||||
}
|
||||
}
|
||||
|
||||
// Get seed from session variable if it exists
|
||||
$seed = false;
|
||||
if( isset( $_SESSION['seed'] ) ) {
|
||||
$seed = $_SESSION['seed'];
|
||||
}
|
||||
|
||||
// Set new seed if none exists
|
||||
if ( ! $seed ) {
|
||||
$seed = rand();
|
||||
$_SESSION['seed'] = $seed;
|
||||
}
|
||||
|
||||
|
||||
$query->query_orderby = 'ORDER by RAND('. $seed.')';
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
add_filter( 'pre_user_query','um_modify_sortby_randomly' );
|
||||
|
||||
|
||||
/**
|
||||
* Hook in the member results array
|
||||
*
|
||||
* @param $result
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function um_prepare_user_results_array( $result ) {
|
||||
if ( empty( $result['users_per_page'] ) ) {
|
||||
$result['no_users'] = 1;
|
||||
} else {
|
||||
$result['no_users'] = 0;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
add_filter( 'um_prepare_user_results_array', 'um_prepare_user_results_array', 50, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves search filter options from a callback
|
||||
*
|
||||
* @param $atts array
|
||||
* @return array
|
||||
*/
|
||||
function um_search_select_fields( $atts ) {
|
||||
|
||||
if( isset( $atts['custom_dropdown_options_source'] ) && ! empty( $atts['custom_dropdown_options_source'] ) ){
|
||||
$atts['custom'] = true;
|
||||
$atts['options'] = UM()->fields()->get_options_from_callback( $atts, $atts['type'] );
|
||||
}
|
||||
|
||||
if( isset( $atts['label'] ) ){
|
||||
$atts['label'] = strip_tags( $atts['label'] );
|
||||
}
|
||||
|
||||
return $atts;
|
||||
}
|
||||
add_filter( 'um_search_select_fields', 'um_search_select_fields' );
|
||||
//add_filter( 'um_prepare_user_query_args', 'um_prepare_user_query_args', 10, 2 );
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||
|
||||
<div class="um-members">
|
||||
|
||||
<div class="um-gutter-sizer"></div>
|
||||
|
||||
<?php $i = 0;
|
||||
foreach ( um_members( 'users_per_page' ) as $member ) {
|
||||
$i++;
|
||||
um_fetch_user( $member ); ?>
|
||||
|
||||
<div class="um-member um-role-<?php echo esc_attr( um_user( 'role' ) ) . ' ' . esc_attr( um_user('account_status') ); ?> <?php if ( $cover_photos ) { echo 'with-cover'; } ?>">
|
||||
|
||||
<span class="um-member-status <?php echo esc_attr( um_user( 'account_status' ) ); ?>"><?php echo esc_html( um_user( 'account_status_name' ) ); ?></span>
|
||||
|
||||
<?php if ( $cover_photos ) {
|
||||
$sizes = UM()->options()->get( 'cover_thumb_sizes' );
|
||||
if ( UM()->mobile()->isTablet() ) {
|
||||
$cover_size = $sizes[1];
|
||||
} else {
|
||||
$cover_size = $sizes[0];
|
||||
} ?>
|
||||
|
||||
<div class="um-member-cover" data-ratio="<?php echo esc_attr( UM()->options()->get( 'profile_cover_ratio' ) ); ?>">
|
||||
<div class="um-member-cover-e">
|
||||
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
|
||||
<?php echo um_user( 'cover_photo', $cover_size ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
|
||||
if ( $profile_photo ) {
|
||||
$corner = UM()->options()->get( 'profile_photocorner' );
|
||||
|
||||
$default_size = UM()->options()->get( 'profile_photosize' );
|
||||
$default_size = str_replace( 'px', '', $default_size ); ?>
|
||||
|
||||
<div class="um-member-photo radius-<?php echo esc_attr( $corner ); ?>">
|
||||
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
|
||||
<?php echo get_avatar( um_user( 'ID' ), $default_size ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-member-card <?php if ( ! $profile_photo ) { echo 'no-photo'; } ?>">
|
||||
|
||||
<?php if ( $show_name ) { ?>
|
||||
<div class="um-member-name">
|
||||
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
|
||||
<?php echo um_user( 'display_name', 'html' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type action
|
||||
* @title um_members_just_after_name
|
||||
* @description Show content just after user name
|
||||
* @input_vars
|
||||
* [{"var":"$user_id","type":"int","desc":"User ID"},
|
||||
* {"var":"$args","type":"array","desc":"Member directory shortcode arguments"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_action( 'um_members_just_after_name', 'function_name', 10, 2 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_action( 'um_members_just_after_name', 'my_members_just_after_name', 10, 2 );
|
||||
* function my_members_just_after_name( $user_id, $args ) {
|
||||
* // your code here
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
do_action( 'um_members_just_after_name', um_user( 'ID' ), $args );
|
||||
|
||||
if ( UM()->roles()->um_current_user_can( 'edit', um_user( 'ID' ) ) ) { ?>
|
||||
<div class="um-members-edit-btn">
|
||||
<a href="<?php echo esc_url( um_edit_profile_url() ); ?>" class="um-edit-profile-btn um-button um-alt">
|
||||
<?php _e( 'Edit profile','ultimate-member' ) ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type action
|
||||
* @title um_members_after_user_name
|
||||
* @description Show content just after user name
|
||||
* @input_vars
|
||||
* [{"var":"$user_id","type":"int","desc":"User ID"},
|
||||
* {"var":"$args","type":"array","desc":"Member directory shortcode arguments"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_action( 'um_members_after_user_name', 'function_name', 10, 2 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_action( 'um_members_after_user_name', 'my_members_after_user_name', 10, 2 );
|
||||
* function my_members_after_user_name( $user_id, $args ) {
|
||||
* // your code here
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
do_action( 'um_members_after_user_name', um_user( 'ID' ), $args );
|
||||
|
||||
if ( $show_tagline && ! empty( $tagline_fields ) && is_array( $tagline_fields ) ) {
|
||||
|
||||
um_fetch_user( $member );
|
||||
|
||||
foreach( $tagline_fields as $key ) {
|
||||
if ( $key ) {
|
||||
$value = um_filtered_value( $key );
|
||||
if ( ! $value ) {
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>">
|
||||
<?php _e( $value, 'ultimate-member' ); ?>
|
||||
</div>
|
||||
|
||||
<?php } // end if
|
||||
} // end foreach
|
||||
} // end if $show_tagline
|
||||
|
||||
if ( ! empty( $show_userinfo ) ) { ?>
|
||||
|
||||
<div class="um-member-meta-main">
|
||||
|
||||
<?php if ( $userinfo_animate ) { ?>
|
||||
<div class="um-member-more"><a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-member-meta <?php if ( ! $userinfo_animate ) { echo 'no-animate'; } ?>">
|
||||
|
||||
<?php um_fetch_user( $member );
|
||||
if ( ! empty( $reveal_fields ) && is_array( $reveal_fields ) ) {
|
||||
foreach ( $reveal_fields as $key ) {
|
||||
if ( $key ) {
|
||||
$value = um_filtered_value( $key );
|
||||
if ( ! $value ) {
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<div class="um-member-metaline um-member-metaline-<?php echo esc_attr( $key ); ?>">
|
||||
<span><strong><?php echo esc_html( UM()->fields()->get_label( $key ) ); ?>:</strong> <?php _e( $value, 'ultimate-member' ); ?></span>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
|
||||
if ( $show_social ) { ?>
|
||||
<div class="um-member-connect">
|
||||
<?php UM()->fields()->show_social_urls(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="um-member-less"><a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a></div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php um_reset_user_clean();
|
||||
} // end foreach
|
||||
|
||||
um_reset_user(); ?>
|
||||
|
||||
<div class="um-clear"></div>
|
||||
|
||||
</div>
|
||||
+132
-173
@@ -1,181 +1,140 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||
|
||||
<div class="um-members">
|
||||
|
||||
<div class="um-gutter-sizer"></div>
|
||||
|
||||
<?php $i = 0;
|
||||
foreach ( um_members( 'users_per_page' ) as $member ) {
|
||||
$i++;
|
||||
um_fetch_user( $member ); ?>
|
||||
|
||||
<div class="um-member um-role-<?php echo esc_attr( um_user( 'role' ) ) . ' ' . esc_attr( um_user('account_status') ); ?> <?php if ( $cover_photos ) { echo 'with-cover'; } ?>">
|
||||
|
||||
<span class="um-member-status <?php echo esc_attr( um_user( 'account_status' ) ); ?>"><?php echo esc_html( um_user( 'account_status_name' ) ); ?></span>
|
||||
|
||||
<?php if ( $cover_photos ) {
|
||||
$sizes = UM()->options()->get( 'cover_thumb_sizes' );
|
||||
if ( UM()->mobile()->isTablet() ) {
|
||||
$cover_size = $sizes[1];
|
||||
} else {
|
||||
$cover_size = $sizes[0];
|
||||
} ?>
|
||||
|
||||
<div class="um-member-cover" data-ratio="<?php echo esc_attr( UM()->options()->get( 'profile_cover_ratio' ) ); ?>">
|
||||
<div class="um-member-cover-e">
|
||||
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
|
||||
<?php echo um_user( 'cover_photo', $cover_size ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
|
||||
if ( $profile_photo ) {
|
||||
$corner = UM()->options()->get( 'profile_photocorner' );
|
||||
|
||||
$default_size = UM()->options()->get( 'profile_photosize' );
|
||||
$default_size = str_replace( 'px', '', $default_size ); ?>
|
||||
|
||||
<div class="um-member-photo radius-<?php echo esc_attr( $corner ); ?>">
|
||||
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
|
||||
<?php echo get_avatar( um_user( 'ID' ), $default_size ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-member-card <?php if ( ! $profile_photo ) { echo 'no-photo'; } ?>">
|
||||
|
||||
<?php if ( $show_name ) { ?>
|
||||
<div class="um-member-name">
|
||||
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
|
||||
<?php echo um_user( 'display_name', 'html' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type action
|
||||
* @title um_members_just_after_name
|
||||
* @description Show content just after user name
|
||||
* @input_vars
|
||||
* [{"var":"$user_id","type":"int","desc":"User ID"},
|
||||
* {"var":"$args","type":"array","desc":"Member directory shortcode arguments"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_action( 'um_members_just_after_name', 'function_name', 10, 2 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_action( 'um_members_just_after_name', 'my_members_just_after_name', 10, 2 );
|
||||
* function my_members_just_after_name( $user_id, $args ) {
|
||||
* // your code here
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
do_action( 'um_members_just_after_name', um_user( 'ID' ), $args );
|
||||
|
||||
if ( UM()->roles()->um_current_user_can( 'edit', um_user( 'ID' ) ) ) { ?>
|
||||
<div class="um-members-edit-btn">
|
||||
<a href="<?php echo esc_url( um_edit_profile_url() ); ?>" class="um-edit-profile-btn um-button um-alt">
|
||||
<?php _e( 'Edit profile','ultimate-member' ) ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type action
|
||||
* @title um_members_after_user_name
|
||||
* @description Show content just after user name
|
||||
* @input_vars
|
||||
* [{"var":"$user_id","type":"int","desc":"User ID"},
|
||||
* {"var":"$args","type":"array","desc":"Member directory shortcode arguments"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_action( 'um_members_after_user_name', 'function_name', 10, 2 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_action( 'um_members_after_user_name', 'my_members_after_user_name', 10, 2 );
|
||||
* function my_members_after_user_name( $user_id, $args ) {
|
||||
* // your code here
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
do_action( 'um_members_after_user_name', um_user( 'ID' ), $args );
|
||||
|
||||
if ( $show_tagline && ! empty( $tagline_fields ) && is_array( $tagline_fields ) ) {
|
||||
|
||||
um_fetch_user( $member );
|
||||
|
||||
foreach( $tagline_fields as $key ) {
|
||||
if ( $key ) {
|
||||
$value = um_filtered_value( $key );
|
||||
if ( ! $value ) {
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>">
|
||||
<?php _e( $value, 'ultimate-member' ); ?>
|
||||
</div>
|
||||
|
||||
<?php } // end if
|
||||
} // end foreach
|
||||
} // end if $show_tagline
|
||||
|
||||
if ( ! empty( $show_userinfo ) ) { ?>
|
||||
|
||||
<div class="um-member-meta-main">
|
||||
|
||||
<?php if ( $userinfo_animate ) { ?>
|
||||
<div class="um-member-more"><a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-member-meta <?php if ( ! $userinfo_animate ) { echo 'no-animate'; } ?>">
|
||||
|
||||
<?php um_fetch_user( $member );
|
||||
if ( ! empty( $reveal_fields ) && is_array( $reveal_fields ) ) {
|
||||
foreach ( $reveal_fields as $key ) {
|
||||
if ( $key ) {
|
||||
$value = um_filtered_value( $key );
|
||||
if ( ! $value ) {
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<div class="um-member-metaline um-member-metaline-<?php echo esc_attr( $key ); ?>">
|
||||
<span><strong><?php echo esc_html( UM()->fields()->get_label( $key ) ); ?>:</strong> <?php _e( $value, 'ultimate-member' ); ?></span>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
|
||||
if ( $show_social ) { ?>
|
||||
<div class="um-member-connect">
|
||||
<?php UM()->fields()->show_social_urls(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="um-member-less"><a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a></div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<script type="text/template" id="tmpl-um-member-grid">
|
||||
<div class="um-members-grid">
|
||||
<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>
|
||||
|
||||
<?php um_reset_user_clean();
|
||||
} // end foreach
|
||||
<div class="um-members">
|
||||
<div class="um-gutter-sizer"></div>
|
||||
|
||||
um_reset_user(); ?>
|
||||
<# if ( data.users.length > 0 ) { #>
|
||||
<# _.each( data.users, function( user, key, list ) { #>
|
||||
|
||||
<div class="um-clear"></div>
|
||||
<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}}}">{{{user.account_status_name}}}</span>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( $cover_photos ) :
|
||||
$sizes = UM()->options()->get( 'cover_thumb_sizes' );
|
||||
$cover_size = UM()->mobile()->isTablet() ? $sizes[1] : $sizes[0];
|
||||
?>
|
||||
<div class="um-member-cover" data-ratio="<?php echo UM()->options()->get( 'profile_cover_ratio' ); ?>">
|
||||
<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>
|
||||
<# } #>
|
||||
|
||||
<?php
|
||||
endforeach;
|
||||
endif;
|
||||
?>
|
||||
|
||||
|
||||
<?php if ( $show_userinfo ) : ?>
|
||||
<div class="um-member-meta-main">
|
||||
<?php if ( $userinfo_animate ) { ?>
|
||||
<div class="um-member-more"><a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-member-meta <?php if ( !$userinfo_animate ) { echo 'no-animate'; } ?>">
|
||||
|
||||
<?php
|
||||
foreach ( $reveal_fields as $key ) :
|
||||
if ( empty( $key ) ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<# 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; ?>
|
||||
|
||||
|
||||
<?php if ( $show_social ) : ?>
|
||||
<div class="um-member-connect">
|
||||
{{{user.social_urls}}}
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="um-member-less"><a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<# }); #>
|
||||
<# } else { #>
|
||||
|
||||
<div class="um-members-none">
|
||||
<p><?php echo $args['no_users']; ?></p>
|
||||
</div>
|
||||
<# } #>
|
||||
|
||||
<div class="um-clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
@@ -3,25 +3,25 @@
|
||||
|
||||
<script type="text/template" id="tmpl-um-members-pagination">
|
||||
<# if ( data.pagination.pages_to_show.length > 0 ) { #>
|
||||
<div class="um-members-pagidrop uimob340-show uimob500-show">
|
||||
<?php _e( 'Jump to page:','ultimate-member' ); ?>
|
||||
<select class="um-s2 um-members-pagi-dropdown" style="width: 100px;display:inline-block;">
|
||||
<div class="um-members-pagidrop uimob340-show uimob500-show">
|
||||
<?php _e( 'Jump to page:','ultimate-member' ); ?>
|
||||
<select class="um-s2 um-members-pagi-dropdown" style="width: 100px;display:inline-block;">
|
||||
<# _.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>
|
||||
<# }); #>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="um-members-pagi uimob340-hide uimob500-hide">
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == 1 ) { #>disabled<# } #>" data-page="first"><i class="um-faicon-angle-double-left"></i></span>
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == 1 ) { #>disabled<# } #>" data-page="prev"><i class="um-faicon-angle-left"></i></span>
|
||||
|
||||
<# _.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>
|
||||
<span class="pagi <# if ( page == data.pagination.current_page ) { #>current<# } #>" data-page="{{{page}}}">{{{page}}}</span>
|
||||
<# }); #>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="um-members-pagi uimob340-hide uimob500-hide">
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == 1 ) { #>disabled<# } #>" data-page="first"><i class="um-faicon-angle-double-left"></i></span>
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == 1 ) { #>disabled<# } #>" data-page="prev"><i class="um-faicon-angle-left"></i></span>
|
||||
|
||||
<# _.each( data.pagination.pages_to_show, function( page, key, list ) { #>
|
||||
<span class="pagi <# if ( page == data.pagination.current_page ) { #>current<# } #>" data-page="{{{page}}}">{{{page}}}</span>
|
||||
<# }); #>
|
||||
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == data.pagination.total_pages ) { #>disabled<# } #>" data-page="next"><i class="um-faicon-angle-right"></i></span>
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == data.pagination.total_pages ) { #>disabled<# } #>" data-page="last"><i class="um-faicon-angle-double-right"></i></span>
|
||||
</div>
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == data.pagination.total_pages ) { #>disabled<# } #>" data-page="next"><i class="um-faicon-angle-right"></i></span>
|
||||
<span class="pagi pagi-arrow <# if ( data.pagination.current_page == data.pagination.total_pages ) { #>disabled<# } #>" data-page="last"><i class="um-faicon-angle-double-right"></i></span>
|
||||
</div>
|
||||
<# } #>
|
||||
</script>
|
||||
+26
-6
@@ -7,6 +7,8 @@ foreach ( UM()->config()->core_directory_meta['members'] as $k => $v ) {
|
||||
$def_args[ $key ] = $v;
|
||||
}
|
||||
|
||||
$unique_hash = substr( md5( $args['form_id'] ), 10, 5 );
|
||||
|
||||
$args = array_merge( $def_args, $args );
|
||||
|
||||
|
||||
@@ -32,12 +34,13 @@ if ( count( $args['view_types'] ) == 1 ) {
|
||||
$current_view = $args['view_types'][0];
|
||||
} else {
|
||||
$args['default_view'] = ! empty( $args['default_view'] ) ? $args['default_view'] : $args['view_types'][0];
|
||||
$current_view = ( ! empty( $_GET['view_type'] ) && in_array( $_GET['view_type'], $args['view_types'] ) ) ? $_GET['view_type'] : $args['default_view'];
|
||||
$current_view = ( ! empty( $_GET[ 'view_type_' . $unique_hash ] ) && in_array( $_GET[ 'view_type_' . $unique_hash ], $args['view_types'] ) ) ? $_GET[ 'view_type_' . $unique_hash ] : $args['default_view'];
|
||||
}
|
||||
|
||||
// Sorting
|
||||
$default_sorting = ! empty( $args['sortby'] ) ? $args['sortby'] : 'user_registered_desc';
|
||||
|
||||
$sort_from_url = '';
|
||||
if ( $args['enable_sorting'] ) {
|
||||
$sorting_options = empty( $args['sorting_fields'] ) ? array() : $args['sorting_fields'];
|
||||
if ( ! in_array( $default_sorting, $sorting_options ) ) {
|
||||
@@ -48,12 +51,19 @@ if ( $args['enable_sorting'] ) {
|
||||
$all_sorting_options = UM()->member_directory()->sort_fields;
|
||||
$sorting_options = array_intersect_key( $all_sorting_options, array_flip( $sorting_options ) );
|
||||
}
|
||||
|
||||
$sort_from_url = ( ! empty( $_GET[ 'sort_' . $unique_hash ] ) && in_array( $_GET[ 'sort_' . $unique_hash ], array_keys( $sorting_options ) ) ) ? $_GET[ 'sort_' . $unique_hash ] : $default_sorting;
|
||||
}
|
||||
|
||||
$current_page = ( ! empty( $_GET[ 'page_' . $unique_hash ] ) && is_numeric( $_GET[ 'page_' . $unique_hash ] ) ) ? (int) $_GET[ 'page_' . $unique_hash ] : 1;
|
||||
|
||||
//Search
|
||||
$search = isset( $args['search'] ) ? $args['search'] : false;
|
||||
$show_search = empty( $args['roles_can_search'] ) || ( ! empty( $priority_user_role ) && in_array( $priority_user_role, $args['roles_can_search'] ) );
|
||||
$search_from_url = '';
|
||||
if ( $search && $show_search ) {
|
||||
$search_from_url = ! empty( $_GET[ 'search_' . $unique_hash ] ) ? $_GET[ 'search_' . $unique_hash ] : '';
|
||||
}
|
||||
|
||||
|
||||
//Filters
|
||||
@@ -80,16 +90,26 @@ if ( ! $single_view ) {
|
||||
|
||||
if ( $args['enable_sorting'] && ! empty( $sorting_options ) && count( $sorting_options ) > 1 ) {
|
||||
$classes .= ' um-member-with-sorting';
|
||||
} ?>
|
||||
}
|
||||
|
||||
<div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( $form_id ); ?>" data-view_type="<?php echo esc_attr( $current_view ) ?>" data-hash="<?php echo esc_attr( substr( md5( $form_id ), 10, 5 ) ) ?>">
|
||||
//send $args variable to the templates
|
||||
$args['args'] = $args;
|
||||
foreach ( $args['view_types'] as $type ) {
|
||||
$basename = UM()->member_directory()->get_type_basename( $type );
|
||||
UM()->get_template( 'members-' . $type . '.php', $basename, $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 ) ); ?>"
|
||||
data-hash="<?php echo esc_attr( substr( md5( $form_id ), 10, 5 ) ) ?>"
|
||||
data-view_type="<?php echo esc_attr( $current_view ) ?>" data-page="<?php echo esc_attr( $current_page ) ?>">
|
||||
|
||||
<div class="um-form">
|
||||
|
||||
<div class="um-member-directory-header <?php echo esc_attr( $classes ) ?>">
|
||||
<?php if ( $search && $show_search ) { ?>
|
||||
<div class="um-member-directory-search-line">
|
||||
<input type="text" class="um-search-line" placeholder="<?php esc_attr_e( 'Search', 'ultimate-member' ) ?>" value="" />
|
||||
<input type="text" class="um-search-line" placeholder="<?php esc_attr_e( 'Search', 'ultimate-member' ) ?>" value="<?php echo esc_attr( $search_from_url ) ?>" />
|
||||
<div class="uimob340-show uimob500-show">
|
||||
<a href="javascript:void(0);" class="um-button um-do-search um-tip-n" title="<?php esc_attr_e( 'Search', 'ultimate-member' ); ?>">
|
||||
<i class="um-faicon-search"></i>
|
||||
@@ -105,7 +125,7 @@ if ( $args['enable_sorting'] && ! empty( $sorting_options ) && count( $sorting_o
|
||||
<div class="um-member-directory-sorting">
|
||||
<select class="um-s3 um-member-directory-sorting-options" id="um-member-directory-sorting-select-<?php echo esc_attr( $form_id ) ?>" data-placeholder="<?php esc_attr_e( 'Sort By', 'ultimate-member' ); ?>">
|
||||
<?php foreach ( $sorting_options as $value => $title ) { ?>
|
||||
<option value="<?php echo $value ?>" <?php selected( $default_sorting, $value ) ?>><?php echo $title ?></option>
|
||||
<option value="<?php echo $value ?>" <?php selected( $sort_from_url, $value ) ?>><?php echo $title ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -163,7 +183,7 @@ if ( $args['enable_sorting'] && ! empty( $sorting_options ) && count( $sorting_o
|
||||
|
||||
<div class="um-search um-search-<?php echo count( $search_filters ) ?>">
|
||||
<?php foreach ( $search_filters as $i => $filter ) {
|
||||
$filter_content = UM()->members()->show_filter( $filter );
|
||||
$filter_content = UM()->member_directory()->show_filter( $filter );
|
||||
if ( empty( $filter_content ) ) {
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
Reference in New Issue
Block a user