Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,126 through 3,150 (of 32,577 total)
  • Author
    Search Results
  • #208783

    In reply to: Character Count

    Robin W
    Moderator

    I don’t know how technical you are, this one does the opposite

    function rew_min_length ($reply_content) {
    	if (strlen($reply_content)<61) {
    		bbp_add_error( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply must be at least 60 characters.', 'bbpress' ) );
    	}
    return $reply_content ;
    }
    
    add_filter( 'bbp_new_reply_pre_content', 'rew_min_length' );
    Robin W
    Moderator

    I mean it would require someone writing some code

    burhi
    Participant

    Okay thanks.

    Have a code?

    #208778
    Robin W
    Moderator

    the includes/forum/template.php has a function called bbp_get_forum_class which adds classes, but as far as I can see it is never used.

    bbp_list_forums in the same template has

    // Subforum classes
    			$subforum_classes      = array( 'bbp-forum-link' );
    			$subforum_classes      = apply_filters( 'bbp_list_forums_subforum_classes', $subforum_classes, $sub_forum->ID );
    
    			// This could use bbp_get_forum_class() eventually...
    			$subforum_classes_attr = 'class="' . implode( ' ', array_map( 'sanitize_html_class', $subforum_classes ) ) . '"';

    so looks like this is a plan?

    anyway you could use the line listed above

    $subforum_classes = apply_filters( 'bbp_list_forums_subforum_classes', $subforum_classes, $sub_forum->ID );

    to add a call to that function

    sorry that’s then best I can do

    Robin W
    Moderator

    not possible without additional code

    #208754
    Afreko Media
    Participant

    Hi again Robin,

    Trying my luck now as it’s no longer for the bbpress part of the page but I’m facing a similar issue with a post carousel I have.

    carousel

    I tried editing the css code you provided me but with no luck.

    Any suggestion?

    Thank you,
    Kev

    #208748
    Robin W
    Moderator

    basically bbpress has the ability to add columns via a filter

    This should do it

    add_filter("bbp_admin_replies_column_headers", 'rew_IP_column_add');
    add_filter("manage_reply_posts_custom_column", 'rew_IP_column_value', 10, 3);
    
    function rew_IP_column_add($columns)  {
    	$new = array();
      foreach($columns as $key => $title) {
        if ($key=='bbp_reply_forum') // Put the forum ID column before the Replies forum column
          $new['rew_id'] = 'IP Address';
        $new[$key] = $title;
      }
      return $new;
    }
    	
    function rew_IP_column_value($column_name, $id) {
    		if ($column_name == 'rew_id') echo get_post_meta( $id, '_bbp_author_ip', true );
    }

    Put this in your child theme’s function file – or use

    Code Snippets

    #208742

    In reply to: Shortcode

    Matthias
    Participant

    Now I’m trying to hide the pagination of the output

    My startpage has the page ID 35
    I’m trying to use this css to hide the pagination only on the startpage
    .page-id-35, a.page-numbers, .page-numbers.current, .page-numbers.dots, .bbp-pagination-count {display:none!important;}

    The css works fine, but the addition .page-id-35 does not work
    Does anyone see an error?
    Thanks
    Matthias

    #208739

    In reply to: Shortcode

    Matthias
    Participant

    I found this code and can now show five popular entries on my frontpage 🙂
    // Top five of bbpress on startpage
    function rk_top_five_view() {
    bbp_register_view( ‘top-five’, __( ‘5 Most Popular Topics’ ), array(
    ‘meta_key’ => ‘_bbp_reply_count’,
    ‘posts_per_page’ => ‘5’ ,
    ‘ max_num_pages’ => ‘1’,
    ‘orderby’ => ‘meta_value_num’ ),
    false );
    }

    add_action( ‘bbp_register_views’, ‘rk_top_five_view’ );

    Thanks
    Matthias

    #208732
    thomei
    Participant

    @lflier
    Wow, this really solves the issue with Visual Editor content styling. Thank you very much!

    unction bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = array( 
                'content_css' => '/wp-content/themes/mytheme/css/tinymce-editor.css',
            );
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    How to add this to: https://codex.bbpress.org/enable-visual-editor/ ?

    #208679

    Topic: Shortcode

    Matthias
    Participant

    I’m using this shortcode on my site.
    [bbp-single-view id=’popular’]
    Is there a way to show only 5 popular threads instead of 10?
    I just tried the following code with no sucess 🙁
    [bbp-single-view id=’popular’ max='5']

    #208667
    Robin W
    Moderator

    not certain this will work, but put this in the custom css area of your theme

    #bbpress-forums ul li::before {
    content : none !important ;
    }
    #208657
    crzyhrse
    Participant

    Just to add the function @Robin W offers still works… I added span style to the text to tweak it…

    It also works this way for text after on the forum list page:

    add_action ('bbp_template_after_forums_index' , 'follow_up' ) ;
    
    Function follow_up () {
    Echo '<div class="entry-content"><span style="color: #666666;">Here is my followup text.</span></div>' ;
    }
    #208645
    Robin W
    Moderator

    just looked at the new code – try

    remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 40);
    remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 40); 
    #208643
    burhi
    Participant

    Hi,

    remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4);
    remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4); 

    not work bbpress 2.6.4

    is there any new code?

    #208617

    In reply to: HTML in text

    BrokenPixel
    Participant

    I’m never quite sure if I should add to a post that has the same problem, but is obviously unanswered for a long while, or post a new topic. But… our forum also has a very similar issue so it seems sensible to add it here.

    For us, it seems to be specific to text-align (left, right or centre) and for “non-admin” logged in users.

    It displays the html code as is, rather than using it to display the correct text alignment. All other html options in the visual editor we’ve tested so far seem to work – it’s just the text alignment that doesn’t. And only for non-admin users – the html works as it should if an admin user posts.

    <p style=”text-align: right;”>right align</p>

    Hoping for a solution? Am on current versions of bbpress, wordpress and bbp style pack and php version 7.3

    #208589
    Robin W
    Moderator

    so you couldput this in your functions file of your child theme, it takes out then new filter and puts back the old one

    remove_filter( 'bp_notifications_get_notifications_for_user', 'bbp_format_buddypress_notifications', 10, 8 );
    add_filter( 'bp_notifications_get_notifications_for_user', 'rew_format_buddypress_notifications', 10, 5 );
    
    function rew_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    
    	// New reply notifications
    	if ( 'bbp_new_reply' === $action ) {
    		$topic_id    = bbp_get_reply_topic_id( $item_id );
    		$topic_title = bbp_get_topic_title( $topic_id );
    		$topic_link  = wp_nonce_url( add_query_arg( array( 'action' => 'bbp_mark_read', 'topic_id' => $topic_id ), bbp_get_reply_url( $item_id ) ), 'bbp_mark_topic_' . $topic_id );
    		$title_attr  = __( 'Topic Replies', 'bbpress' );
    
    		if ( (int) $total_items > 1 ) {
    			$text   = sprintf( __( 'You have %d new replies', 'bbpress' ), (int) $total_items );
    			$filter = 'bbp_multiple_new_subscription_notification';
    		} else {
    			if ( !empty( $secondary_item_id ) ) {
    				$text = sprintf( __( 'You have %d new reply to %2$s from %3$s', 'bbpress' ), (int) $total_items, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) );
    			} else {
    				$text = sprintf( __( 'You have %d new reply to %s',             'bbpress' ), (int) $total_items, $topic_title );
    			}
    			$filter = 'bbp_single_new_subscription_notification';
    		}
    
    		// WordPress Toolbar
    		if ( 'string' === $format ) {
    			$return = apply_filters( $filter, '<a href="' . esc_url( $topic_link ) . '" title="' . esc_attr( $title_attr ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $text, $topic_link );
    
    		// Deprecated BuddyBar
    		} else {
    			$return = apply_filters( $filter, array(
    				'text' => $text,
    				'link' => $topic_link
    			), $topic_link, (int) $total_items, $text, $topic_title );
    		}
    
    		do_action( 'bbp_format_buddypress_notifications', $action, $item_id, $secondary_item_id, $total_items );
    
    		return $return;
    	}
    }
    #208531
    hydrogriff
    Participant

    The current support bbPress has a neat theme. It will be helpful if we can refer it for the best practices and customization. I searched and could not find the source code for the forum’s theme or WordPress’s support theme. Where to find it? Is it open source?

    #208529
    hydrogriff
    Participant

    My bbPress installation is customized a little and has subscribe and favourite buttons in a different place. Since 2.6 extra favourite and subscribe links are appearing in the lead topic header. Is there a way to remove the default ones and keep the ones generated by <?php bbp_topic_favorite_link();?> and <?php bbp_topic_subscription_link(); ?>?

    #208520
    Robin W
    Moderator

    ok, so you could use

    Private groups

    then when you set up each forum ‘I put the Forum creating shortcode on a page.’ you could also set up a group for the forum, add the creator as a member and give him permission to create topics.

    It is a but labor intensive, but would work.

    How many forums are you planning ?

    #208516
    theicebooky
    Participant

    I use User Role Editor to allow subscriber to add Forums. Then, I put the Forum creating shortcode on a page.

    I’m using bbpress not buddypress.

    However, I want to restrict the Topic creator to only be able to create a Topic inside of the Forum they created. Is there a way to do that?? Thanks!!

    #208508
    Robin W
    Moderator

    ok, try this instead

    #bbpress-forums ul.forum-titles li.bbp-forum-info
    			{
    				font-size:  10px !important ;
    			}
    		 
    			#bbpress-forums ul.forum-titles li.bbp-forum-topic-count{
    				font-size: 10px !important ;
    			}
    
    			#bbpress-forums ul.forum-titles li.bbp-forum-reply-count{
    				font-size:  10px !important ;
    
    			}
    
    			#bbpress-forums ul.forum-titles li.bbp-forum-freshness{
    				font-size:  10px !important ;
    			}
    #208496
    Chuckie
    Participant

    In an attempt to manually indicate that a given forum has sub forums I added the following to the forum description:

    Have you found a bug in the Midweek Editor? Or do you have a suggestion for a new feature? Then this is the forum to use. Sub forums: <a href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/midweek-editor-styles/"><em>Custom Templates</em></a>, <a href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/sample-midweek-editor-styles/"><em>Custom Templates – Samples</em></a>, <a href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/monthly-workbook-information/"><em>Monthly Workbook Information</em></a>

    It works. The problem is if I add new lines into the description they get stripped.

    #208495
    dotplus
    Participant

    Hi Robin,

    If I put it in the CSS section of my theme it doesn’t work. Is there another place where I can put this code? Thanks!

    mvaneijgen
    Participant

    Sadly I had to publish my site with the old 2.5.x I’ve managed this by changing the version number of the plugin in bbpress.php and readme.txt to some insane version number which will never be hit in the near future.

    I would still love some pointers on how to implement the pagination of treaded replies, which works with the hack for 2.5.x version of bbpress.

Viewing 25 results - 3,126 through 3,150 (of 32,577 total)
Skip to toolbar