Skip to:
Content
Pages
Categories
Search
Top
Bottom

Per Forum Permissions by Group


  • childofnewlight
    Participant

    @childofnewlight

    After having exhaustively searched for the last few nights for information on this topic, I have not been able to find an answer.

    I’m currently using the most up-to-date versions of both WP and bbPress. My current website uses Joomla, rokbridge, and phpbb3.

    However, I’m trying to setup a new site based on WordPress and bbPress seems like an awesome alternative to having to mess around with forum bridges for phpbb3.

    I was well on my way to adopting bbPress as our new forum software. Successfully imported the phpbb forum. Just fixing things up after the import like setting categories and moving forums around into their proper place. Then I realized that private forums were now public.

    ‘No problem’, I though. I went to each forum settings to be amazingly disappointed that there was only three options: hidden, private, and open.

    With our current phpbb setup I can create a group. Add people to it. Then go to the forum (or their group) and give them permission to see the group.

    This is especially important as we are a Christian gaming clan. We have a private guild forum that allows members of our clan to discuss things privately amongst each other (like private vent login info). We also have an officer forum that lets us candidly discuss potential applicants.

    I would like to allow officers access to certain forums. Guild members to certain other forums. As far as I can tell, bbpress excludes this very basic ability.

    I tried using the Members plugin for WordPress that is suppose to have bbpress integration. It wouldn’t work properly. At times it wouldn’t allow a role to see certain forums and other times it didn’t matter what permissions were set, it’d see it anyway.

    I’m going to look at support for the Members mod, but it seems kind of silly that this wouldn’t be an integral part of a modern forum software.

    Unless I’m missing something, I’ll have to stick with messing around with phpbb for now.

