Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 76 through 100 (of 32,374 total)
  • Author
    Search Results
  • #242173

    In reply to: This forum is empty

    Robin W
    Moderator
    add_filter( 'gettext', 'rew_translations', 20 , 3 );
    
    function rew_translations( $translated, $text, $domain ) {
    	if ($domain != 'bbpress' return $translated;
    	if ( $translated == 'This forum is empty.' ) {
    		$translated = 'new text';
    	}
    	return $translated;
    }
    #242168

    In reply to: This forum is empty

    gkldh
    Participant

    hello how can i add link on text ??

    if ( $translated_text == 'This forum is empty.' ) {
    	$translated_text = 'new text';
    }
    #242129
    gkldh
    Participant

    hello @robin-w, thanks for reply.

    i am fresher in bbpress, kindly suggest me how can i do this ? any function or shortcode ?

    #242128
    Robin W
    Moderator

    anything is possible with code, but I know of no current plugin that does this.

    Robin W
    Moderator

    https://stackoverflow.com/questions/59336951/message-trying-to-access-array-offset-on-value-of-type-null

    The parser php file says the code is from

    This is a compressed copy of NBBC. Do not edit!

    Copyright (c) 2008-9, the Phantom Inker. All rights reserved.
    Portions Copyright (c) 2004-2008 AddedBytes.com

    I would hesitate to correct it, but you could alter lines around 1289 to have a fix as in above link.

    But I’d suggest you go to a version of php before 7.4 to do the import, and then after import go back to a supported php version

    #242023
    Stephen B
    Participant

    Yes, I’ve tried the other shortcodes as well and the same issue happens with all of them

    #242013
    Robin W
    Moderator

    ok, thanks.

    I cannot see why it would do this, unless it thinks it is a bbpress page and should add the sidebar.

    Is it doing this for any bbpress shortcode – maybe as a test try some others and then come back

    Robin W
    Moderator

    so which of the methods in this link item 3 are you using?

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

    #242007

    In reply to: PHP Deprecated

    jakerouge
    Participant

    Hi there,

    Was there ever a fix found for this as I still have the depreciation warnings. I have tried both these plugins and neither work.

    Deprecated: Creation of dynamic property BBP_Forums_Component::$members is deprecated in /website/wp-content/plugins/bbpress/includes/extend/buddypress/loader.php on line 149
    
    Deprecated: Creation of dynamic property BBP_Forums_Component::$activity is deprecated in /website/wp-content/plugins/bbpress/includes/extend/buddypress/loader.php on line 153

    Thank you in advance

    #242000
    Stephen B
    Participant

    You can see an example page now here:
    http://bit.ly/4eG3RLY
    The shortcode also uses the page title (where the shortcode is pasted) instead of the topic title.
    Is it because of incompatibility with the theme?

    #241984
    Stephen B
    Participant

    Thanks for replying and yes, I am using the topic ID and it’s showing the correct topic.
    The issue is that the shortcode is displaying the forum sidebar in addition to the topic.
    You can see here a screenshot of the source code https://ibb.co/2PS9qW1

    #241977
    Robin W
    Moderator

    ok, not totally sure I understand.

    so you are putting the actual topic_id in ?

    eg

    [bbp-single-topic id=265]

    and not sure I understand what ‘it pulls the bbpress forum sidebar widget ‘ means – do you have a link to a live example?

    #241965
    Stephen B
    Participant

    I want to show a single topic on my homepage, on top of the page.
    When I use the shortcode [bbp-single-topic id=$topic_id] it pulls the bbpress forum sidebar widget as well. I am not sure if it’s incompatibility with the theme or normal behavior.

    Is there PHP code I could use instead to pull a single topic? Maybe I could then use that to create a custom template for the homepage.

    Thanks in advance

    #241955
    Robin W
    Moderator

    ok, so that error tells you it is a problem with the plugin gd-topic-polls

    'call to undefined method xxxx in ...public_html/wp-content/plugins/gd-topic-polls'

    That plugin is not written by bbpress and

    GD Topic Polls: plugin for WordPress and bbPress Forums

    says that the free version it is no longer being maintained.

    There is a paid version at

    https://www.dev4press.com/plugins/gd-topic-polls/

    and if you have bought that version, then you need to raise a support ticket with them.

    If you have the free version, then if you want to continue to use this plugin, you would need to buy the paid version

    #241874
    Pierre-Yves
    Participant

    Hi there,

    Test site latest updates and twenty four theme.

    As explain in title I can’t display forum with 2024 and other blocks themes.

    It’s ok to display forum list with shortcode but not forums.

    Thanks four your help.

    #241840
    shaynald
    Participant

    Hi Robin, thank you for replying quickly. Is there a shortcode (or even a php snippet) for adding a forum’s subscribe button to a template?

    #241737
    bobjgarrett
    Participant

    I am struggling with Search for my forum. The standard WP Search within my site works and includes results from the bbpress forums but only shows individual posts. I’d rather show links to the Topic, or at least have a link in the posts found to the topic.
    So I tried to implement Search within the forum.
    I tried using shortcode [bbp-search] but this changes nothing on the page. I tried the shortcode [bbp-search-form] on the page and got a search box but no matter what text I enter in there I only ever get the same single result which is the latest overall WP post, not a bbpress post.
    I have set “Allow forum wide search” in settings.
    What am I doing wrong?

    #241708

    In reply to: Sidebar not showing

    Robin W
    Moderator

    ok, so which method atre you using in

    https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ item 3

    if method 1, then try using method 2

    #241609
    alembiq
    Participant

    We had a PHPBB many years ago, which we migrated to bbPress around four years ago, but it seems some flags remained in the database for the whole time, flags like (_bbp_class, _bbp_old_user_id, _bbp_password, _bbp_phpbb_user_avatar, _bbp_phpbb_user_sig). They might be needed; I have no idea.

    But after the last update of WP and all the plugins, all the migrated users started to get an error message instead of being able to log in:
    `
    {“success”:false,”data”:[{“code”:”bbp_converter_db_connection_failed”,”message”:”Database connection failed”}]}
    `
    After some debugging and searching, I found https://bbpress.trac.wordpress.org/ticket/3419#no0 and tried to remove _bbp_class, which helped 🙂

    I just needed to wipe the SQLite Object Cache because it kept the old data. It might happen to someone else in the future, I don’t know. I don’t know if you can somehow influence that this metadata is not stored there or something else. But at least you have the information that it might happen.

    #241607
    kimis
    Participant

    sorry I did
    add_action('bbp_new_forum_form', 'add_formation_field_to_forum_form');

    #241606
    kimis
    Participant

    Well it still doesn’t work, what if instead of that, I add a select on the form to create a forum, I create it also in the admin panel. how can I do that because I did

    add_action('bbp_new_forum_form_after_content', 'add_formation_field_to_forum_form');
    function add_formation_field_to_forum_form() {
        $formations = get_terms(array(
            'taxonomy'   => 'formation',
            'hide_empty' => false,
        ));
        
        if (!empty($formations) && !is_wp_error($formations)) {
            echo '<div class="bbp-form">
                    <label for="forum-formation">SĂ©lectionner une formation :</label>
                    <select name="forum_formation" id="forum-formation">';
            
            foreach ($formations as $formation) {
                echo '<option value="' . esc_attr($formation->term_id) . '">' . esc_html($formation->name) . '</option>';
            }
            
            echo '</select>
                  </div>';
        }
    }

    I want to link the forum to the taxonomy formation I think it should be more easier but in that way it doesn’t work I have linked formation to forum by doing

    function link_formation_taxonomy_to_forums() {
        register_taxonomy_for_object_type('formation', 'forum');
    }
    add_action('init', 'link_formation_taxonomy_to_forums');
    #241597
    Robin W
    Moderator

    ok so from the admin area I think you need to hook to

    do_action( 'bbp_forum_attributes_metabox_save', $forum_id );

    #241593
    kimis
    Participant

    I did

    add_action('bbp_new_forum_post_extras', 'my_custom_bbp_new_forum_handler');
    
    function my_custom_bbp_new_forum_handler( $action = '' ) {
    error_log('test function');
        if ( 'bbp-new-forum' !== $action ) {
            return;
        }
    
        if ( ! bbp_verify_nonce_request( 'bbp-new-forum' ) ) {
            bbp_add_error( 'bbp_new_forum_nonce', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
            return;
        }
    
        do_action( 'bbp_new_forum_post_extras', $forum_id );
    
        $forum_title = get_the_title($forum_id);
        $forum_slug = sanitize_title($forum_title);
    
        if (!term_exists($forum_title, 'forums')) {
            $result = wp_insert_term($forum_title, 'forums', array(
                'name' => $forum_title,
                'slug' => $forum_slug
            ));
    
            if (is_wp_error($result)) {
                error_log("Erreur lors de l'insertion du terme : " . $result->get_error_message());
            } else {
                error_log("Terme de taxonomie 'forums' créé avec succès : " . print_r($result, true));
            }
        } else {
            error_log("Le terme existe déjà : " . $forum_title);
        }
    
        $redirect_url = bbp_get_forum_permalink( $forum_id );
        bbp_redirect( $redirect_url );
    }

    but it still doesn’t work the first error log doesn’t appear on the debug file

    #241592
    Robin W
    Moderator

    I think you need to hook to

    do_action( 'bbp_new_forum_post_extras', $forum_id );

    which is in the function bbp_new_forum_handler

    #241589
    kimis
    Participant

    Hello, I have a taxonomy forums that is is linked to the user, how can I do to create a forum on bbpress and when it’s done it also create a forum on my taxonomy

    my code is :

    function create_forum_taxonomy_entry($forum_id, $forum_args) {

    $forum_title = get_the_title($forum_id);
    $forum_slug = sanitize_title($forum_title);

    error_log(“CrĂ©ation du forum : ” . $forum_title);
    error_log(“Slug du forum : ” . $forum_slug);

    // Insertion du forum dans la taxonomie forum
    if (!term_exists($forum_title, ‘forums’)) {
    $result = wp_insert_term($forum_title, ‘forums’, array(
    ‘slug’ => $forum_slug
    ));

    if (is_wp_error($result)) {
    error_log(“Erreur lors de l’insertion du terme : ” . $result->get_error_message());
    } else {
    error_log(“Term crĂ©Ă© avec succès : ” . print_r($result, true));
    }
    } else {
    error_log(“Le terme existe dĂ©jĂ  : ” . $forum_title);
    }
    }
    add_action(‘bbp_insert_forum’, ‘create_forum_taxonomy_entry’, 10, 2); but this function isn’t called

    the file has another function below and it works so it’s not the calling of the file

Viewing 25 results - 76 through 100 (of 32,374 total)
Skip to toolbar