Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 9,126 through 9,150 (of 13,529 total)

  • Robin W
    Moderator

    @robin-w

    so did you try it as that, or as
    if (is_bbpress( ‘forums’ ) ) {

    is_bbpress doesn’t take arguments


    Robin W
    Moderator

    @robin-w

    I tried the If conditional tag on there but it does not seem to work.

    do you mean

    if (is_bbpress() )…

    ?


    Robin W
    Moderator

    @robin-w

    I’ve just been digging further into the code

    There is a filter on topics and replies which looks at posts with a private status, but topics and replies on a private forum don’t have that status UNLESS it is manually set on the admin backend (or imported with that status). So in the normal process they are viewable unless set by a moderator/admin to private within the backend.

    So a standard participant should be able to see all topics and replies.

    For creating topics and replies the code just looks at ‘publish topics’ and ‘publish replies’ so allows registered users to do this for both public and private forums.

    This would then make great sense for then original poster who had imported the forum, so topics and replies were likely to have a post status of private so not viewable by participants.

    I don’t know if that helps you understand your circumstances, but hope it explains it better.


    Robin W
    Moderator

    @robin-w

    if you just want forums where people can have topics which are discussed, then bbpress will be fine.

    Otherwise is you want private messaging and group activity streams, then you may want buddypress, or run bbpress with buddypress.


    Robin W
    Moderator

    @robin-w

    we’re probably both insane !

    It worked on my test site, but then I do have a lot cooking on there.

    back to my code above, can you try

    case bbp_get_participant_role() :

    in place of the line

    case 'bbp_participant':


    Robin W
    Moderator

    @robin-w

    yes if you use bbpress/buddypress, but add my private groups plugin, then you can add groups which can have separate access to some forums, and if wanted common access to others

    https://wordpress.org/support/plugin/bbp-private-groups


    Robin W
    Moderator

    @robin-w

    ok – thanks for that

    Having re-read your thread then I think what you want is:

    User : Participant
    Forum : Private
    Should be able to read, publish toics and create replies

    which is what bbpress does as default.

    Can you confirm that this is what you want, and what is not happening, and if so can you let us know

    what theme you are using
    what plugins you are using


    Robin W
    Moderator

    @robin-w

    I presume that you are wanting different logged in users to see different things?

    If so you can restrict who sees what using my private groups plugin

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


    Robin W
    Moderator

    @robin-w

    given previous experience of one line questions – can you try and write a bit more about quite what you want to do with bbpress.


    Robin W
    Moderator

    @robin-w

    great – please do come back – this can be resolved one way or another !


    Robin W
    Moderator

    @robin-w

    ps

    I just cribbed this code from elsewhere, so the capabilities may not be the participant ones, you’ll need to check what they should be

    bbPress User Roles and Capabilities


    Robin W
    Moderator

    @robin-w

    untested, but this should in theory let you play with the capabilities of the participant role

    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_participant' )
            $caps = custom_capabilities( $role );
         return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )  {
        switch ( $role )
        { 
            /* Capabilities for 'participant' 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'   => true,
                    'read_hidden_forums'    => false,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => false,
                    'delete_topics'         => false,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => false,
                    'delete_others_replies' => false,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => false,
                    'edit_topic_tags'       => false,
                    'delete_topic_tags'     => false,
                    'assign_topic_tags'     => true,
                );
     
               
     
                break;
     
            default :
                return $role;
        }
    }

    Robin W
    Moderator

    @robin-w

    ok – that’s great – I think I now understand

    loop-single-topic is probably not the right/only place

    but within loop single topic, you can get the ID from bbp_topic_id() which will be itself, so no need to call post parent

    Replies – that is posts in response to a topic, which is I think what you are after, are handled by loop-single-reply.php

    There each reply has an id found by using bbp_reply_id, so you would use something like

    $postimage = wp_get_post_parent_id( bbp_reply_id() ); 
    

    in your code above


    Robin W
    Moderator

    @robin-w

    still no clearer on where this code is going, and which thumbnail you are after.. sorry I’d love to help but I’m still not understanding what you are trying to achieve.


    Robin W
    Moderator

    @robin-w

    depends exactly where you are putting that code, and which thumbnail you are wanting

    get_the_post_thumbnail( $reply_id, $size, $attr );

    may well be what you want.

    Otherwise come back with where the code is going.

    In reply to: meta-single-topic

    Robin W
    Moderator

    @robin-w

    I’m not sure that this is in bbpress – it may be that it is in your theme, or your theme is amending bbpress.

    Try the following to see if it disappears and to work out what is creating this

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back


    Robin W
    Moderator

    @robin-w

    I’ve just added that capability to one of my existing shortcodes in my style pack plugin, so if you install

    https://wordpress.org/plugins/bbp-style-pack/

    and then see

    Dashhboard>settings>bbp style pack>shortcodes for a description of how to use it in detail, but

    [bsp-display-topic-index noreply='true']

    used in a page will get you what you want


    Robin W
    Moderator

    @robin-w

    The correct code would be

    [bbp-single-forum id='3569159-2']

    but I suspect ‘3569159-2’ is the url not the post ID as post ID are a whole number and what you want

    so go to

    Dashboard>forums and select all forums

    If you hover of ‘edit’ of then forum you want, you’ll see at the bottom left of the screen

    url…post.php?post=12345&action=edit

    it is the 12345 that you want to put in the shortcode


    Robin W
    Moderator

    @robin-w

    not quite sure what you are asking?

    Do you want to show each forum, and then all topics and replies all on one page?

    Please come back and explain further


    Robin W
    Moderator

    @robin-w

    suspect it is a theme or plugin issue#

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back


    Robin W
    Moderator

    @robin-w

    have you followed

    Step by step guide to setting up a bbPress forum – Part 1

    and what have you got for step 3?


    Robin W
    Moderator

    @robin-w

    Great – glad you are fixed

    Would you care to share the solution to help someone googling this topic at a later date?


    Robin W
    Moderator

    @robin-w

    In which case this is the easiest way.

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-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/themes/%your-theme-name%/bbpress/loop-single-topic.php

    bbPress will now use this template instead of the original
    and you can amend this

    so go to line 60 which says

    <span class="bbp-topic-started-by"><?php printf( __( 'Started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) ) ); ?></span>

    and change the ‘size’ => ’14’ to a larger number for instance ‘size’ => ’20’


    Robin W
    Moderator

    @robin-w

    Do you access to your theme’s functions file?

    In reply to: Image on top portion

    Robin W
    Moderator

    @robin-w

    This is within your theme, not within bbpress.

    You could put a single image in, but not easily one per forum as far as I can see.

Viewing 25 replies - 9,126 through 9,150 (of 13,529 total)