Makes closed group's blogs availbable

I have tried many ways, but I can't figure out how to make a closed group's blogs listed and avaiable for all members. When the group is closed, so is its profile as well and therefore its group's blogs even though they are open for all members. How would you solve the problem?

 

  • Hi,

    You will have to bypass the group_gatekeeper(); on the group you want public.

    There is no easy way around it, if you bypass group_gatekeeper all closed groups will be viewable, so maybe add some extra metadata on the groups you want open for reading. then an IF statement can see if group_gatekeeper should be bypassed.

    $group = get_entity(get_input('group_guid'));

    if($group->use_forced_read != 'yes'){

    group_gatekeeper();

    }

     Hope that helps

     

  • Thank you, you got me on the right track:

    In mod/groups/groupprofile.php, I added the second if-statement:

         $groupaccess = group_gatekeeper(false);
                    if (!$groupaccess)
                            $view_all = false;
                    if($group->all_read == 'yes'){
                            $view_all = true;
                    }

    I used the profile_manager plugin to add the metadata variable "all_read" to the group profile as selection variable with the values yes,no.

  • In order to fix the link to closed groups' blogs so that its target (list of blogs) becomes visible, I changed blog/index.php. I substituted

    group_gatekeeper();

    with :

      $group = page_owner_entity(get_input('group_guid'));
            if($group->all_read == 'no'){
            group_gatekeeper();
            }

    I guess the same will do for all group restricted entities:

    ./groups/edittopic.php:  group_gatekeeper();
    ./groups/discussions.php:       group_gatekeeper();
    ./groups/membership.php:        group_gatekeeper();
    ./groups/topicposts.php:                group_gatekeeper();
    ./groups/forum.php:     group_gatekeeper();
    ./bookmarks/index.php:  group_gatekeeper();
    ./file/upload.php:      if (is_callable('group_gatekeeper')) {
    ./file/upload.php:              group_gatekeeper();
    ./file/friends.php:     if (is_callable('group_gatekeeper')) {
    ./file/friends.php:             group_gatekeeper();

    ./file/search.php:              if (is_callable('group_gatekeeper'))

                                               group_gatekeeper();
    ./file/index.php:       group_gatekeeper();