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™

How to deactivate user post once his membership expired?

s2Member Plugin. A Membership plugin for WordPress®.

How to deactivate user post once his membership expired?

Postby candy » March 12th, 2011, 7:15 pm

Hi,

If I have a user with level 1 paid membership who is allowed to post content (write posts), what will happen with his posts once the membership expires and he does not renew?

I'd like at least content posted by this user in a certain category to be deactivated once the user is not a valid member anymore.

How can this be done?

Thanks a lot!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: How to deactivate user post once his membership expired?

Postby Cristián Lávaque » March 12th, 2011, 9:27 pm

By "deactivate" you mean taking it off the website?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: How to deactivate user post once his membership expired?

Postby candy » March 12th, 2011, 9:57 pm

yes, make it invisible, eventually change the post status to "draft" ...

So if the original poster does not renew its membership, his post will be taken down as well (status changed to "draft")

Thanks!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: How to deactivate user post once his membership expired?

Postby candy » March 13th, 2011, 9:51 am

Seeing the post is not limited to logged in users, visitors can also see it. That's why I need to find a way to connect the post "author" to the status of a s2 member ...

So basically I can image to have to wrap up the post code in "single.php" in smth like this:

if author = is a s2member that can see level 1
than > show post
else > set post status to "draft"

But I have NO clue how to write the php code for that, can anyone please help?

(a "s2member that can see level 1" would imply he has paid his subscription)

Help please!
Thank you!

PS: any other, better idea anytime more than welcomed!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: How to deactivate user post once his membership expired?

Postby Cristián Lávaque » March 15th, 2011, 3:39 pm

Well, s2Member doesn't do this, but it should be possible for a developer to add this functionality. You can find experienced freelance coders over at oDesk, eLance, Freelancer and Rent-a-coder.

Here are a couple of references that may help achieve this. :)
http://wordpress.stackexchange.com/ques ... than-today
http://codex.wordpress.org/Function_Ref ... pdate_post
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron