Winner of the Best WordPress Business Website - WP Honors 2011
Since 2004
 

Forums

 

Manuals

 

Videos

 

Live Support

 

WPMU.org

Pay to blog plugin rules

Inactive

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.

Everyday at WPMU DEV we help hundreds of WP Users. Become a member today to:

  • Download 250+ Premium Plugins and Themes
  • Get unlimited support from WordPress Experts
  • Get help with your WordPress or BuddyPress projects

Help & Support from WPMU DEV members and staff

Staff

There isn't a specific function, but you can see what code to use to check in the function named something like *_check_blog().

Inactive

Ok i got the first 2 parts of the code I need.
I need help with this even if only to point me in a direction of something remotely close.
I am using the pay to blog plugin an I need to put this code in the theme of the main blog

<?php 

			$blog_expire = get_option('blog_expire');

			if ( empty( $blog_expire ) || $blog_expire == '0' ) {

				$now = time();

				$now = $now - 30;

				$blog_expire = $demo_period_days = get_site_option( "demo_period_days" );

				$blog_expire = $blog_expire * 86400;

				$blog_expire = $now + $blog_expire;

				update_option('blog_expire', $blog_expire);

			}

			if ( time() > $blog_expire ) {

				echo "yes";

                                  } else {
                                echo "no";
			}

?>

o i need it to get the expired blog by the current users blogId. I already know how to get the blog id of the current user, but I don't know how to write the code.
Example: $blog_expire = get_option('blog_expire->$user_blog->userblog_id'); or $blog_expire = get_option('blog_expire') == $user_blog->userblog_id;

I hope that made sense.
any help would be welcomed even a link to something you think might help.

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Inactive

bump

Staff

Hi holidaymaine, check the support staff hours on the right of the post box, no need to bump... also, I'm not a developer but I'm pretty sure that you could provide a bit more info, maybe a chart of how you want stuff to work?

Inactive

bump?

Staff

Getting a blog id from a user is not a simple task as it's not a one-to-one ration. Basically you would need to use the $blog = get_active_blog_for_user( $user_id ) function to return blog details object from their main blog, then $blog->blog_id will give you the id. Then use get_blog_option() to get the expiration.

You should know though that get_active_blog_for_user() depends on the primary blog being set in usermeta, if its not it will pull the next one they are a member of, or the dashboard blog if they are not a member of any other. You should also check if they are an admin of the blog returned.

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Inactive

Thank you.most of it I already had prepared the only part that was missing was the get_blog_option() instead of get_option()
I got it resolved by plugin support and code.
Thank you.

We can help you out. Become a member today to:

  • Let our team help you out today and access to over 250+ Premium Plugins and Themes
  • Find out why people saying "it's like having your own developer"
  • WPMU DEV - The WordPress Experts