Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1 through 25 (of 32,573 total)
  • Author
    Search Results
  • Yevhen Chefranov
    Participant

    bbp_get_reply_class() passes the boolean true as the topic ID when it asks for the reply position. It only works because bbp_get_topic_id() ignores a non-numeric value and falls back to the topic of the current loop. Outside a topic’s own reply loop, that fallback can be a different topic, and the position is looked up in the wrong one.

    Environment

    • bbPress 2.6.19
    • WordPress 7.1.2
    • PHP 8.2

    Where

    includes/replies/template.php, line 2365:

    $reply_pos = bbp_get_reply_position( $reply_id, true );

    The signature is bbp_get_reply_position( $reply_id = 0, $topic_id = 0 ). Two lines above, the function already has the correct value:

    $topic_id  = bbp_get_reply_topic_id( $reply_id );

    What happens

    For a reply whose menu_order is still 0 (position never stored), bbp_get_reply_position() calls bbp_get_topic_id( true ). true is not numeric, so bbp_get_topic_id() goes through its fallbacks: the topic loop, the search loop, the current single topic, and so on.

    • In a topic’s own reply loop this happens to be the right topic, so the bug is hidden.
    • When replies of one topic are listed while another topic is the current one, for example a list of replies rendered on a single topic page, the position is computed with bbp_get_reply_position_raw() against the wrong topic. The reply is not among that topic’s children, so the position is 0. It is not stored, and the same query runs again on the next call.

    The visible result is a wrong bbp-reply-position-N class, plus a wasted child-ID query, which on a large topic loads every reply ID of that topic.

    Suggested fix

    $reply_pos = bbp_get_reply_position( $reply_id, $topic_id );
    #250207
    Yevhen Chefranov
    Participant

    The Akismet integration reports the wrong post count for any author with 1,000 or more posts. The formatted count (for example '1,309') is cast to int, which gives 1. Akismet then receives an experienced member as someone with a single post.

    Environment

    • bbPress 2.6.19
    • WordPress 7.1.2
    • PHP 8.2

    Where

    BBP_Akismet::check_post() in includes/extend/akismet.php, line 115:

    $user_data['total_posts'] = (int) bbp_get_user_post_count( $post_data['post_author'] );

    The value is then sent to Akismet as comment_total (line 162).

    Cause

    Without the second argument ($integer = true), bbp_get_user_post_count() runs through the bbp_get_user_post_count filter. bbp_number_format is hooked to that filter in includes/core/filters.php (line 267), so the function returns a formatted string. Casting that string to int stops at the thousands separator:

    (int) '1,309'  // 1
    (int) '12,045' // 12

    With a locale that uses a space or a non-breaking space as the separator, the result is the same.

    Impact

    Every new topic or reply from an author with 1,000+ posts is checked by Akismet with a post total of 1–999 instead of the real number. The real number is the part of the user history that most separates a long-standing member from a fresh spam account, so the most active members are the ones most likely to be judged worse than they should be. There is no error or notice; the value is just wrong.

    Steps to reproduce

    1. Activate Akismet, so bbPress loads its integration.
    2. Use an account whose _bbp_reply_count + _bbp_topic_count user meta add up to 1,000 or more.
    3. Post a reply and inspect the request sent to Akismet (for example via the bbp_akismet_check_post filter): comment_total is the digits before the first separator, not the real count.

    Suggested fix

    $user_data['total_posts'] = bbp_get_user_post_count( $post_data['post_author'], true );

    The (int) cast is then unnecessary, since the _int filter path already returns an integer.

    Yevhen Chefranov
    Participant

    Opening a topic for editing in wp-admin (post.php?post=ID&action=edit) fails with a fatal error if the topic has 1,000 or more replies. The “Replies” meta box does not render, and the rest of the edit screen is cut off at that point.

    Environment

    • bbPress 2.6.19
    • WordPress 7.1.2
    • PHP 8.2

    Error

    Uncaught TypeError: number_format(): Argument #1 ($num) must be of type int|float, string given
    in wp-includes/functions.php:428
    
    #0 number_format('2,503', 0, ',', ' ')                    wp-includes/functions.php:428
    #1 number_format_i18n('2,503')                            wp-admin/includes/class-wp-list-table.php:1051
    #2 WP_List_Table->pagination('top')                       bbpress/includes/admin/classes/class-bbp-topic-replies-list-table.php:314
    #3 BBP_Topic_Replies_List_Table->display_tablenav('top')  ...:272
    #4 BBP_Topic_Replies_List_Table->display()                bbpress/includes/admin/metaboxes.php:641
    #5 bbp_topic_replies_metabox(WP_Post, array)

    Cause

    In BBP_Topic_Replies_List_Table::prepare_items() (includes/admin/classes/class-bbp-topic-replies-list-table.php, around line 237), the total is read without the $integer flag:

    $total_items = bbp_get_topic_reply_count( $topic_id );

    Without $integer = true, the value passes through the bbp_get_topic_reply_count filter. bbp_number_format is hooked to that filter in includes/core/filters.php, so it returns a formatted string such as '2,503'. That string then goes into set_pagination_args():

    • WP_List_Table::pagination() calls number_format_i18n( $total_items ). On PHP 8 this throws a TypeError for a non-numeric string.
    • ceil( $total_items / $per_page ) is also wrong. '2,503' / 5 is evaluated as 2 / 5, so total_pages would be 1 even on PHP 7.

    Topics with fewer than 1,000 replies are not affected, because their counts have no thousands separator.

    Steps to reproduce

    1. On PHP 8.x, have a topic with 1,000 or more replies (_bbp_reply_count ≥ 1000).
    2. Open that topic in wp-admin → Topics → Edit.
    3. The “Replies” meta box shows the fatal error above.

    Suggested fix

    Request the integer count:

    $total_items = bbp_get_topic_reply_count( $topic_id, true );

    Workaround (until fixed; restricted to the topic edit screen):

    add_action( 'load-post.php', function () {
        if ( ( $GLOBALS['typenow'] ?? '' ) !== bbp_get_topic_post_type() ) {
            return;
        }
        // Runs after bbp_number_format (priority 10) and strips the separator.
        add_filter( 'bbp_get_topic_reply_count', function ( $count ) {
            return (int) preg_replace( '/\D+/', '', (string) $count );
        }, 20 );
    } );
    #250194
    Robin W
    Moderator

    Shortcodes

    and

    dashboard>settings>bbp style pack>shortcodes

    Danishsard
    Participant

    Forum buttons are misaligned (not in a straight line)

    Hi, I’m having an issue while using the BBCode Style Pack: the “Subscribe” and “Favorite” buttons aren’t aligned with each other.

    Also, the “New Topic” and “Subscribe” buttons aren’t in a straight line—they are centered instead of being aligned to the left or right.

    Is there a way to fix this?

    #250189
    Danishsard
    Participant

    Is there a list of these commands somewhere? The bbPress shortcode page is incomplete, and it’s impossible to figure them out on one’s own.

    Is it possible to configure the code to display the 10 most recent posts while also including pagination for the rest—essentially paginating the entire list of topics in sets of 10?

    I currently have my forum sections set to display 25 items per list.

    #250188
    Robin W
    Moderator

    [bsp-display-topic-index show='10' template='short' ]

    #250183
    Danishsard
    Participant

    I am using these two shortcodes:

    [bbp-forum-index]

    [bsp-display-topic-index show=”10″ search=”false” breadcrumb=”false”]

    I want the forum to display, followed by a list of the 10 most recent topics, but without the search bar or breadcrumbs. However, even when I use this code, they still appear (search and breadcrumbs). Does anyone know how to fix this?

    #250059

    Hey everyone! bbPress 2.6.19 is out. This is a security and maintenance release, so if you’re running bbPress, please update your site when you can. Sooner is better. 🙂

    Much of the work in this release makes sure private and password-protected forum content stays where it belongs. We also tightened a few moderation and forum-role checks and fixed issues with BuddyPress, imports, emails, and reply positioning.

    You can read more in the release announcement and upgrade notes. Download bbPress 2.6.19 from WordPress.org, or update right from your WordPress dashboard.

    Thanks to thewindghost, ngonhuy, and moltenbit for responsibly reporting issues, and to everyone who helped review and test this release!

    #249858
    specialworld83
    Participant

    Introducing Aurora bbPress 1.0!

    Aurora is a modern forum template plugin developed by CodeLinSoft to completely redesign the appearance and user experience of bbPress without replacing your existing WordPress theme.

    Designed with a clean, elegant, and responsive interface, Aurora makes it easier to discover discussions, interact with other members, and build an engaging online community.

    MAIN FEATURES

    • Modern, responsive interface for desktop, tablet, and mobile.

    • Redesigned homepage with forum categories, community statistics, and active members.

    • Dedicated recent discussions page with search, filters, and topic previews.

    • Modern topic layouts with author information, discussion statistics, and an interactive timeline.

    • SCEditor WYSIWYG editor with XHTML support.

    • Integrated image and file attachments.

    • Customizable user profiles with avatars and cover images.

    • Configurable discussion badges and member rankings.

    • Automatic topic subscriptions and notifications with an unread counter and dropdown.

    • Customization options available directly from WordPress Admin.

    • Multilingual interface with 12 included languages.

    COMPATIBILITY

    Aurora works as an independent WordPress plugin, preserving the underlying bbPress discussion system and your existing WordPress theme.

    Version: 1.0

    WordPress: 6.4 or later

    PHP: 7.4 or later

    Requires: bbPress

    License: CodeLinSoft Proprietary License

    DISCOVER AURORA

    Explore its features, view the interface previews, and get the plugin from the official website:

    Aurora bbPress – Official Product Page

    Feedback, suggestions, and feature requests are welcome!

    Developed by CodeLinSoft.

    Robin W
    Moderator

    Note sure if this issue is covered in this article

    phpBB

    #249731
    Robin W
    Moderator

    I have emailed the developers, but as I am not privy to the exact code at fault, I cannot give any reassurance as to exactly what the issue is.

    #249344
    Robin W
    Moderator

    You can use shortcodes instead

    Shortcodes

    There are also additional ones with filters in

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>shortcodes

    #249327

    In reply to: uses_utf8 problem

    pentatonicfunk
    Participant
    
    FILE: /bbpress/includes/common/formatting.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     810 | WARNING | seems_utf8() has been deprecated since WordPress version 6.9.0. Use wp_is_valid_utf8() instead. (WordPress.WP.DeprecatedFunctions.seems_utf8Found)
     811 | WARNING | Function utf8_encode() is deprecated since PHP 8.2; Use mb_convert_encoding(), UConverter::transcode() or iconv instead (PHPCompatibility.FunctionUse.RemovedFunctions.utf8_encodeDeprecated)
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    #249326
    pentatonicfunk
    Participant
    
    FILE: /bbpress/includes/admin/tools/repair.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     372 | ERROR | The parameter "array( 'hide_empty' => false )" at position #2 of get_terms() has been deprecated since WordPress version 4.5.0. Instead do not pass the parameter. (WordPress.WP.DeprecatedParameters.Get_termsParam2Found)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /bbpress/includes/common/functions.php
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     532 | ERROR | The parameter "array( 'hide_empty' => true )" at position #2 of wp_count_terms() has been deprecated since WordPress version 5.6.0. Instead do not pass the parameter.
         |       | (WordPress.WP.DeprecatedParameters.Wp_count_termsParam2Found)
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    

    PHP 8.5
    WP 7.0.1
    bbpress 2.6.14

    laptoplife
    Participant

    Thank you so much for your post and the suggestions.

    Using the suggestions I have determined that this problem doesn’t occur if I use one of these options. All of the options don’t have to be used, just picking one gets rid of the issue.

    1) Don’t use the closed threads option at all.
    2) Deactivate the plugin Turnkey bbPress by WeaverTheme
    3) Change the theme. The lock shows normally without the code being there.

    But this doesn’t really solve it because I want to keep the theme and the plugin.

    I assumed that there is an issue with the way the dashicons were being processed.

    I added this to functions.php. It did not change anything.

    image

    I feel like perhaps there is an issue with the title formatting.

    If I go to the post and click on Edit Topic, it doesn’t show any extra code in the title section. Yet I see that this <span> is being inserted into the title of the forum post (as shown above) and I think WordPress may be stripping out the code which is why it shows. I could be wrong in this, but where would I look to see how to change this.

    image

    laptoplife
    Participant

    If I close a topic, it’s nice that it shows a lock icon in the link, but when one clicks on the thread, it shows the code at the top of the page.

    Remove this

    How do I remove this code from the title while still keeping the threads locked?

    Thank you.

    Wordpress 7.0
    BBPress Version 2.6.14

    #249172
    flamuren
    Participant

    Hi,

    I want to use these widgets when bulding my websites forum page: https://codex.bbpress.org/features/widgets/

    I see Buddypress widgets, but bbpress is not showing. However I see them when editing sidebar widgets.

    Is it possible to use them on normal pages also somehow?

    My goal is to display the latest forum posts.

    Best regards,
    Flamuren

    #248986
    Kayako Saeki
    Participant

    This would require writing separate code; would that be possible?

    jgasba
    Participant

    Thanks a bunch for taking the time to detail all that.

    About translations I am trying to contribute to the official community translations for the plugin in French. I found the culprit strings and added translations for them. https://translate.wordpress.org/projects/wp-plugins/bbp-style-pack/stable/fr/default/?filters%5Bterm%5D=Moderation+Flag&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc
    Then of course it will only merge when 90+% is translated (and validated), is that correct?

    I struggled to find it in the codebase at first because I thought it was in bbpress, my bad. It was then helpful to use the translation website. For further reference it was at the time of writing at modtools/bbpress.php#L215 (in bbp style pack plugin of course)

    The most frustrating thing with plugins like bbpress/Buddypress ecosystem is undocumented features/hooks and config parameters and the difficulty it puts on users wanting to work with it or even contribute to understand everything and how each piece comes together with the rest of wordpress in a 15 year old codebase… but thanks to people like you we can go further is making those better 👍

    Thanks again for the quick answers

    Robin W
    Moderator

    If you want to hide it completely, then add this to the custom css tab of my style pack plugin

    .moderationlinks-flag {
        display: none ;
    }	
    Robin W
    Moderator

    Hi,

    I am the author of bbp-style-pack.

    This part of the code is from a moderation plugin that I rescued from being closed, and i did enough to get it working in my plugin, so I do not have full knowledge of every feature.

    Can you tell me exactly where and when you see this text?

    weswebmaster
    Participant

    Hello,

    As you can see from the attached example and output code, there does not seem to be a style code applied to the sub-forum descriptions. As a result, they all appear bunched up and unformatted. Unlike the Title Forum (i.e. Category) description, which follows bbp-forum-content.

    Is there a way to apply bbp-forum-content or a different Style to the sub-forum decription??

    Please message me directly, if you need a link to the page.

    Many thanks,
    George

    Inspect Code:
    Inspect Code

    Output:
    Output

    #248793
    Robin W
    Moderator

    ok, so can you post the line of code code you are using to call that action please, or confirm that you are not using any reassign field in that call

    Marisa
    Participant

    When the delete_user action is called I want to delete all the bbPress forum topics and replies for a specified user.

    I think the problem is the posts are having their user id set to 1 as part of the deletion process and by the time the delete_user action is called, it is too late.

    The code I have so far is given below. I’m not quite sure what the current state of this code is, but I think it deletes topics but not replies.

    // Get remaining replies by user (not already removed with topics)
    $replies = get_posts(array(
    ‘author’ => $user_id,
    ‘post_type’ => bbp_get_reply_post_type(),
    ‘post_status’ => array(‘publish’, ‘closed’, ‘spam’, ‘pending’, ‘trash’, ‘inherit’),
    ‘numberposts’ => -1,
    ‘fields’ => ‘ids’));

    // Delete replies
    if (!empty($replies))
    {
    foreach($replies as $reply_id)
    {
    bbp_delete_reply($reply_id, true);
    }
    }

    // Get all topics by user
    $topics = get_posts(array(
    ‘author’ => $user_id,
    ‘post_type’ => bbp_get_topic_post_type(),
    ‘post_status’ => ‘any’,
    ‘numberposts’ => -1,
    ‘fields’ => ‘ids’));

    // Delete topics (this also deletes their replies)
    if (!empty($topics))
    {
    foreach ($topics as $topic_id)
    {
    bbp_delete_topic($topic_id, true); // true = force delete
    }
    }

Viewing 25 results - 1 through 25 (of 32,573 total)
Skip to toolbar