There are new helper functions that will make this job a *lot* easier, but in the meantime you may want to add the following function to your system somewhere (custom plugin / themes function.php file): function current_user_on_level( $level_id ) {
$user = wp_get_current_user();
$member = new M_Membership( $user->ID );
Thank you very much exactly what I needed.
Can you tell me this for the pay to blog plugin also?
I may have to use both to accomplish the effect I want.
Thank you.
Ok I will explain exactly what I need. I need blog admins to only be able to see the comment template on the main blog when they have paid to blog. when their pay to blog subscription runs out they should not be able to see the comment template any more.
in normal wordpress functions I think it would be
if (pay_to_blog(inactive) {
do this
} else {
do that
}
but I have no idea how your plugin determine when a blog is inactive and how to call that function.
Can someone please help me.
Ok I will explain exactly what I need. I need blog admins to only be able to see the comment template on the main blog when they have paid to blog. when their pay to blog subscription runs out they should not be able to see the comment template any more.
in normal wordpress functions I think it would be
if (pay_to_blog(inactive) {
do this
} else {
do that
}
but I have no idea how your plugin determine when a blog is inactive and how to call that function.
Can someone please help me.
Responses (8)
Member — 14th July 2010 (1 year ago) #
Anyone here that can help me with this?
Developer — 14th July 2010 (1 year ago) #
There are new helper functions that will make this job a *lot* easier, but in the meantime you may want to add the following function to your system somewhere (custom plugin / themes function.php file):
function current_user_on_level( $level_id ) {$user = wp_get_current_user();
$member = new M_Membership( $user->ID );
if(!empty($member)) {
return $member->on_level( $level_id, true );
} else {
return false;
}
}
Developer — 14th July 2010 (1 year ago) #
You can also switch the functions (on line 5 between):
is_member
has_subscription
on_sub( $sub_id )
Have a look in membershipincludes/classes/class.membership.php for more.
Member — 14th July 2010 (1 year ago) #
Thank you very much exactly what I needed.
Can you tell me this for the pay to blog plugin also?
I may have to use both to accomplish the effect I want.
Thank you.
Member — 15th July 2010 (1 year ago) #
I am still in need of the pay to blog function.
Lead Developer — 15th July 2010 (1 year ago) #
There isn't a pay to blog function, because if the blog isn't valid it disables everything and forwards to the checkout page.
You can find the code in the pay_to_blog_blog_check() function.
Member — 16th July 2010 (1 year ago) #
Ok I will explain exactly what I need. I need blog admins to only be able to see the comment template on the main blog when they have paid to blog. when their pay to blog subscription runs out they should not be able to see the comment template any more.
in normal wordpress functions I think it would be
if (pay_to_blog(inactive) {
do this
} else {
do that
}
but I have no idea how your plugin determine when a blog is inactive and how to call that function.
Can someone please help me.
Member — 16th July 2010 (1 year ago) #
Ok I will explain exactly what I need. I need blog admins to only be able to see the comment template on the main blog when they have paid to blog. when their pay to blog subscription runs out they should not be able to see the comment template any more.
in normal wordpress functions I think it would be
if (pay_to_blog(inactive) {
do this
} else {
do that
}
but I have no idea how your plugin determine when a blog is inactive and how to call that function.
Can someone please help me.
Become a member