latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

List of members on a page shown…

Home Forums Community Forum List of members on a page shown…

This topic contains 4 replies, has 2 voices. Last updated by  Oliver Spörri 4 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Mar 6th, 2012 at 10:29 am #7452

I’ve added some custom user/profile fields like street, city and so on…
those are mandatory on registration.

now i like to show a list on a page (sure protected) with those users/profile fields.
a list where i could decide which fields i like to show and in which order it should appear (ascending on last name for example).

like this;

“Last name “First name “Street “City “Postal Code “…
Smith Anton Stationstreet 1 Big-Town 1234 …
Tobler Mike Samestreet 2 Small-Town 9876 …


any chance to get these information’s on a page out of s2member?

the idea behind is to have s2member also used as a member address administration tool – using same profile fields/member data once…
users/member are also able to adjust there own address.
it is a simple address administration :-)

thanks for any hint and help :-)

no idea here?
this feature would be great…

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Wednesday Mar 7th, 2012 at 3:28 pm #7577
Phillip Bryan
Username: damron

Hey there,

I’m just another s2member user, so may not know the best way to do this, but…

The “members update their own profile fields” functionality is provided by s2member in the form of a shortcode. The s2member tabs explain it pretty well – you create a page and add the shortcode, and then members can visit that page and edit their own data. It works great for us and is super easy to set up.

The member directory you describe can be handled in different ways –
— we created our own “archive” page to show a member directory, and displayed the members and custom fields exactly as we wanted.
— you could also use a plugin (for example, “members list”) that generates a directory of the members.

Regards,
Phillip

Posted: Thursday Mar 8th, 2012 at 3:39 am #7603

– we created our own “archive” page to show a member directory, and displayed the members and custom fields
exactly as we wanted.

this i like to know! do you have an example of that? code sample? that would be great help :-)

– you could also use a plugin (for example, “members list”) that generates a directory of the members.

this i tried too. but those plugins can’t read the meta fields of s2member :-(

Posted: Monday Mar 12th, 2012 at 8:01 pm #7934
Phillip Bryan
Username: damron

This is a very simple example that generates a table of all paid members. It displays name, login, email, and the custom s2member field “address”.

<?php get_header() ?>
  <div id="container">    
    <div id="content">        
                
        <table width="900" border="0">
          <tr><th>Last Name</th><th>First Name</th><th>User Name</th><th>Email Address</th><th>Address</th></tr>
          
          <?php 
            $args = array ( 'fields' => 'all_with_meta' );
            $wp_user_search = new WP_User_Query( $args ) ;

            $users = $wp_user_search->get_results();
            foreach ($users as $user) {
              // Skip all level 0 entries -- paid members should be s2member_level1, s2member_level2, editor, etc.
              if ('subscriber' == get_user_field ( 's2member_access_role', $user->ID) ) continue;
								
              $fields = $user->get('wp_s2member_custom_fields');
              echo '<tr><td>' . $user->last_name . '</td><td>' . $user->first_name . '</td><td>' . $user->user_login  . '</td><td>' . $user->user_email  . '</td><td>' . $fields['address'] . '</td></tr>';
            }
          ?>		
        </table>
      </div>
    </div><!-- .post -->
  </div><!-- #content -->
</div><!-- #container -->

<?php get_sidebar() ?>
<?php get_footer() ?>
Posted: Tuesday Mar 13th, 2012 at 7:47 am #7983

thanks alot.
:-)

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.