Viewing 25 replies - 76 through 100 (of 156 total)
  • I have a huge affinity for the Roots theme, it is awesome, but it can catch you out, I just gave the latest v1.6 a run, using Twenty Fourteen as the theme everything works as expected as ‘keymaster’, moving a reply from one topic to another works as expected.

    The only errors I see are in the function pg_get_author_link (These are not related directly to @trymedo’s the issue though)

    Notice Undefined variable: args 1 wp-content/plugins/bbp-private-groups/includes/functions.php:245
    Notice Undefined variable: post_id 1 wp-content/plugins/bbp-private-groups/includes/functions.php:246


    Tom Dyer
    Participant

    @trymedo

    Having poked around in the code myself, it appears to be falling over in inc/topics.php line 12.

    $post_ids=$wpdb->get_col("select ID from $wpdb->posts where post_type = 'topic'") ;

    I’ve checked and the $wpdb object is available, but it seems that the method get_col() is not… does anybody know why that might be? Or is there another method I could use to replace get_col() ?


    Tom Dyer
    Participant

    @trymedo

    – that’s if I’m checking it correctly. I tried this:

    var_dump( property_exists( $wpdb, 'get_col' ) ); Which returned bool(false)

    Am I doing it right? I don’t understand how the object could be there, but the method not 🙁

    I really would suggest switching to the Twenty Fourteen theme, and testing that, it works for me.

    If it still doesn’t work for you disable all your plugins except bbPress and ‘Private Groups’, test things, if it works great, start re-enabling each plugin one by one until you find it no longer works.


    Tom Dyer
    Participant

    @trymedo

    @netweb I’ve switched to the Twenty Fourteen theme, and disabled ALL plugins except for bbpress and bbp-private-groups. It’s still doing the same thing for me 🙁

    – The only saving grace here, is that this *hopefully* means that I haven’t broken anything myself (although I’ll probably have to retract that statement when we find the “real” issue)


    Robin W
    Moderator

    @robin-w

    @netweb – thanks for adding to this thread, and apologies if I was breaking rules – fully appreciate the reasons they are there 🙂

    I think the errors in pg_get_author_link are related to testing for settings that may not have been set, I’ll take a look.


    @trymedo
    – As Stephen suggest try it with a core theme and play with the plugins. Come back with your results !


    Tom Dyer
    Participant

    @trymedo

    It’s the same – it seems that $wpdb->get_col() is still AWOL…

    @trymedo Have you got any custom functions in the Twenty Fourteen theme or any ‘mu-plugins’ (You are using Roots after all ;))


    @robin-w
    Nothing wrong, I just wanted to point them out 🙂


    Tom Dyer
    Participant

    @trymedo

    Nope, I’ve not touched the Twenty fourteen theme since I added it. It’s been updated whenever required anyway though (I don’t like the seeing the update icon in the admin, so I tend to always keep things on the latest version whether I’m using it or not).

    This is a multisite install of WordPress though – Would that affect the $wpdb->get_col() visibility?


    Robin W
    Moderator

    @robin-w

    @netweb 🙂


    Tom Dyer
    Participant

    @trymedo

    FYI: If it helps, here’s the versions of all stuff currently running:

    Core:
    WordPress version: 3.9.1
    Configuration setup for multisite. Currently, only one site installed and running (but with the intention to add ‘micro’ sites at a later date).

    Plugins:
    bbP Private Groups version: 1.6
    bbPress version: 2.5.3

    Theme:
    Twenty Fourteen version 1.1


    Tom Dyer
    Participant

    @trymedo

    Oh, and the bbPress forums were migrated from phpBB using the import tool… I can’t see that being a factor in this particular issue, just throwing it out there 🙂


    Tom Dyer
    Participant

    @trymedo

    ok – some more digging has brought this to the surface:

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /Users/tom/Sites/frenchentree/htdocs/wp-includes/wp-db.php on line 1828

    Which appears at the time $wpdb->get_col() is called. Could it be that we have too many forum topics? 🙁

    *edit* Currently we have 71,009 posts. Of which 70,728 are published.

    How do you have bbPress and Private Groups activated? Network or Per Site ?

    Also as long as you ran the repair tools after importing from phpBB it shouldn’t be an issue, if you didn’t there is a chance, slim but plausible.


    Tom Dyer
    Participant

    @trymedo

    I did all the repair tools after the import, one by one as instructed.
    I have both plugins Network activated.


    Tom Dyer
    Participant

    @trymedo

    I’ve just tried a Network Deactivate on both, and activated them both at the site level. There doesn’t appear to be any difference


    Robin W
    Moderator

    @robin-w

    @trymedo

    on you’re

    ‘$post_ids=$wpdb->get_col(“select ID from $wpdb->posts where post_type = ‘topic'”) ;’

    this function is used lots of times in the plugin for instance forum-filters.php line 37

    $post_ids=$wpdb->get_col(“select ID from $wpdb->posts where post_type = ‘forum'”) ;

    and is the core of what makes the plugin work. If get_col didn’t work, then the whole plugin wouldn’t as the start of working out who can see what is the list that this/these lines create.

    I’d therefore suspect that this function in the particular instance of moving a topic is producing a ‘nil’ return, and without any topics in the resultant filtered list, then the display isn’t switched on.


    Robin W
    Moderator

    @robin-w

    your post crossed. so yes the function is working


    Robin W
    Moderator

    @robin-w

    ok, so if it’s a memory thing then it’s filtering ok when you just have forums set up, as it filters to the displayed forum first, so has less of a list.

    The Topics.php is only used by two areas as far as I can remember. The first is if you simply do

    http://www.mysite.com/topics

    which lists all forum topics. I created the function to specifically sort out peoples ability to enter that url and get all topics listed, and so bypass whether they could see a forum.

    The second is the one you have discovered (and I didn’t realise was used there) and seems to be generating a memory issue.

    You could confirm this by typing your url with /topics after and it should fall over there as well.

    If this is the issue, then I’ll look closer at whether I can improve the code, or maybe Stephen has a solution !


    Tom Dyer
    Participant

    @trymedo

    Yep, confirmed. It didn’t like /topics/ either.

    I’ve just tried putting a temporary limit of 100 on the SELECT query and it fixed the issue, but obviously this isn’t an ideal solution. Do you have any ideas as to how I could fix this ‘properly’? I suppose coming up with a sensible limit could be a fix, but what would be the repercussions of doing that?

    Also, if a limit is what’s required, is this going to be something I have to do manually, or would it be an update to the plugin?

    Ok, still not having an issue here with both both plugins Network Activated on a Sub Directory Multisite and Sub Domain Multisite install…

    Three screenshots here: ‘Movable Reply’ goes from one topic to the other topic https://cloudup.com/iDBwDqsRnet


    Tom Dyer
    Participant

    @trymedo

    yeah… I think we’d be fine if we only had 2 topics too 🙁

    I’m not well versed in database optimisation, do you have any pointers as to how I can avoid the database memory issues?

    I haven’t had a close look at the inner workings of the plugin so without doing that I honestly couldn’t say, it could be a scale issue, I don’t see anything obvious sticking out at me.

    It’s just hit 11pm here and I’m out for the night, I’ll see how I go over the weekend to try a take a closer look…


    Tom Dyer
    Participant

    @trymedo

    Ok thanks @netweb, it appears that the query grabs every topic, then looping through them to check that the user has permission to view them (by getting the forum ID for each post).

    This happens before bbp has even pulled the topics back from the database, so presumably if there’s pagination involved, theres a lot of work going on here that needn’t be.

    In regards to the http://www.site.com/topics/ issue:
    Would it be possible to instead add a filter to the topics that were pulled back from the query – so for example, if you’re on page one and that’s showing 20 topics – you only need to check the permissions for those 20 topics.

    In regards to the ‘move’ issue:
    This one is a bit different in that it does pull back all the topics – BUT if you’re moving a topic, then your going to be a moderator or a keymaster so we probably don’t need to check permissions in this case anyway.

    With those points in mind, do you know of any other filters that we could tap into instead of adding a filter to the bbp_before_has_topics_parse_args ?


    Robin W
    Moderator

    @robin-w

    Just taken a good look at form_reply_move.php and that calls a function that uses the bbp_has_topics with a ‘post__not_in’ parameter. My function uses a ‘post__in’ parameter, and wp-Query can’t handle both in one query, hense why it falls over.

    I’m already in trouble with my wife for still typing this, but try copying

    wp-content/bbpress/templates/default/bbpress/form_reply_move.php to a folder called bbpress within the root of your theme – ie wp-content/your-theme-name/bbpress/form_reply_move.php

    this will create a copy that is used instead of the default

    try

    changing

    line 45

    <?php if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ), 'post__not_in' => array( bbp_get_reply_topic_id( bbp_get_reply_id() ) ) ) ) ) : ?>
    
    

    to

    <?php //if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ), 'post__not_in' => array( bbp_get_reply_topic_id( bbp_get_reply_id() ) ) ) ) ) : ?>
    

    and line 63

    from

    <?php endif; ?>

    to

    <?php //endif; ?>

    This just takes that argument out and see how it runs then

    If that works, then I can play with what is needed – think I know, but am out of the door….now !!!

Viewing 25 replies - 76 through 100 (of 156 total)
  • The topic ‘Per Forum Permissions by Group’ is closed to new replies.
Skip to toolbar