The MU forums have moved to WordPress.org

site-wide-tags and private blogs (6 posts)

  1. josswinn
    Member
    Posted 15 years ago #

    Hello,

    Is there a way to block posts that come from private blogs, when using both donncha's site-wide-tags and dsader's 'More Privacy Options' plugins?

    I'm guessing that it could be controlled in the site-wide-tags.php by working on this:

    $post_blog_id = $wpdb->blogid;
    	/*
    	 * this will not handle a switch from public to private blog and delete posts in tags-blog
    	 */
    	if ( get_blog_status($post_blog_id, "public") == 0 )
    		return;

    And in ds_private_blog.php, there are the additional options:

    if ( '-1' == $blog[ 'public' ] ) {
    _e('Users Only(-1)');
    }
    if ( '-2' == $blog[ 'public' ] ) {
    _e('Members Only(-2)');
    }
    if ( '-3' == $blog[ 'public' ] ) {
    _e('Admins Only(-3)');

    Sorry. I'm no coder but any advice would be appreciated.

    Thanks.

    Joss

  2. andrea_r
    Moderator
    Posted 15 years ago #

    That snippet of code would account for all of the extra privacy options, because it says public only.

    But it also says, basically, if a blog was public and then marked private, it does not delete previously added posts from the sitewide tags.

  3. josswinn
    Member
    Posted 15 years ago #

    OK. Thanks.

    In my case, I set up site-wide-tags a few days ago. This morning, I created a new blog and immediately made it restricted to registered users of that blog. However, when a post was later made, site-wide-tags picked it up and published it (have just re-tested to confirm). A bug in site-wide-tags?

  4. andrea_r
    Moderator
    Posted 15 years ago #

    No, wait - if public is set to 0, then it should be excluded,. Public status is one, so the code above is missing any check for any additional privacy options.

    The sitewide tags plugin needs to be altered to say if not 1, rather than if 0. Then it will catch the additional privacy options.

    So just change dthat code snippet to

    if ( get_blog_status($post_blog_id, "public") != 1 )
    		return;
  5. josswinn
    Member
    Posted 15 years ago #

    Yes, that works. Thanks very much. I see you've already reported it to Donncha :-)

  6. dsader
    Member
    Posted 15 years ago #

    andrea_r, good catch.

About this Topic