Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,151 through 3,175 (of 32,517 total)
  • Author
    Search Results
  • #208388
    Matthias
    Participant

    <?php bbp_user_profile_link( bbp_get_current_user_id() ); ?>

    How can I change the code above, to show only the name, without the link to bbpress profile?

    Thanks
    Matthias

    #208380
    samtime
    Participant

    Is there any code in buddypress > notifications that we can copy over to bbpress > includes > extend > buddypress > notifications.php (or vice versa), to make bbPress notifications automatically dismiss like Private Message, Friend Request, and other BuddyPress notifications do?

    If it’s not that straight forward, then is there a way to disable this style off bbPress notifications being sent to BuddyPress?

    My users (and I) really love the notification feature, but just find it really time-consuming to have to dismiss these notifications manually.

    Appreciate any help / advice,
    Sam

    #208375
    samtime
    Participant

    Okay, thanks. I think I might have thought it was a bit more scary than it really is.
    As long as those attributes listed above only affect the design of the post, and not allow any sort of strange code to run.

    Here’s one of the posts from the user, looks like it’s just some funky formatting. Not too bad.

    html post

    Oh, and the skills tab he’s talking about in the post is to do with the Youzer plugin for BuddyPress. I think it just allows him to put more text there than neccessary, but not weird code.

    Skills bug

    #208373

    In reply to: Oh no!

    Robin W
    Moderator

    @casiepa

    you need to change this in your toolkit plugin includes/go-functions.php

    lines 55 & 56

    from

    function bbptoolkit_bbpress_list_forums() {
    	$args = array();

    to

    function bbptoolkit_bbpress_list_forums($args) {

    This brings through default values, otherwise under 2.6 sub forums don’t get shown.

    #208368

    In reply to: Oh no!

    Matthias
    Participant

    Thanks to all:
    I changed these senctence directly in feedback-no-forum.php and put it in my child theme.
    I tried this before, but did not know that this sentence has a problem with german special characters. There is an ü in this sentence and it works only if I write it in html
    &uuml; code

    <div class="bbp-template-notice">
    	<ul>
    		<li><strong><?php esc_html_e( 'Dieses Forum ist nur f&uuml;r Dauerbenutzer!', 'bbpress' ); ?></strong></li>
    	</ul>
    </div>

    Thanks all for your suggestions
    Matthias

    #208313

    In reply to: sub topics not showing

    Robin W
    Moderator

    @haddly do you have

    function custom_bbp_sub_forum_list($args)

    or as you pasted

    function custom_bbp_sub_forum_list() {

    #208310

    In reply to: sub topics not showing

    Robin W
    Moderator

    change that to

    function custom_bbp_sub_forum_list($args) {
    $args['separator'] = '';
    return $args;
    }
    add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );

    and it should be fine

    #208303

    In reply to: sub topics not showing

    haddly
    Participant

    @robin-w
    Hi there. I have finally found why this is not displaying. It isn’t the plugins 1 or 2 above but a snippet of code I added to my functions.php file a long while back. I remember adding it because the subforum topics weren’t displaying correctly and were displaying in a horizontal fashion (I think).

    If I remove this piece of code, the subforum topics now appear. The CSS is a little funky and the text a little small, but I can fix this. Sorry for not thinking to check the added snippets to my functions.php sooner.

    function custom_bbp_sub_forum_list() {
    $args['separator'] = '';
    return $args;
    }
    add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );

    #208298
    samtime
    Participant

    Hi, One of my users discovered that they can post potentially malicious HTML into the bbPress reply box.

    I once added the code below to my functions.php file, because users were not able to use Left-align, Centre, and Right-align for text, but I fear maybe it’s now given too many HTML permissions.

    Could anyone please look at this code and let me know if something needs to be changed (maybe some trues switched to falses)?

    Thank you so much, Sam

    add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' );
    function ntwb_bbpress_custom_kses_allowed_tags() {
    	return array(
    		// Links
    		'a'          => array(
    			'class'    => true,
    			'href'     => true,
    			'title'    => true,
    			'rel'      => true,
    			'class'    => true,
    			'target'    => true,
    		),
    		// Quotes
    		'blockquote' => array(
    			'cite'     => true,
    		),
    		
    		// Div
    		'div' => array(
    			'class'     => true,
    		),
    		
    		// Span
    		'span'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    		
                    // Paragraph
    		'p'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    
    		// Code
    		'code'       => array(),
    		'pre'        => array(
    			'class'  => true,
    		),
    		// Formatting
    		'em'         => array(),
    		'strong'     => array(),
    		'del'        => array(
    			'datetime' => true,
    		),
    		// Lists
    		'ul'         => array(),
    		'ol'         => array(
    			'start'    => true,
    		),
    		'li'         => array(),
    		// Images
    		'img'        => array(
    			'class'    => true,
    			'src'      => true,
    			'border'   => true,
    			'alt'      => true,
    			'height'   => true,
    			'width'    => true,
    		),
    		// Tables
    		'table'      => array(
    			'align'    => true,
    			'bgcolor'  => true,
    			'border'   => true,
    		),
    		'tbody'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'td'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tfoot'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'th'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'thead'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tr'         => array(
    			'align'    => true,
    			'valign'   => true,
    		)
    	);
    }
    #208297
    reedy
    Participant

    Unfortunately, this code didn’t work — it removed the content of all forum posts!

    #208295
    Robin W
    Moderator

    should be

    .bbp-login-form {
    	background: white !important;
    	padding: 10px !important;
    }
    #208293
    pointydrip
    Participant

    When I try to access mysite.com/forums it does not work with my theme so I copied archive-forum.php to my child theme.

    The default archive-forum.php template allows the bbpress content to appear, but not the theme header, so I stripped away the bbpress header items and replaced ‘archive-forum’ with ‘page’ like so:

    <?php
    get_header(); ?>
        <div id="forum-front" class="bbp-forum-front">
            <div class="entry-content">
                <?php bbp_get_template_part( 'content', 'page' ); ?>
            </div>
        </div><!-- #forum-front -->
        <?php do_action( 'bbp_after_main_content' ); ?>
    <?php get_sidebar(); ?>
    <?php
    get_footer();

    This makes the theme header work, but now the bbpress content is broken.
    I am getting the following error:
    Warning: count(): Parameter must be an array or an object that implements Countable in public_html/wp-includes/post-template.php on line 316

    The line in question is:

    if ( $elements['page'] > count( $elements['pages'] ) ) { // if the requested page doesn't exist
    		$elements['page'] = count( $elements['pages'] ); // give them the highest numbered page that DOES exist
    	}

    From what I understand /forums is not a page that ‘exists’, but I’ not comfortable modifying WP core. Any help would be appreciated…

    #208289
    nickds
    Participant

    Hi Clive, gyus from Divi helped me out to sort it:

    add the following CSS code to Custom CSS box in Divi > theme options > general settings:


    @media
    (max-width:980px) {
    div#bbpress-forums {
    overflow: visible !important;
    }
    }

    Maybe it will help you too.
    Nick

    #208263
    pyoil
    Participant

    If you are using SEO Yoast Plugin you can do the following to your functions.php to update the robots meta tags.

    
    function noindex_profile($html) {
      	if (bbp_is_single_user()){
    	  	$html = "noindex,nofollow";
    	} 
    	  return $html;
    }
    add_action( 'wpseo_robots', 'noindex_profile' ); 
    

    If you are not using any plugin or don’t see any robot tags to update in your userprofile, use the below instead and the insertion will be made in the head

    
    function noindex_profile() {
      	if (bbp_is_single_user()){
      	  	echo '<META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW” />' ;
      	}
    }
    add_action( 'wp_head', 'noindex_profile' );
    

    Hope this helps.

    #208247
    reedy
    Participant

    This is fantastic — I will definitely test this out.

    Am I right in thinking that the two times this line appears:

    if ($user_id == 57) $signature 'signature for user 57' ;

    Should actually read as:

    if ($user_id == 57) $signature = 'signature for user 57' ;

    domi80
    Participant

    Hi

    We’ve got an issue after upgrading bbPress to 2.6.x:

    The “latest reply” column on the forum index page isn’t showing the real latest reply. Instead, we see the latest reply as it was just before the upgrade to 2.6.x.
    None of the replies after the update are displayed.
    This happens only at the forum index, not on the sub forum index pages; the sub forum index page shows the right latest reply.

    The options to repair/recalculate didn’t correct the information in the “latest reply” column.

    We’ve seen this on 2.6.1 and 2.6.3.
    We did a downgrade to 2.5.14 twice, once after 2.6.1 and once after 2.6.3, we did every time the repair/recalculate, and we’ve got the column working good again with the right and expected “latest reply”.

    URL: http://www.lotgenotenseksueelgeweld.nl
    Note: It’s in Dutch localized.

    bbPress version now: 2.5.14
    We have the forum index built by using the shortcode [bbp-forum-index] .
    For the sub forums, we use the corresponding shortcode with the ID of the sub forum.
    WordPress version 5.3.2.
    PHP version 7.3.12.

    Anyone else having this situation? How did you get it solved?
    Or could this be a bug in the bbPress?

    Robin W
    Moderator

    try this

    add_action( 'bbp_template_before_user_profile', 'rew_add' ); 
    
    function rew_add () {
    	echo '<META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW” />' ;
    }
    #208234

    In reply to: Header Spacing

    natsu12345
    Participant

    NVM i found the code it does work , but i cant get the page ID to work correctly

    pyoil
    Participant

    Thanks for the quick reply and detailed steps @robin-w. Really helpful.

    Wondering if the Meta can be added through PHP instead of using a child theme?

    I use the Snippet plugin to add and keep track of code, so I don’t lose track of these customizations (and potential conflicts) in the future. So a PHP hook will be really useful.

    #208229

    In reply to: Header Spacing

    Robin W
    Moderator

    try this in the custom css area of your theme

    #bbpress-forums {
    	margin-top: 30px !important;
    }

    and adjust the 30px to suit

    Robin W
    Moderator

    of course this presume you have a child theme

    Functions files and child themes – explained !

    Robin W
    Moderator

    presuming ‘replace_text’ does the heavy lifting, then

    add_filter( 'bbp_get_reply_content',  ‘replace_text' ) ;
    add_filter( 'bbp_get_topic_content', ' ‘replace_text’ );
    
    with replace text looking like
    
    replace_text ($content) {
    //stuff to do the replacing....
    return $content ;
    }
    #208209
    Robin W
    Moderator

    untested but try

    add_filter( 'bbp_get_reply_content', 'rew_reply_signature', 1, 2 );
    add_filter( 'bbp_get_topic_content', 'rew_topic_signature', 1, 2 );
    
    function rew_topic_signature ($content = '', $topic_id = 0) {
    	$topic_id  = bbp_get_topic_id       ( $topic_id );
    	$user_id   = bbp_get_topic_author_id( $topic_id );
    	$separator = '<hr />' ;
    	$before = '<div class="bbp-topic-signature">' ;
    	$after = '</div>' ;
    	if ($user_id == 3) $signature =  'signature for user 3' ;
    	if ($user_id == 57) $signature 'signature for user 57' ;
    	if ( !empty( $signature ) )
    		$content = $content . $separator . $before . $signature . $after;
    	return apply_filters( 'rew_topic_signature ', $content, $topic_id) ;
    }
    
    function rew_reply_signature ($content = '', $reply_id = 0) {
    	$reply_id  = bbp_get_reply_id       ( $reply_id );
    	$user_id   = bbp_get_reply_author_id( $reply_id );
    	$separator = '<hr />' ;
    	$before = '<div class="bbp-reply-signature">' ;
    	$after = '</div>' ;
    	if ($user_id == 3) $signature =  'signature for user 3' ;
    	if ($user_id == 57) $signature 'signature for user 57' ;
    	if ( !empty( $signature ) )
    		$content = $content . $separator . $before . $signature . $after;
    	return apply_filters( 'rew_reply_signature ', $content, $reply_id) ;
    }

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

    Code Snippets

    #208200
    orangeturtle1000
    Participant

    Hi!

    When the forum sends out an email to members the email body contains   HTML code. Instead of adding a space between the two lines it ads &nbsp; . The reply looks normal on the forum page and on the backend.

    For example:

    This is a test message.

    &nbsp;

    This is a test message.
    &nbsp;

    &nbsp;

    Topic Link:…….
    ———–

    You are receiving this email because you subscribed to a forum.

    Login and visit the topic to unsubscribe from these emails.

    Thank you for your help!

Viewing 25 results - 3,151 through 3,175 (of 32,517 total)
Skip to toolbar