Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,001 through 5,025 (of 32,481 total)
  • Author
    Search Results
  • #185981
    Robin W
    Moderator

    ok, you’ll need to be using the right template – see

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

    item 8

    #185980
    cobitts15
    Participant

    I tried using short code to call the forum and at first glance it works, but if you click on the test group and topics I made it goes back to full width.

    Thanks for the reply

    #185957
    mrapino
    Participant

    Hello … I opened the Chrome dev console, and hitting the reply link gives me a JavaScript error:

    reply.js:18 Uncaught TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.
        at Object.moveForm (reply.js:18)
        at HTMLAnchorElement.onclick ((index):242)​

    Is this a known bug?

    #185952
    cobitts15
    Participant

    I’m trying to make my forum look uniform to the rest of my site with a dual sidebar of widgets. I’ve tried to follow the documentation for a bbPress specific sidebar and can’t get that to work either https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#26-creating-a-bbpress-specific-sidebar. Any help would be greatly appreciated.

    wwww.ultimatesportslounge.com

    akira010203
    Participant

    I had the exact same issue with the creation of a new custom role.
    My old customs roles worked and still work like a charm but with the new one..

    Impossible to set it and assgin it to a user.

    The trick is simple, add your custom role with the usal way on your function.php like that :

    function vip_add_custom_role( $bbp_roles ) {
    
    $bbp_roles['vip'] = array(
    'name' => 'VIP',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    
    return $bbp_roles;
    }
    
    add_filter( 'bbp_get_dynamic_roles', 'vip_add_custom_role', 1 );

    Then install “Members” Plugin from Justin Tadlock and create a new role with the exact same slug (name) as the one your created.

    You can manage the capabilites too if you want, but the most important thing is that your new custom role will be fully usable.

    #185947
    cassihl
    Participant

    Does anyone know if bbpress has some code in it that can block the redirect after login? Or if it has its own redirect code that is preventing the redirect plugins from working?

    #185941
    kriskl
    Participant

    OK. the problem was with this custom code, which stopped working it would seem..

    //* Correct Gravatars 
    function bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) {
    	$default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg';
    	if( $image && strpos( $image, "gravatar.com" ) ){ 
    		return '<img src="' . $default . '" alt="avatar" class="avatar" ' . $html_width . $html_height . ' />';
    	} else {
    		return $image;
    	}
    }
    add_filter('bp_core_fetch_avatar', 'bp_remove_gravatar', 1, 9 );
    
    function remove_gravatar ($avatar, $id_or_email, $size, $default, $alt) {
    	$default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg';
    	return "<img alt='{$alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />";
    }
    
    add_filter('get_avatar', 'remove_gravatar', 1, 5);
    
    function bp_remove_signup_gravatar ($image) {
    	$default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg';
    	if( $image && strpos( $image, "gravatar.com" ) ){ 
    		return '<img src="' . $default . '" alt="avatar" class="avatar" width="60" height="60" />';
    	} else {
    		return $image;
    	}
    
    }
    add_filter('bp_get_signup_avatar', 'bp_remove_signup_gravatar', 1, 1 );
    #185908

    In reply to: PHP 7.1 Fatal Error

    Robin W
    Moderator

    try

    in bbpress 2.5.12 change line 1800 from

    if ( empty( $post_stati ) ) {
                $post_stati = (array) bbp_get_public_status_id();
    #185899

    In reply to: PHP 7.1 Fatal Error

    Niresh
    Participant

    Im getting blank pages, the bug still exist

    [31-Jul-2017 08:12:42 UTC] PHP Fatal error:  Uncaught Error: [] operator not supported for strings in /home/user/public_html/wp-content/plugins/bbpress/includes/forums/functions.php:1800
    Stack trace:
    #0 /home/user/public_html/wp-includes/class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query))
    #1 /home/user/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #2 /home/user/public_html/wp-includes/plugin.php(515): WP_Hook->do_action(Array)
    #3 /home/user/public_html/wp-includes/class-wp-query.php(1683): do_action_ref_array('pre_get_posts', Array)
    #4 /home/user/public_html/wp-includes/class-wp-query.php(3248): WP_Query->get_posts()
    #5 /home/user/public_html/wp-includes/class-wp.php(617): WP_Query->query(Array)
    #6 /home/user/public_html/wp-includes/class-wp.php(735): WP->query_posts()
    #7 /home/user/public_html/wp-includes/functions.php(955): WP->main('')
    #8 /home/user/public_html/wp-blog-h in /home/user/public_html/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800
    
    #185894
    ersatzpole
    Participant

    Hi,
    I am trying to convert from phpBB but have come across a problem.
    My reply subject and content is in a different table to the normal ‘posts’ table.
    The standard code in the existing conversion file joins the topics table to the posts table like this:

    // Setup reply section table joins
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'topic_id',
    			'join_tablename'  => 'posts',
    			'join_type'       => 'LEFT',
    			'join_expression' => 'USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id',
    			'to_type'         => 'reply'
    		);

    but I need to also join to the table with the subject and content, the ‘posts_text’ table.
    Is this possible using the current conversion framework?
    If so can anyone please help me with the syntax.

    Many thanks

    #185870
    Robin W
    Moderator

    1.

    I’m wanting to move the Edit/Move/Split/Post bar down

    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-reply.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-forum.php
    bbPress will now use this template instead of the original
    and you can amend this

    then around line 29

    <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
    
    		<?php bbp_reply_admin_links(); ?>
    
    		<?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>

    this is the bit you are wanting to move.

    2.

    Is there a way to have the join date underneath their photo beside the post?

    yes it can be done, but would need some coding.

    Same template, around line 57 you’ll find

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

    That’s where you want to add the join date, either as a hook to the action above, or as additional code.

    I suspect you’ll want to pick up the date from the wp_posts table user_registered field.

    using bbp_get_reply_author_id() should get you the user, and

    https://codex.wordpress.org/Function_Reference/get_userdata

    should give you how to use it, with say

    <?php $user_info = get_userdata(bbp_get_reply_author_id() );
          $registered = $user_info->user_registered;
          echo $registered?>

    probably being close to what you want, but you’ll probably need to do some date stuff to display how you want

    https://www.w3schools.com/php/php_ref_date.asp but possibly a strtotime() function

    Hopefully that’s enough to get you somewhere !!

    #185860
    Robin W
    Moderator

    your login requires an authorisation code, which if you get it wrong is taking you to google.

    the logon is part of wrodpress, not bbpress, but I guess that you have a plugin that is doing this authorisation, and that’s where you need to look

    #185843
    Robin W
    Moderator

    possibly

    div#wp-bbp_reply_content-editor-tools {
        display: none;
    }
    

    in the custom CSS section of your theme

    #185831
    TrustedOrb
    Participant

    Set up WordPress on my Windows PC. When I click on “Forums”, I get the error
    Fatal error: Uncaught Error: [] operator not supported for strings in C:\xampp\htdocs\wordpress\wp-content\plugins\bbpress\includes\forums\functions.php:1800 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query)) #1 C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #2 C:\xampp\htdocs\wordpress\wp-includes\plugin.php(515): WP_Hook->do_action(Array) #3 C:\xampp\htdocs\wordpress\wp-includes\class-wp-query.php(1683): do_action_ref_array('pre_get_posts', Array) #4 C:\xampp\htdocs\wordpress\wp-includes\class-wp-query.php(3248): WP_Query->get_posts() #5 C:\xampp\htdocs\wordpress\wp-includes\class-wp.php(617): WP_Query->query(Array) #6 C:\xampp\htdocs\wordpress\wp-includes\class-wp.php(735): WP->query_posts() #7 C:\xampp\htdocs\wordpress\wp-includes\functions.php(955): WP->main(Array) #8 C:\xampp\htdocs\wordpress\wp-admin\includes\post.php(1072): wp(Array) #9 C:\xampp\htdocs\wordpress\wp-admin\includ in C:\xampp\htdocs\wordpress\wp-content\plugins\bbpress\includes\forums\functions.php on line 1800
    New forums can be created without any errors, but when I click on the URL of the new forum, I get the same error again.

    #185822
    Howdy_McGee
    Participant

    Thanks! I’ve been in the code so much I didn’t realize that BBPress has it’s own role to assign things like Keymaster. That ended up doing the trick.

    #185818

    In reply to: bbPress (Replies)

    Shmoo
    Participant

    Well, if you’re not afraid to dive into the template files you could walk though them and comment-out the parts where the replies get included.

    I this part for example.
    no replies

    But when you start doing this you need to understand how to override bbPress template files by copying them over to your own WordPress theme directory. You can find more about that in the codex.

    It’s just walking through paths and following the hierarchy.

    OF course, back-up and always test this first locally. Never do stuff like this straight on live websites.

    #185814
    Howdy_McGee
    Participant

    So I’m trying to allow Editors to manage forums and forum posts. I was able to set all the capabilities to allow them to manage topics and replies but in the admin panel forum access is still denied and the page is entirely hidden from the admin side.

    I did run across this topic but it’s 3 years old – is this still an issue?

    Here’s what the capabilities look like that have been added:

    [moderate_comments] => 1
    [manage_categories] => 1
    [manage_links] => 1
    [upload_files] => 1
    [unfiltered_html] => 1
    [edit_posts] => 1
    [edit_others_posts] => 1
    [edit_published_posts] => 1
    [publish_posts] => 1
    [edit_pages] => 1
    [read] => 1
    [level_7] => 1
    [level_6] => 1
    [level_5] => 1
    [level_4] => 1
    [level_3] => 1
    [level_2] => 1
    [level_1] => 1
    [level_0] => 1
    [edit_others_pages] => 1
    [edit_published_pages] => 1
    [publish_pages] => 1
    [delete_pages] => 1
    [delete_others_pages] => 1
    [delete_published_pages] => 1
    [delete_posts] => 1
    [delete_others_posts] => 1
    [delete_published_posts] => 1
    [delete_private_posts] => 1
    [edit_private_posts] => 1
    [read_private_posts] => 1
    [delete_private_pages] => 1
    [edit_private_pages] => 1
    [read_private_pages] => 1
    [list_users] => 1
    [create_users] => 1
    [delete_users] => 1
    [edit_users] => 1
    [publish_forums] => 1
    [edit_forums] => 1
    [edit_others_forums] => 1
    [delete_forums] => 1
    [delete_others_forums] => 1
    [read_private_forums] => 1
    [read_hidden_forums] => 1
    [publish_topics] => 1
    [edit_topics] => 1
    [edit_others_topics] => 1
    [delete_topics] => 1
    [delete_others_topics] => 1
    [read_private_topics] => 1
    [publish_replies] => 1
    [edit_replies] => 1
    [edit_others_replies] => 1
    [delete_replies] => 1
    [delete_others_replies] => 1
    [read_private_replies] => 1
    [manage_topic_tags] => 1
    [edit_topic_tags] => 1
    [delete_topic_tags] => 1
    [assign_topic_tags] => 1
    [spectate] => 1
    [participate] => 1
    [moderate] => 1
    [throttle] => 1
    [view_trash] => 1
    [keep_gate] => 1

    As far as I can tell they’re exactly the same as the keymaster ( with some additional capabilities ) so why is the Forums still unaccessible in the admin panel?

    #185812

    In reply to: Profile pic bug?

    hannibalherman
    Participant

    Where can i find the css code and change it?

    Jakob Helmer
    Participant

    this solved the issue for me:
    I blocked out all codes from the custom roles except for this one:

    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_professional' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_member' )
            $caps = custom_capabilities( $role );
     
        return $caps;
    }
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );

    and than I was able to assign capabilities to the new roles via the members plugin of Justin Tadlock.

    I’m still wondering why this works for me … but mayby it works for you too … I hope

    #185801
    Robin W
    Moderator

    both those methods should work.

    when you say you are using the shortcode – exactly what have you got on that page?

    #185800
    margley
    Participant

    Hi
    Is it possible to limit the WordPress plugin bbpress to a single forum? I want to only have a single forum on my site, where users can create new topics within that forum. I’d like to remove the Forum List page entirely as well.

    I’ve tried putting the shortcode from this post (Restricting bbpress to a single forum) on my individual forum page, but that didn’t seem to work…

    Please let me know your thoughts!

    #185799
    Robin W
    Moderator

    If you mean like above, then put this into your css

    blockquote::before {
         content: none !important;
        }
    #185797

    Topic: Bug in bbPress

    in forum Installation
    mwheelermindbox
    Participant

    I am using WordPress 4.8 multisite and noticed a bug in bbPress 2.5.12 and 2.5.13 (possibly older versions as well) with PHP 7.1.6.

    Lines 1798-1805 of includes/forum/functions.php is

    
    // Default to public status
    if (empty( $post_stati ) ) {
    	$post_stati[] = bbp_get_public_status_id();
    
    // Split the status string
    } elseif ( is_string( $post_stati ) ) {
    	$post_stati = explode( ',', $post_stati );
    }
    

    For me $post_stati looks to be an empty string so the if is evaluating to true and the next line is failing with this error:

    Fatal error: Uncaught Error: [] operator not supported for strings in /srv/www/tilth.org/current/web/app/plugins/bbpress/includes/forums/functions.php on line 1800

    Changing line 1799 to:

    
    if (is_array( $post_stati) && empty( $post_stati ) ) {
    

    looks to fix the error.

    Perhaps adding a line inside the conditional of

    
    $post_stati = array();
    

    is a better fix.

    bobibrown0
    Participant

    Hi everyone,

    I think the title is clear. Is it possible (with some coding) to display a specific forum category as the index of the forum?

    I tried using shortcodes in content-archive-forum, I wasn’t expecting much, and… I didn’t get much results.

    Any clue?

    #185748
    Robin W
    Moderator

    I’m only a helper on here, and have nothing to do with development of bbpress, so these are just personal comments.

    bbpress’s philosophy has always been to be a light plugin, and allow others to create add-on plugins that have optional functionality.

    The main author JJJ is proud that the plugin is so stable that new releases are not needed regularly.

    A new version 2.6 will when released contain performance improvements and lots of code improvements under the hood, but the only visible addition is per forum moderation.

    Most features asked for are available in add-on plugins.

    Are there any particular things you are after?

Viewing 25 results - 5,001 through 5,025 (of 32,481 total)
Skip to toolbar