Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 9,726 through 9,750 (of 14,141 total)
  • @robin-w

    Moderator

    sorry at this point I am backing out.

    Just spending too much time on this and sorry I’ve run out of options – clearly something is wrong.

    In reply to: text visibility

    @robin-w

    Moderator

    That’s IE for you !

    For some reason that I can’t immediately see, IE is ignoring the background setting, so is just saying it has no background so showing white

    I’d suggest you try changing line 999 on dark.css from

    /*media all*/
    media screen #bbpress-forums fieldset.bbp-form p, #bbpress-forums fieldset.bbp-form textarea, #bbpress-forums fieldset.bbp-form select, #bbpress-forums fieldset.bbp-form input {
        background: rgba(18, 21, 24, 1);
        color: #fff !important;
        border: 0px !important;
    }

    to

    /*media all*/
    media screen #bbpress-forums fieldset.bbp-form p, #bbpress-forums fieldset.bbp-form textarea, #bbpress-forums fieldset.bbp-form select, #bbpress-forums fieldset.bbp-form input {
        background: rgba(18, 21, 24, 1) !important;
        color: #fff !important;
        border: 0px !important;
    }

    It may or may not work !

    @robin-w

    Moderator

    ok, can you confirm that you are using the alternate template in style-pack>forum templates?

    @robin-w

    Moderator

    If you are still using my style pack, then I suspect you haven’t got item 3 in forums index styling set.

    3 should set the heading, and 5 the links to subjects

    @robin-w

    Moderator

    ok, I just did the following test.

    Forum private, topic public
    participant can read

    Forum private, topic private
    participant cannot read

    The following code then added :

    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_get_participant_role() :
                return array(
                    // Primary caps
    				// 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;
        }
    }
    

    Forum private, topic private
    participant can read !

    So the code works on my test site.

    Can you duplicate this and come back with results?

    @robin-w

    Moderator

    so can you confirm that your topics are set to private?

    dashboard>topics>any topic>edit and see its published status

    and that you suspect (know?) that this is because of ‘repair forums’?

    @robin-w

    Moderator

    bbPress is tested with wordpress default themes. It maybe a conflict – you need to check plugins and themes

    It could be 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

    ok, so you need to determine if it is the is_bbpress that is the issue. If you just have the other code does it work – ie is the issue with the other code or the conditional?

    @robin-w

    Moderator

    ok, I think it is because your theme has a search with the same name.

    Try this

    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/form-search.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/form-search.php
    bbPress will now use this template instead of your theme’s

    @robin-w

    Moderator

    The file is form-topic.php

    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/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/themes/%your-theme-name%/bbpress/form-topic.php
    bbPress will now use this template instead of the original
    and you can amend this

    However the form has an action hook you can link to

    <?php do_action( 'bbp_theme_after_topic_form' ); ?>

    @robin-w

    Moderator

    ok, thanks for confirming.

    Without spending considerable time testing, why not just take out that entire section for bbpress (and if needed juts put back the bits you want) eg

    //* Hook social icons and click here widget areas
     add_action( ‘genesis_after_header’, ‘the_411_extras’, ‘genesis_after_sidebar_widget_area’ );
    
     function the_411_extras() {
    if (!is_bbpress {
    if ( is_active_sidebar( ‘social-icons’ ) || is_active_sidebar( ‘click-here’ ) || is_active_sidebar( ‘split-sidebar-left’ ) || is_active_sidebar( ‘split-sidebar-right’ )) {
    
    echo ‘<div class=”site-extras”>’;
    
    genesis_widget_area( ‘social-icons’, array(
     ‘before’ => ‘<div class=”social-icons”>’,
     ‘after’ => ‘</div>’
     ) );
    
    genesis_widget_area( ‘click-here’, array(
     ‘before’ => ‘<div class=”click-here”>’,
     ‘after’ => ‘</div>’
     ) );
     genesis_widget_area( ‘split-sidebar-left’, array(
     ‘before’ => ‘<div class=”split-sidebar-left”>’,
     ‘after’ => ‘</div>’,
     ) );
     genesis_widget_area( ‘split-sidebar-right’, array(
     ‘before’ => ‘<div class=”split-sidebar-right”>’,
     ‘after’ => ‘</div>’,
     ) );
    
    echo ‘</div>’;
    
    }
     
    
    }
    
    }

    I’m also not sure why your add action has two functions

    add_action( ‘genesis_after_header’, ‘the_411_extras’, ‘genesis_after_sidebar_widget_area’ );

    all the coding I have ever done has one, and then maybe some arguments on priority etc.

    @robin-w

    Moderator

    can you post a link to a screenshot of where you would like this

    @robin-w

    Moderator

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

    is_bbpress doesn’t take arguments

    @robin-w

    Moderator

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

    do you mean

    if (is_bbpress() )…

    ?

    @robin-w

    Moderator

    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

    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

    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

    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

    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

    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

    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

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

    @robin-w

    Moderator

    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

    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

    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

Viewing 25 replies - 9,726 through 9,750 (of 14,141 total)