Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 226 through 250 (of 32,315 total)
  • Author
    Search Results
  • webcreations907
    Participant

    I don’t have a multi site set up with bbpress, but try the below and see if that works for you. Would have to add to the code snippets plugin or your theme’s functions.php file

    
    
    if( !function_exists('mh_bbp_get_multi_site_total_users') ){
    	function mh_bbp_get_multi_site_total_users( $count ) {
    		if ( is_multisite() ) {
    			$args = array(
    				'blog_id'     => get_current_blog_id(),
    				'fields'      => 'ID'
    			);
    			$count = count( (array) get_users( $args ) );
    		}
    
    		return (int) $count;
    	}
    
    	add_filter( 'bbp_get_total_users' , 'mh_bbp_get_multi_site_total_users', 100 );
    }
    
    
    #239498

    In reply to: Subscribe to Forum

    webcreations907
    Participant

    That work you for you? I was trying to post the code snippets link, but maybe it wouldn’t go through. You can find that plugin on WordPress plugins

    #239494

    In reply to: Subscribe to Forum

    webcreations907
    Participant

    Will try posting again..

    You can try the below code, either add it to your theme’s functions.php file, or use the code snippets plugin.

    Make sure to select your “Forum” when creating a topic and make sure the forum has subscribers to test it out on.

    
    if( function_exists( 'bbp_get_topic_post_type' ) ){
    	function newtech1_bbpress_new_topic( $post ) {
    		if( isset( $post->post_type ) && $post->post_type == bbp_get_topic_post_type() ){
    			do_action( 'bbp_new_'.bbp_get_topic_post_type(), $post->ID , $post->post_parent, [] , $post->post_author );
    		}
    	}
    	add_action(  'draft_to_publish' ,  'newtech1_bbpress_new_topic', 10 );
    }
    
    #239493

    In reply to: Subscribe to Forum

    webcreations907
    Participant

    The code I just posted isn’t showing @robin-w ?

    #239484
    webcreations907
    Participant

    You could try the below

    
    .bbpress.topic-template-default .cs-entry__header{
      display: none;
    }
    
    #239476
    bastizim
    Participant

    Yes, of course. Here is my script. I thought about setting menu_order for spam posts to “0” before the loop.

    <?php
    
    require_once('wp-load.php');
    
    function repair_menu_order_gaps()
    {
        global $wpdb;
    
        $posts = $wpdb->get_results("
            SELECT ID FROM $wpdb->posts
            WHERE post_type = 'topic' AND post_status = 'publish'
            ORDER BY ID ASC
        ");
        
    
        $topic_counter = 1;
        $unterschiede = 0;
    
        foreach ($posts as $post) {
    
            $poid = $post->ID;
    
            $replies  = $wpdb->get_results("
            SELECT menu_order, ID FROM $wpdb->posts
            WHERE post_type = 'reply' AND post_status = 'publish' AND post_parent=$post->ID ORDER BY menu_order ASC");
            
            $order=0;
            $counter = 0;
    
            $ids = array();
            $menu_orders = array();
            foreach ($replies as $reply) {
                $counter++;
                $order=$reply->menu_order;
                $ids[] = $reply->ID;
                $menu_orders[] = $reply->menu_order;   
            }
    
            if($counter!=$order) {
                echo "Abweichung gefunden in Post $poid: Counter $counter , Order = $order </br/>";
                $unterschiede++;
    
                $counter_rep = 0;
                foreach ($ids as $id) {
    	        $order=$menu_orders[$counter_rep];
                    $counter_rep++;
                    
    
                    echo "Neue Nummer für $id: $counter_rep (Alt: $order)<br/>";
                    
                    // Set new menu_order
                    $wpdb->update(
                        $wpdb->posts,
                        array('menu_order' => $counter_rep),
                        array('ID' => $id)
                    );
                
    
                }
            } 
    
            $topic_counter++;
        }
    
    #239448
    Story Saver
    Participant

    Custom code is required for displaying it in your forums. You should insert the provided code into either your functions.php file, bbpress-functions.php file, or a functionality plugin.
    https://storysaver.page/

    #239441
    biblewithbelle
    Participant

    Hi,

    My theme is creating a featured image on the Topics which I can’t seem to change so I just have a large grey blob square at the top of every topic.

    Introduce Yourself

    I tried multiple default image wordpress themes and none of them worked.

    I can’t add code to display: none because then it takes away the featured posts from the blog section.

    Help?

    #239375
    lifeguard81
    Participant

    Hi guys,

    after install i see some strange code under profilenames. Only as admin i see this.
    What is this?

    https://i.imgur.com/4TODpKr.png

    #239362
    getfree
    Participant

    That worked. GPT insisted that the function call was not needed even when specifically asked. Also it thought that the square brackets are some short codes that were a must, which confused me even more. The text (a poker hand history from a software) starts like this:
    [converted_hand][hand_history]PokerStars – €0.50 PL Hi FAST (6 max) – Omaha Hi – 6 players
    [url=”http://www.holdemmanager.com”%5DHand converted by Holdem Manager 3[/url]

    BTN: €52.28 (104.6 bb)
    [color=”grey”]SB: €24.25 (49 bb)
    [/color][b]Hero (BB): €84.89 (169.8 bb)
    [/b][color=”grey”]UTG: €52.86 (105.7 bb)
    [/color][color=”grey”]MP: €31.34 (62.7 bb)
    [/color][color=”grey”]CO: €50.00 (100 bb)
    [/color]
    SB posts €0.25, Hero posts BB €0.50

    If I get this thing working I will make sure to update my old question about the hand histories in case some1 else is looking for a similar thing.
    Thanks Robin!

    #239361
    Robin W
    Moderator

    ok, the code is probably ok, but chat gpt has a long way to go !

    A function needs something to call it, otherwise it just sits there.

    Not tested, but add these 2 lines before or after (doesn’t matter which) the function

    add_filter( 'bbp_get_reply_content', 'replace_suit_symbols' ) ;
    add_filter( 'bbp_get_topic_content', 'replace_suit_symbols' ) ;
    #239360
    getfree
    Participant

    yes, on bbpress forums.

    I got the code from Chat GPT which ensured me that it would work (ie. clicking send would call the function and execute it) and gave me a few other pieces of more or less similar type of code. As you can see I am quite clueless on this stuff albeit I used to know some Python.

    How to proceed..

    This is related to this https://bbpress.org/forums/topic/poker-hand-histories-not-converted/#post-237481
    We have some freelance developers helping out but they didn’t understand at all what I was trying to accomplish, so I am set to do this “alone” for now, with not much success :/

    #239359
    Robin W
    Moderator

    ok so unless you have some further code, nothing is calling that function.

    I presume this is content on bbpress topics and replies – yes?

    #239358
    getfree
    Participant

    hi,
    I am trying to parse pasted text into something else, where the simplest thing is to change :spade: :club: :diamond: and :heart: to be visualized as ♠♣♦ and ♥ but my solution is not working.

    In the Theme files I edited functions.php by adding the following code (in the staging environment)

    // Function to replace suit representations with symbols
    function replace_suit_symbols($hand_history) {
        // Replace suit representations with symbols
        $hand_history = str_replace(':spade:', '♠', $hand_history);
        $hand_history = str_replace(':heart:', '♥', $hand_history);
        $hand_history = str_replace(':diamond:', '♦', $hand_history);
        $hand_history = str_replace(':club:', '♣', $hand_history);
        
        // Return the modified hand history
        return $hand_history;
    }

    But when I write “:spade”, for instance, nothing changes. What am I missing?
    Hello Theme, WP 6.4.3, bbPress 2.6.9.

    #239304
    Robin W
    Moderator

    it needs a template change – if you know how to FTP

    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-topics.php

    transfer this to your pc and edit

    change:

    <li class="bbp-topic-voice-count"><?php esc_html_e( 'Voices', 'bbpress' ); ?></li>
    			<li class="bbp-topic-reply-count"><?php bbp_show_lead_topic()
    				? esc_html_e( 'Replies', 'bbpress' )
    				: esc_html_e( 'Posts',   'bbpress' );
    			?></li>

    to

    <li class="bbp-topic-voice-count"></li>
    <li class="bbp-topic-reply-count"></li>

    and save

    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

    Then transfer the file you saved above 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-topics.php

    bbPress will now use this template instead of the original

    Repeat this for the file loop-forums.php

    #239303
    jemar707
    Participant

    I am trying to replace the titles for Voice and Replies with dashicons like the WordPress forums are styled. I am using the code below, and it works in that it adds the dashicon, but it doesn’t remove the words.

    
    /*topic titles*/
    .bbpress .forum-titles {
    	overflow: hidden;
    }
    .bbpress .forum-titles .bbp-topic-voice-count::before,
    .bbpress .forum-titles .bbp-topic-reply-count::before {
    	font: 400 16px/1 dashicons;
    	margin-right: 100px;
    	-moz-osx-font-smoothing: grayscale;
    	-webkit-font-smoothing: antialiased;
    }
    
    	.bbpress .forum-titles .bbp-topic-voice-count::before,
    	.bbpress .forum-titles .bbp-topic-reply-count::before {
    		font: 400 21px/1 dashicons;
    		margin-left: 20px;
    	}
    
    .bbpress .forum-titles .bbp-topic-voice-count::before {
    	content: "\f307";
    }
    .bbpress .forum-titles .bbp-topic-reply-count::before {
    	content: "\f125";
    }
    
    .bbpress li.bbp-header li.bbp-forum-info,
    .bbpress li.bbp-header li.bbp-topic-title {
    	text-align: left !important;
    }
    
    /*forum titles*/
    
    .bbpress .forum-titles {
    	overflow: hidden;
    }
    .bbpress .forum-titles .bbp-forum-topic-count::before,
    .bbpress .forum-titles .bbp-forum-reply-count::before {
    	font: 400 16px/1 dashicons;
    	margin-right: 100px;
    	-moz-osx-font-smoothing: grayscale;
    	-webkit-font-smoothing: antialiased;
    }
    
    	.bbpress .forum-titles .bbp-forum-topic-count::before,
    	.bbpress .forum-titles .bbp-forum-reply-count::before {
    		font: 400 21px/1 dashicons;
    		margin-left: 20px;
    	}
    
    .bbpress .forum-titles .bbp-forum-topic-count::before {
    	content: "\f307";
    }
    .bbpress .forum-titles .bbp-forum-reply-count::before {
    	content: "\f125";
    }
    
    .bbpress li.bbp-header li.bbp-forum-info,
    .bbpress li.bbp-header li.bbp-topic-title {
    	text-align: left !important;
    }
    
    #239293
    Robin W
    Moderator

    I think in your code the function no_reply_email needs a my_bbp in front of it

    so

    function no_reply_email(){
        $email = 'no-reply@sitename.com'; // any email you want
        return $email;
    }
    add_filter('bbp_get_do_not_reply_address','my_bbp_no_reply_email');

    shoudl read this

    function my_bbp_no_reply_email(){
        $email = 'no-reply@sitename.com'; // any email you want
        return $email;
    }
    add_filter('bbp_get_do_not_reply_address','my_bbp_no_reply_email');
    #239281
    demonboy
    Participant

    Sorry, forgot the function and end part.

    function add_custom_role( $bbp_roles ) {
    	
    $bbp_roles['deckhand'] = array(
    'name' => 'Deckhand',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    	
    $bbp_roles['admiral'] = array(
    'name' => 'Admiral',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    	
    return $bbp_roles;
    }
    
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );

    And the more I think about it, the more I think this was either something I have over-written in the past, or a feature I had another website, not something your plugin has done. On another website I use the pro version of User Role Editor and I think that is how I am able to force custom forum roles. I think the code I posted above relates to this plugin.

    #239280
    demonboy
    Participant

    Hi Robin,

    My apologies, I’d said it was User Role Editor. It wasn’t, I used the Members plugin. Unfortunately, I can’t provide a link as everything is behind a login but here is my Members admin page. You can see the additional member roles I created.

    Members roles

    All that said, however, I am wondering if this is a theme update that caused this. Previously I’d themed my forum to display this user role, not bbp-author-role, so it is possible this was over-written by a theme update instead (my theme includes bbpress). Honestly, it’s been over four years since I styled my forum so I’m clutching at straws here, but is there any way your plugin could have over-written any custom code I wrote?

    I think if I add this to my child functions file I may be able to re-introduce the forum role:

    		$bbp_roles['oyster-owner'] = array(
    'name' => 'Oyster Owner',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    #239275
    jemar707
    Participant

    I have this in a plugin that we use for a lot of our changes that we want separate from child theme functions.php I don’t know if related.

    function no_reply_email(){
        $email = 'no-reply@sitename.com'; // any email you want
        return $email;
    }
    add_filter('bbp_get_do_not_reply_address','my_bbp_no_reply_email');
    
    function my_bbp_subscription_to_email(){
        $email = 'no-reply@sitename.com'; // any email you want
        return $email;
    }
    add_filter('bbp_subscription_to_email','my_bbp_subscription_to_email');
    
    #239258
    osheta
    Participant

    Hi,

    I’m been seeing some post with HTML code when the teacher answers the questions. We are integrated with Learndash and they told me to comment this with you too. Error HTML

    Thanks,
    Maria

    #239256
    enkoes
    Participant

    Thanks again. Can you look into the second issue as well?

    The bullet point (*) is wrongly used in title “Forum” & “Posts”. I just feel that title should not apply bullet point.

    Regards.

    #239243
    enkoes
    Participant

    I deleted all other widgets, and started with this Forum List widget first, followed by others. Overlapping issue persists. One thing to note is that all other widgets have not caused this problem, including those from Bbp Style Pack. This make me think that the issue is not from the theme itself (probably something missing within the codes?)

    #239233
    enkoes
    Participant

    Thanks for your effort @robin-w.

    I want to highlight two issues with this widget:

    1) If I position it as the first widget in the sidebar, it overlaps with other widgets which supposed to move down and give way to this widget;

    2) The bullet point (*) is wrongly used in title “Forum” & “Posts”. I just feel that title should not apply bullet point.

    * Forum                  * Posts
    * Development & Updates   * 93
    * Installation            * 28,139
    * Troubleshooting         * 61,540
    * Themes                  * 10,285
    * Plugins                 * 15,193
    * Requests & Feedback     * 14,798
    * Showcase                * 3,252

    Other than these two, the widget looks great! 🙂

    #239231
    anutgc
    Participant

    On this page – https://thebakersjunction.com/forums/
    the footer code comes up as text.

    I disabled all plugins one by one. When i disabled G5 Core plugin the problem on this page disappeared but my entire site template got broken.

    I guess it is a conflict between bbpress and g5 core.

    Pls help

Viewing 25 results - 226 through 250 (of 32,315 total)
Skip to toolbar