PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Display list of paid members on WP page

s2Member Plugin. A Membership plugin for WordPress®.

Display list of paid members on WP page

Postby svnyster » August 11th, 2011, 3:41 pm

I am very new to s2Member and php scripting, so I apologize for my lack of knowledge in these areas. Cristián Lávaque pointed me to this forum for assistance on the WordPress page I am trying to create.

I am hosting a site that has access to a gaming server. I'm using s2member to accept donations for cost of the site and server, and in return, we give members access to special features on the gaming server. s2Member works great for this purpose because the user list in the admin panel of WordPress will show the member levels and automatically demote when their time has expired.

The problem I'm running into is that the moderators of the gaming server have to promote/demote the users manually, and I don't want every moderator to have admin access to WP just to see user ranks.

That being said, what I'm looking to do is have a WP page that will display a list of paid members on a certain level. The page would be hidden to everyone except moderators, and the moderators will use it to see who has made a donation. I do have a custom field from s2Member that I would like to display on this page, along with their username and when their subscription will expire.

Another display that I would like to show (if possible) is a list of members whose paid subscription has recently expired. With the moderators having to manually demote members on the gaming server, a list of recently expired subscriptions would be great for them to see who needs to be demoted.

As I said, I'm very new to php and really any form of API scripting, so any guidance would be extremely helpful! I'll keep an eye on the forums and try to help out with issues people may have that I am more knowledgeable on.
User avatar
svnyster
Registered User
Registered User
 
Posts: 1
Joined: August 11, 2011

Re: Display list of paid members on WP page

Postby Bruce C » August 11th, 2011, 8:18 pm

svnyster wrote:The problem I'm running into is that the moderators of the gaming server have to promote/demote the users manually, and I don't want every moderator to have admin access to WP just to see user ranks.

....
The page would be hidden to everyone except moderators, and the moderators will use it to see who has made a donation.


This page could most likely be taken out from the menu bar of your theme ( http://codex.wordpress.org/Template_Tag ... _from_List ) and instead be listed on your Moderator's Login Welcome Page.

Then, as an extra precaution, you could set conditionals to only display the list to Moderators (I'll assume you gave them s2member level 4.)

Code: Select all
[s2If current_user_can('access_s2member_level4')]
//put the list here
[/s2If]
[s2If !current_user_can('access_s2member_level4')]
You do not have permission to access this page
[/s2If]


That being said, what I'm looking to do is have a WP page that will display a list of paid members on a certain level.


For a page with only level 1 users, you could use something like this:

Code: Select all
    $level1users = get_users('role=s2member_level1');
    foreach ($level1users as $user) {
        echo '<li>' . $user->display_name . '</li>';
    }

Then, just change the variable, and role= to level 2, etc. on the other pages.

For the demotion/promotion of users, this post may be of help viewtopic.php?f=4&t=14397

Another display that I would like to show (if possible) is a list of members whose paid subscription has recently expired.


This post may be helpful viewtopic.php?f=4&t=10385

If you have any questions, please reply back and I'll help if I can.
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron