Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,976 through 6,000 (of 32,519 total)
  • Author
    Search Results
  • #177679

    In reply to: Threaded layout

    Stephen Edgar
    Keymaster

    I’m pretty sure you’d be able to get what you’re after 🙂

    Once bbPress is activated, enable “threaded replies” in the settings.

    Use bbp_show_lead_topic(), grab the snippet from https://codex.bbpress.org/bbp_show_lead_topic/ and create a custom plugin using that code snippet.

    Then I’d suggest hoping over to the docs and do some reading:

    Theme Compatibility

    #177667

    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 !

    #177663
    evanevans333
    Participant

    I got the white screen of death with that code. The following error message:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘add_role_caps_filter’ not found or invalid function name in /home3/filmsco/public_html/testwebsite/wp-includes/plugin.php on line 235

    Had to add this to the top from your prior code:

    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;
    }

    P.S. Is this new code any different than the last code?

    #177654
    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?

    #177645
    evanevans333
    Participant

    I came across this in a thread.
    https://wordpress.org/support/topic/not-working-for-bbpress-rolesWould that be somehow useful? Probably not.

    /**
     * FORUM - Role map
     * bbPress has its own internal ("dynamic") Roles, so we map our real wp roles to bbPress.
     */
    add_filter('bbp_get_user_role_map','my_bbPress_role_map');
    function my_bbPress_role_map($role_map){
    	$role_map['student'] = bbp_get_participant_role();
    	return $role_map;
    }
    #177637
    crzyhrse
    Participant

    Yes, that is where it goes, in functions.php… I can confirm that the code is still working here… Have you cleared caches…?

    #177636
    kkpb8084
    Participant

    I inputed Robin W’s code into functions.php in my child theme folder, and it didnt work. Should it go into a different file?
    thanks

    kkpb8084
    Participant

    Hi, can anyone help?
    I cannot find the answer to my query from searching this forum and google.
    At the moment, people need to enter a name and email to post a topic, or reply to a topic, on my forum (http://psychiatryadvice.com/).

    I would like to replace that with what they have at this forum: http://www.econjobrumors.com/
    They seem to generate a random 4-digit code for each person posting. I am aiming for anonymity in my forum too.

    Does anyone know how I can do this please?
    Thanks very much!

    I’m using:
    Wordpress v 4.5.3
    bbpress v 2.5.9-6017

    #177624
    Robkk
    Moderator

    Okay your topic is closed and stickied, so adjust this css. Use a custom css plugin, or modify and place this css into a style.css file in a child theme.

    #bbpress-forums .status-closed,
    #bbpress-forums .status-closed a {
     color: #ccc;
    }
    .bbp-topics-front ul.super-sticky,
    .bbp-topics ul.super-sticky,
    .bbp-topics ul.sticky,
    .bbp-forum-content ul.sticky {
     background-color: #ffffe0 !important;
     font-size: 1.1em;
    }
    #177622
    Robkk
    Moderator

    What theme are you using?

    EDIT: Forgot that I did make this guide for a user experiencing a similar issue.

    https://codex.bbpress.org/getting-started/troubleshooting/search-redirects-to-front-page/

    Although this might help, I would like to know your theme just in case it doesn’t so I could do some troubleshooting.

    If its not the theme, we have to do some plugin troubleshooting.

    #177613
    Robkk
    Moderator

    Its a customized forum archive layout in the sidebar. I think they just put the forum index shortcode in the sidebar. Then in Settings > Forums they set the forum archive to show topics by freshness.

    #177607
    Robkk
    Moderator

    I am trying to remove that from showing on the forums page and instead show a a login for bbpress.

    This forum page you say, is it just the original forum index page at /forums, or is this a page that you inserted the forum index shortcode to create “forum page”??

    The is_bbpress() conditional may not work if you went the shortcode in a page route.

    Well unless you made sure the pages slug was the same slug as the forum root, but even with that I feel like that odd procedure could cause issues.

    #177601
    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?

    #177595
    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' ); ?>

    #177594
    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.

    #177580
    iliyan
    Participant

    and when I add this code to disable only visual editing everything works but I don’t want to do this:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = false;
        $args['quicktags'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    #177567
    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.

    #177566
    crayc
    Participant

    Hello, I am using genesis theme the-411 which has no sidebars just a fixed widget area to the right showing social icons. The site is forced full width but the container sit at about 800px I am trying to remove that from showing on the forums page and instead show a a login for bbpress. Not sure how to go about doing this. I tried the If conditional tag on there but it does not seem to work.

    here is the code
    //* 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_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>’;

    if (is_bbpress( ‘forums’ ) ) {
    /** Remove default sidebar */
    remove_action( ‘genesis_after_sidebar_widget_area’ );
    }

    }

    }

    I added the split right and left, but I only use the right for search box. Thanks!

    #177562
    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':

    #177557

    In reply to: Translation German

    Robkk
    Moderator

    So in settings > General you have Deutsch as the Sprache der Website

    I am not sure why you are using files with pt_DE instead of de_DE, and wonder if that could be the issue, or you need a different kind of language file to use. Also the language file directory has changed. It is now /wp-content/languages/plugins

    #177554
    evanevans333
    Participant

    I don’t think so. According to this, those caps are not listed for Participant:

    bbPress User Roles and Capabilities

    But it makes sense they should be part of Participant caps right? I’m not insane? 🙂

    #177553
    evanevans333
    Participant

    Oh no kidding. Well yeah that makes sense right? On my install, even with all plugins off (except bbpress), the user Participant does not get Read Private Topics and Replies perms. Yes, I can confirm that.

    I am using the Thrive Community theme by Dunkahkdis, and he said that was not happening inside his Theme and to come over to bbPress and ask in here. He’s not irresponsible either. He’s an amazing coder, and excellent with tech support. But, you never know. You never know.

    So, just for clarity. You are saying, outright, that the Participant Role by default in bbPress is supposed to HAVE the caps: Read Private Topics and Replies
    ?

    #177545
    evanevans333
    Participant

    Well I still appreciate you sending over the code. I will fiddle with it, and see where it gets me. Thanks so much. AND I will report back findings, in case it does solve something, so that others will see at least one solution. Thanks!

    #177544
    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

    #177543
    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;
        }
    }
Viewing 25 results - 5,976 through 6,000 (of 32,519 total)
Skip to toolbar