Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disabling topic creation-box


  • cubeacid
    Participant

    @cubeacid

    Hello,

    I’m running BBpress 2.5.4 and want to run private forum. So far I have created forum and main topics, but I want to hide topic posting box in the index page of forum in the way that regular registered users can create topics only in main topics. Is it possible?

    Thanks in advance!

Viewing 19 replies - 1 through 19 (of 19 total)

  • cubeacid
    Participant

    @cubeacid

    So, I have managed to hide “post-form” by editing “bbpress.css”-file

    Added line “display: none;”

    #bbpress-forums fieldset.bbp-form {
    display: none;
    clear: left;

    But this hides “post-form” completely so I’m not able to, for example, reply any topics there are in forums. Anyone?


    Robin W
    Moderator

    @robin-w

    my plugin should allow you to only see the required forums

    https://wordpress.org/plugins/bbp-private-groups/


    cubeacid
    Participant

    @cubeacid

    I’m sorry, maybe I wasn’t clear enough with my problem but basically this (picture above) what I need to remove from all the users (keymaster, participants) from the start page of forum where all main topics are located: post

    Why I want this is because I want to prevent users from creating their topics on the start page of forum. Of course, topic posting would then work in main topics which I created already. Thanks!


    Robin W
    Moderator

    @robin-w

    If I have understood, you would probably need to alter

    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php

    copy it to a bbpress directory within the root of your theme and edit it there, and bbpress will use it

    probably change line 42/43 to take out the if single forum bit ?


    jessy
    Participant

    @jessy-marco

    @cubeacid: You want this: Do not allow users to publish new topics, just replies on your topics. Correct?

    1, Install plugin: WPFront User Role Editor
    2, Go to Roles => All roles => and choose Participant, it has 8 capabilities
    3, You need uncheck publish_topics and edit_topics and assign_topic_tags and delete_topic_tags
    4, with this plugin you can do it because it is built in role from plugin bbPress
    5, But, we can customize it with filter function pasted below
    6, Jast paste it into function.php and refresh the page in admin plugin WPFront User Role Editor in Participate role how magicaly capabilities are removed πŸ™‚
    7, If the participant or regular registered user will go on topics, they will be message “You cannot create new topics.” and if user click on your own created topic, he can reply πŸ™‚

    Paste it into functions.php

    function my_custom_get_caps_for_role_filter($caps, $role)
    {
        /* Only filter for roles we are interested in! */
        if ($role == 'bbp_participant' )
            $caps = my_custom_get_caps_for_role($role);
    
        return $caps;
    }
    add_filter('bbp_get_caps_for_role', 'my_custom_get_caps_for_role_filter', 10, 2);
    
    function my_custom_get_caps_for_role($role)
    {
        switch ($role) {
            case 'bbp_participant':
                return array(
                    
                    // Primary caps
                    'spectate' => true,
                    'participate' => true,
                    'moderate' => false,
                    'throttle' => false,
                    'view_trash' => false,
                    
                    // Forum caps
                    'publish_forums' => false,
                    'edit_forums' => false,
                    'edit_others_forums' => false,
                    'delete_forums' => false,
                    'delete_others_forums' => false,
                    'read_private_forums' => false,
                    'read_hidden_forums' => false,
                    
                    // Topic caps
                    'publish_topics' => false,
                    'edit_topics' => false,
                    'edit_others_topics' => false,
                    'delete_topics' => false,
                    'delete_others_topics' => false,
                    'read_private_topics' => false,
                    
                    // Reply caps
                    'publish_replies' => true,
                    'edit_replies' => true,
                    'edit_others_replies' => false,
                    'delete_replies' => false,
                    'delete_others_replies' => false,
                    'read_private_replies' => false,
                    
                    // Topic tag caps
                    'manage_topic_tags' => false,
                    'edit_topic_tags' => false,
                    'delete_topic_tags' => false,
                    'assign_topic_tags' => false
                );
                break;
            default:
                return $role;
        }
    }

    I have try that ad for me it works.


    cubeacid
    Participant

    @cubeacid

    “You want this: Do not allow users to publish new topics, just replies on your topics. ”

    Almost, I want to restrict users from creating their topics on MAIN page of forum because I have already created kind of “locked” main topics, eg:

    I have created forums:

    Main topic 1
    Main topic 2
    Main topic 3

    Users can then go to these topics above and CREATE their own subtopics there and only there, that’s the idea. So they are not allowed to create topics right on MAIN page of forum, but otherwise they can. This is kind hard to explain :/


    @Robin
    W: I tried to disable lines 42 and 43 from form-topic.php but not sure, where in my theme folder I should upload this modified file.


    Robin W
    Moderator

    @robin-w

    create a directory on your theme called ‘bbpress’
    ie wp-content/%your-theme-name%/bbpress
    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/%your-theme-name%/bbpress/form-topic.php
    bbPress will now use this template instead of the original

    I was only suggesting you start with looking at lines 42, I haven’t actually looked seriously at the code, I don’t have time at the moment πŸ™‚


    cubeacid
    Participant

    @cubeacid

    Ok, thanks for clarifying things, but I’m not familiar with modifying php-code, so I still would need help in this problem :/


    cubeacid
    Participant

    @cubeacid

    @jessy-marco: I have tried your solution in different ways (I need ability for users to be able to post their topics as subtopics of main topics). Now I can disable completely, as you said, capability for creating topics but I need to disable it ONLY at MAIN page. Any advise for that?


    jessy
    Participant

    @jessy-marco

    I am confused quite honestly.

    What is Main page for you, what are subtopics. Should you elaborate more and I will do my the best.

    Thank you.


    cubeacid
    Participant

    @cubeacid

    Here is the picture of my forum structure: forum

    That is the my Main page for forum. From this page I need to disable topic posting ability, so users cannot create any posts like above the posting box: Test, Test 2, Test 3 and so on…

    So, the only thing there should be left are all the main topics which I created (the most upper ones). Then, when you go to one of those predefined topics, there whoever (participant …) user would be, he can create own topics within this main topic. So, topic posting would be working everywhere, BUT Main forum page.

    I hope this will clarify more πŸ™‚


    jessy
    Participant

    @jessy-marco

    You just forget provide a website link. Thank you.


    cubeacid
    Participant

    @cubeacid

    Challenge is that since forum is private you cannot see it.


    jessy
    Participant

    @jessy-marco

    1, Install plugin: WPFront User Role Editor
    2, Go to Roles => Settings and check “Override Edit Permissions” Save it.
    2, Go to Roles => All roles => and choose Participant, it has 8 or more capabilities
    3, You need uncheck publish_topics and edit_topics and assign_topic_tags and delete_topic_tags
    4, Save it.

    You do not need to change php code as above πŸ™‚

    If you need my own participation, send me your e-mail address.


    cubeacid
    Participant

    @cubeacid

    Ok, I was using originally “Members”-called plugin instead of WPFront User Role Editor. Now tried to use WPfront, but when I’m trying to uncheck those and save it, it doesn’t uncheck them. Maybe issue is in β€œOverride Edit Permissions” ? I check it and hit “Save” button and it says “If you have a caching plugin, clear the cache for the new settings to take effect.” Where can I clear it and what exactly?


    cubeacid
    Participant

    @cubeacid

    I have found solution for this – you just have to go to setting of forum you created and choose “Closed”-state for forum. Then no one can write anything on forum particular forum πŸ™‚ Thanks anyway for help!


    Robin W
    Moderator

    @robin-w

    great – glad you’re fixed !


    derock299
    Participant

    @derock299

    Hello Robin,

    Please I am a novice to using all this. Heres my own question:

    My website is a free membership website (no form of payment, just a free membership site where my colleagues can register and chat in groups for free).
    I have s2member Pro, buddypress and bbpress installed.

    S2member Pro= handles registration form. there is a restricition in the forum page which redirects you to either register or login before you can access the forums and its working fine( I HAVE DONE THAT ALREADY). During member registration, theres a field i created for year of graduation. lets say for a example you choose 1991 as your year of graduation, then you finish your registration and logged in.

    Buddypress= BP handles my group forums and i have groups forums 91, 92,93 and so on. I want only users that graduated in 1991 to have access to only group 91. Users that graduated in 1992 to have access to group 92 only. users that graduated in 1991 should not be able to access 92 groups and vice versa.

    BBPress: My bb press handles sitewide forums and general chats which is already accessible to every logged in member.

    Please how can I use your plugin: bbp private group to assign this? please show me how to do it in details sir, I want to restrict certain members from accessing certain group chats, let it not be even visible to them. Heres my skype: aibrahim299. Thanks.


    Robin W
    Moderator

    @robin-w

    @derock299 – sorry I don’t offer Skype support for this plugin, sorry but I have too much else on πŸ™‚

    Private groups would limit them, but you would need to set this manually after registration.

    so you would have sitewide forums and general chats with no restrictions.

    Then you would set the ‘year’ forums up to belong to a ‘year’ group so you would have the 91 forum set up a group name 91.

    A user registering would not have access to or see the existence any of the private group restricted forums, so on registration would just see the [edit] public forums.

    Then after registration you would simply edit that user to add them to say the 91 group, and they would see the 91 forums or forums (and obviously the open forums) and no other restricted ones.

    I would suspect that automating this would allow anyone to register and immediately get access to a ‘year’ forum, or register multiple times and get access to lots of years, defeating the restriction, so manual adding (allowing your to verify) should be fine.

    Howveer if you want this automated, you would need to email me via my website http://www.rewweb.co.uk but it might be expensive to code (I’d need to work that out) or try http://jobs.wordpress.net/

Viewing 19 replies - 1 through 19 (of 19 total)
  • You must be logged in to reply to this topic.
Skip to toolbar