Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private'

Viewing 25 results - 2,151 through 2,175 (of 3,450 total)
  • Author
    Search Results
  • Paul Wong-Gibbs
    Keymaster

    You should never, ever, edit core files.

    wiking
    Member

    As there was a php error if the user who uses the forum directory is not logged in the following modification was done:

    Code:
    //Get current user
    $current_user = wp_get_current_user();

    //Fetch forums IDs to which user has access
    $i = 0;
    $result = mysql_query("SELECT meta_value FROM oba_bp_groups_members, oba_bp_groups_groupmeta WHERE user_id = ".$current_user->ID." and oba_bp_groups_members.group_id = oba_bp_groups_groupmeta.group_id and oba_bp_groups_groupmeta.meta_key=’forum_id’")
    or die ("MySQL-Error: " . mysql_error());
    while ( $row = mysql_fetch_array($result)) {
    $res[$i] = $row["meta_value"];
    $i++;
    }

    //Implode forum ids into a comma sperated list e.g: 3,5,7
    if ( !empty( $res ) )
    $comma_separated = implode(",", $res);

    // Set this for groups
    //Old //$parts[‘groups’] = "(gm.meta_key = ‘forum_id’ AND gm.meta_value = t.forum_id)";
    $parts[‘groups’] = "(gm.meta_key = ‘forum_id’ AND gm.meta_value = t.forum_id AND gm.meta_value IN (".$comma_separated."))";

    You also need to add the functionality that logged in users can potentially see all forums (the above code then filters out forums the user is not member of):

    after

    Code:
    // Are we a super admin?
    elseif ( is_super_admin() )
    unset( $parts[‘private’] );

    add

    Code:
    // Allow the forum directory to display private forums for users
    elseif ( is_user_logged_in() )
    unset( $parts[‘private’] );
    Sirup
    Member

    This problem is solved.
    In in “bp-groups-filters.php” in function “function groups_add_forum_where_sql( $sql = ” ) ” change the following (oba is the database prefix):

    Code:
    //Get current user
    $current_user = wp_get_current_user();

    //Fetch forums IDs to which user has access
    $i = 0;
    $result = mysql_query("SELECT meta_value FROM oba_bp_groups_members, oba_bp_groups_groupmeta WHERE user_id = ".$current_user->ID." and oba_bp_groups_members.group_id = oba_bp_groups_groupmeta.group_id and oba_bp_groups_groupmeta.meta_key=’forum_id’")
    or die ("MySQL-Error: " . mysql_error());
    while ( $row = mysql_fetch_array($result)) {
    $res[$i] = $row["meta_value"];
    $i++;
    }

    //Implode forum ids into a comma sperated list e.g: 3,5,7
    $comma_separated = implode(",", $res);

    // Set this for groups
    //Old //$parts[‘groups’] = "(gm.meta_key = ‘forum_id’ AND gm.meta_value = t.forum_id)";
    $parts[‘groups’] = "(gm.meta_key = ‘forum_id’ AND gm.meta_value = t.forum_id AND gm.meta_value IN (".$comma_separated."))";

    wiking
    Member

    I still struggle to get this view running corectly.

    I managed to find out how to pull all group ID’s for a given userid:

    SELECT group_id FROM `xyz_bp_groups_members` where `user_id` = 1

    And how to get all forum_id’s for a given group:

    SELECT meta_value FROM `xyz_bp_groups_groupmeta` where group_id = 1 and meta_key = ‘forum_id’

    My idea was to do a join as i didn’t know how to follow your directions correctly @boonebgorges.
    Therefore i tried to modify the original $sql (line 83 in bp-group-filters.php):

    $sql .= ‘JOIN ‘ . $bp->groups->table_name . ‘ AS g LEFT JOIN ‘ . $bp->groups->table_name_groupmeta . ‘ AS gm ON g.id = gm.group_id ‘;

    with this extended version:

    $sql .= ‘JOIN ‘ . $bp->groups->table_name . ‘ AS g LEFT JOIN ‘ . $bp->groups->table_name_groupmeta . ‘ AS gm, oba_bp_groups_members AS gu ON g.id = gm.group_id AND gu.group_id = gm.group_id’;

    unfortunately i have not enough know-how how the buddypress-core is working correctly. Any hints on how to do this properly?

    Many Thanks!

    #122947

    In reply to: Privacy????

    aces
    Participant

    I’m using the walled garden technique for some privacy and have adapted it for bp 1.5.* !

    This is based on https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/members-privacy-how-can-i-hide-members-profiles?topic_page=2&num=15#post-102784 and needs to go in a bp-custom.php file…

    `
    function sh_walled_garden()
    {
    global $bp;
    if( bp_is_register_page() || bp_is_activation_page() || bp_is_page( BP_FORUMS_SLUG ) || bp_is_page( BP_GROUPS_SLUG ) )
    return;

    if( ! bp_is_blog_page() && ! is_user_logged_in() )
    bp_core_redirect( bp_get_signup_page() );
    }
    add_action( ‘wp_loaded’, ‘sh_walled_garden’ );
    `
    Originally add action was to get_header but now the bp template loads the header first so I had to move it…

    Before that one had to put a hook into the page template header to load the function – not sure which would now be best or if that hook is ok to use (It’s the only one i found that worked)?

    The above function hides members and activity from those not logged in but enables forums and groups for everyone – see variation here

    archonic
    Participant

    That was a terrible experience, but at least I know BP much better now. It was a combination of issues – ajax.php silently failed to load with the theme files on the production server, despite being identical to the theme files on staging (I still can’t explain that), and there was the just recently patched BP core bug with the red “You do not have access to this group” error.

    Resolved =)

    #122331
    archonic
    Participant

    The issue has been unravelling here:
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/cant-request-private-group-membership-you-do-not-have-access-to-this-group/

    I started from scratch on the production server here:
    http://dhcworks.carleton.ca/version2/

    With fresh files and a fresh DB, the issue came up again. Staging is here and hasn’t had any problems:
    http://dev.archonic.com/carleton/dhc/

    You can login using username and password “tester” on both sites. Note that on production, the buttons to join, leave, and request aren’t showing on the group directory or group home.

    UPDATE: just noticed r-a-y’s patch here – https://buddypress.trac.wordpress.org/ticket/3687. I’ll try it and report back.

    archonic
    Participant

    This bug is potentially costing me a client, I’ve got to get a gasp on it soon. I reinstalled everything and started with a fresh database and the issue is still there. So let me ask a more broad question –

    What does BP ask of a user to be eligible to join a group (public, private and hidden)?
    User must be logged in, and….?

    #122241
    Paul Wong-Gibbs
    Keymaster

    As you can see from that ticket, no, no-one’s fixed it yet. Patches welcome.

    #122886
    jnnkn
    Member

    it happens only with my friends

    #123206
    Paul Wong-Gibbs
    Keymaster

    Does it break on all users, or just one particular user? If just one, what is the username (login name) of that user?

    #123319
    jnnkn
    Member

    buddypress.1.5 and using bp-default theme

    #123317
    @mercime
    Participant

    BP version? Are you using bp-default theme or custom theme? New or updated installation? Any messaging plugins activated?

    #122549
    ogeeku
    Member

    I am getting a similar error on friend requests as well as private messages being sent since the upgrade. Can you give an example of the code fix that you placed? (Example of commenting out within php)

    Thanks so much!

    archonic
    Participant

    Small update: I enabled the friending component of BP to invite a user to a group and that worked. However, in what might be an unrelated case, hitting “new topic” on all pages that have that button, as any user, does nothing. I believe it’s related – there’s a common condition failing for a number of functions due to botched permissions.

    Perhaps a drag and drop update to BP 1.6 bleeding messed up the user table? I believe I did that after the issue showed up.

    archonic
    Participant

    Thanks Ray, I’ll keep an eye on that ticket. I’m not sure it’s what I’m experiencing however. Despite having the same WP, BP, plugins and theme, the buttons to join both public and private groups do not appear for any user, only on my production site. When on the page for a private group you’re not a member of, there is a tab link to request membership which will show the “You do not have access to this group” error, but the issue is higher than that since joining any group is somehow unavailable.

    wiking
    Member

    i try to get it running and provide my version if it works.

    Boone Gorges
    Keymaster

    Probably at least some custom SQL is needed. Something along the lines of:
    (1) doing an additional query to get a list of the user’s groups and the forum_ids for those groups
    (2) limiting the main forum topic query WHERE ( forum_id IN ( {$user_forums} ) OR group_status = ‘public’ ) (not sure if group_status is available here, I would have to look)

    > is it still that hard to implement the bugfix
    It’s not very difficult technically, but it will introduce at least one or two more queries on what can already be a database-intensive page load. If you can provide a workable patch, I’m sure it would be happily considered.

    wiking
    Member

    maybe interesting for other users with private groups heavily used:
    i modified the function “groups_add_forum_where_sql” starting at line 88 in /bp-groups/bp-groups-filters.php.
    I added the following block at line 110:
    elseif ( is_user_logged_in() )
    unset( $parts );
    therefore all logged in users get the same view as an admin and see updates in all private group forums (error message when clicking of threads they are not allowed to). next step would be to filter out group forums where the user has no permission.
    ==
    is there an function which could be used for that filtering in bp (replacing is_user_logged_in())?
    or is custom sql code needed here?

    r-a-y
    Keymaster

    This is a reported bug:
    https://buddypress.trac.wordpress.org/ticket/3687

    Keep your eye on that ticket for updates.

    archonic
    Participant

    I’ve reinstalled WP, and BP, deactivated plugins and looked though all the settings I can find. This must be a bug but I’m not sure what’s cause it. Clearly the issue is in the database. Backing up all the content on production and reinstalling everything is the only way I know to fix this.

    Unless someone else has an idea :). Anyone?

    #123261
    Mary Jane
    Member

    Great idea!!!!!! i was just thinking aboiut that too! i hope theres something for that

    archonic
    Participant

    Sorry for the bump, but any ideas? On the broken site, “do_action( ‘bp_directory_groups_actions’ );” isn’t returning anything. I tried sifting through to get the condition that’s failing but haven’t found it yet.

    wiking
    Member

    there is not to much activity on this ticket unfortunately.

    especially if private groups are heavily used it is hardly comprehensible for users that some threads appear, but others are not displayed. this was the feedback of my beta test users (i’am just in the process of launching a new community for gamers and some power users of my old page are testing my bp installation).

    If it is not possible to use the Group-Forums-Directory- is there any other Point where a user can view all new threads they are able to read?

    is it still that hard to implement the bugfix with the new 1.5 api?

    Boone Gorges
    Keymaster

    This is expected behavior. The logic that would be required to show private forums to logged-in members of those groups is complex, and has not yet been implemented. There is a ticket in Trac to discuss this enhancement: https://buddypress.trac.wordpress.org/ticket/2576

Viewing 25 results - 2,151 through 2,175 (of 3,450 total)
Skip to toolbar