diff --git a/css/pmpro-member-directory.css b/css/pmpro-member-directory.css index 296c18b..58c314c 100644 --- a/css/pmpro-member-directory.css +++ b/css/pmpro-member-directory.css @@ -1,9 +1,15 @@ /* CSS Document */ +form.pmpro_member_directory_search { + align-items: center; + display: flex; + flex-direction: row; + gap: var(--pmpro--base--spacing--small); + justify-content: flex-end; -h2#pmpro_member_directory_subheading {clear: none; margin-top: 0; } -form.pmpro_member_directory_search {float: right; margin-bottom: 1rem; clear: both; } -form.pmpro_member_directory_search input[type=text] { } -form.pmpro_member_directory_search input[type=submit] {background: none; border: none; padding: 0; position: absolute; text-indent: -9999em; } + .pmpro_form_submit { + margin: 0; + } +} .pmpro_member_directory {clear: both; } .pmpro_pagination {margin: 1em 0;} @@ -24,51 +30,87 @@ div.pmpro_member_profile strong {display: block; } .pmpro_member_directory.pmpro_member_directory-2col, .pmpro_member_directory.pmpro_member_directory-3col, .pmpro_member_directory.pmpro_member_directory-4col { - display: grid; - grid-column-gap: 2.9rem; - grid-row-gap: 5.8rem; - text-align: center; + display: grid; + grid-column-gap: 2.9rem; + grid-row-gap: 2.9rem; + + .pmpro_card { + margin: 0; + + .pmpro_card_title a { + text-decoration: none; + } + .pmpro_card_title a:hover { + text-decoration: underline; + } + + .pmpro_card_title.pmpro_heading-avatar-right { + flex-direction: row-reverse; + justify-content: space-between; + } + .pmpro_card_title.pmpro_heading-avatar-top { + align-items: flex-start; + flex-direction: column; + } + .pmpro_card_content { + display: flex; + flex-direction: column; + gap: var(--pmpro--base--spacing--small); + } + + .pmpro_card_actions { + margin-top: auto; + } + } } .pmpro_member_directory.pmpro_member_directory-2col { - grid-template-columns: 1fr 1fr; + grid-template-columns: 1fr 1fr; } .pmpro_member_directory.pmpro_member_directory-3col { - grid-template-columns: 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr; } .pmpro_member_directory.pmpro_member_directory-4col { - grid-template-columns: 1fr 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr 1fr; } /* single directory item in list */ .pmpro_member_directory .pmpro_member_directory-item, .pmpro_member_directory .pmpro_member_directory_row { - word-break: break-word; + word-break: break-word; } .pmpro_member_directory_link { - word-break: normal; + word-break: normal; } /* single profile item */ -.pmpro_member_profile { } +.pmpro_member_profile { + + .pmpro_card_content { + display: flex; + flex-direction: column; + gap: var(--pmpro--base--spacing--medium); + margin-top: var(--pmpro--base--spacing--medium); + } +} .pmpro_member_profile .pmpromd_filename { - display: block; + display: block; } @media only screen and (max-width: 767px) { - .pmpro_member_directory.pmpro_member_directory-2col, - .pmpro_member_directory.pmpro_member_directory-3col, - .pmpro_member_directory.pmpro_member_directory-4col { - grid-template-columns: 1fr; - } + .pmpro_member_directory.pmpro_member_directory-2col, + .pmpro_member_directory.pmpro_member_directory-3col, + .pmpro_member_directory.pmpro_member_directory-4col { + grid-template-columns: 1fr; + } } /** * Pagination/page numbers */ .pmpro_page_numbers a { - padding: 6px; + padding: 6px; } .pmpro_page_numbers a.pmpro_page_active { - font-weight: bold; + font-weight: bold; } \ No newline at end of file diff --git a/templates/directory.php b/templates/directory.php index e51191d..f90c4df 100644 --- a/templates/directory.php +++ b/templates/directory.php @@ -10,7 +10,7 @@ function pmpromd_shortcode($atts, $content=null, $code="") // examples: [pmpro_member_directory show_avatar="false" show_email="false" levels="1,2"] extract(shortcode_atts(array( - 'avatar_size' => '128', + 'avatar_size' => '64', 'fields' => NULL, 'layout' => 'div', 'level' => NULL, @@ -167,196 +167,394 @@ function pmpromd_shortcode($atts, $content=null, $code="") $user_identifier = pmpromd_user_identifier(); ob_start(); - ?> - -
- - -- - | - -- - | - -- - | - - -- - | - - -- - | - - -- - | - - -- - - + |
---|
+ + | + ++ + | + ++ + | + + ++ + | + + ++ + | + + ++ + | + + ++ + + + ID); + $auser->membership_level = pmpro_getMembershipLevelForUser($auser->ID); + $user_fields_array = pmpromd_filter_profile_fields_for_levels( $fields_array, $auser ); + $count++; + ?> + |
---|---|---|---|---|---|---|
+ + ID, $avatar_size, NULL, $auser->user_nicename ); ?> + + ID, $avatar_size, NULL, $auser->user_nicename ); ?> + + | + ++ + + + + + + + | + ++ user_email, 'user_email' ); ?> + | + + +
+ {$field[1]};
+ if(!empty($meta_field))
+ {
+ ?>
+
+
+
+
+ $value)
+ $meta_field[$key] = $rh_fields[$field[1]][$value];
+ }
+ ?>
+
+
+
+
+
+
+
+ {$field[1]}, $field[1] ); ?>
+
+
+
+ |
+
+
+ + ID ); + $membership_levels = array(); + if ( ! isset( $levels ) ) { + // Show all the user's levels. + foreach ( $alluserlevels as $curlevel ) { + $membership_levels[] = $curlevel->name; + } + } else { + $levels_array = explode(',', $levels); + // Show only the levels included in the directory. + foreach ( $alluserlevels as $curlevel ) { + if ( in_array( $curlevel->id, $levels_array) ) { + $membership_levels[] = $curlevel->name; + } + } + } + $auser->membership_levels = implode( ', ', $membership_levels ); + echo ! empty( $auser->membership_levels ) ? $auser->membership_levels : ''; + ?> + | + + ++ startdate < $min_startdate ) { + $min_startdate = $level->startdate; + } + } + echo ! empty( $min_startdate ) ? date_i18n( get_option( 'date_format' ), $min_startdate ) : ''; + ?> + | + + ++ + | + +
+
- - user_email, 'user_email' ); ?> -
- - -- - ID ); - $membership_levels = array(); - if ( ! isset( $levels ) ) { - // Show all the user's levels. - foreach ( $alluserlevels as $curlevel ) { - $membership_levels[] = $curlevel->name; - } - } else { - $levels_array = explode(',', $levels); - // Show only the levels included in the directory. - foreach ( $alluserlevels as $curlevel ) { - if ( in_array( $curlevel->id, $levels_array) ) { - $membership_levels[] = $curlevel->name; - } - } - } - $auser->membership_levels = implode( ', ', $membership_levels ); - echo ! empty( $auser->membership_levels ) ? $auser->membership_levels : ''; - ?> -
- - -- - membership_level->startdate); ?> -
- - + +- - - - $value) - $meta_field[$key] = $rh_fields[$field[1]][$value]; - } - ?> - - - - - - - - {$field[1]}, $field[1] ); ?> - -
- - - - -- ID, $avatar_size, NULL, $pu->display_name, array("class"=>"alignright")); ?> -
- - display_name) ) { ?> -- - description; ?> -
- - -- - user_email, 'user_email' ); ?> -
- - -- - membership_levels ) ? $pu->membership_levels : ''; ?> -
- - -- - startdate < $min_startdate ) { - $min_startdate = $level->startdate; + display_name ) ) { + $heading_classes = array(); + $heading_classes[] = 'pmpro_card_title'; + $heading_classes[] = 'pmpro_font-x-large'; + if ( ! empty( $show_avatar ) ) { + $heading_classes[] = 'pmpro_heading-with-avatar'; } - } - echo ! empty( $min_startdate ) ? date_i18n( get_option( 'date_format' ), $min_startdate ) : ''; + $heading_classes = implode( ' ', $heading_classes ); ?> -
- - pmpro_baddress1)) { ?> -
-
- pmpro_baddress1; ?>
- pmpro_baddress2))
- echo $pu->pmpro_baddress2 . "
";
- ?>
- pmpro_bcity && $pu->pmpro_bstate) { ?>
- pmpro_bcity; ?>, pmpro_bstate; ?> pmpro_bzipcode; ?>
- pmpro_bcountry; ?>
+
- - pmpro_bphone); ?> -
- - +- - - - $value) - $meta_field[$key] = $rh_fields[$field[1]][$value]; - } - ?> - - - - - + ?> +
- %s', esc_url( $directory_url ), esc_html__( 'View All Members', 'pmpro-member-directory' ) ); - } + ?> + +