Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,301 through 3,325 (of 32,481 total)
  • Author
    Search Results
  • #206146
    Pascal Casier
    Moderator

    @kent25 It’s not because things are not in the basic code that you cannot do it. bbPress is very flexible and open to extensions. See the response in https://bbpress.org/forums/topic/how-to-fix-old-topic-moving-to-first-topic-when-a-reply-is-made/

    #206143
    Chuckie
    Participant

    Add this to your child theme functions.php or use a snippet plugin:

    // ==============================================================
    // Switch off bbPress Forum moderation
    add_filter( 'bbp_bypass_check_for_moderation', '__return_true' );
    // ==============================================================
    Barry
    Participant

    I imagine somewhere in these forums there must be an example of code that will help with this, though my own initial search let me down. Even so, it’s certainly possible to do and here is a minimal example of the sort of code you could use:

    https://gist.github.com/barryhughes/1d52e7562e5d2e6f5121981a4babdd36

    To meet your individual needs it may need refinement or adjustment (every site is different, there could be factors for you, locally, that I don’t know about). It’s just a starting point.

    For those who might be tempted to use this but are unfamiliar with code in general, note that if you do copy this code to an existing file, such as your theme’s functions.php file, then you don’t need to copy the opening “<?php” tag—just place it somewhere after the existing tag in whichever file you are editing.

    kent25
    Participant

    Am really new to bbpress, How do i fix an old topic becoming a first topic when a member makes a reply on it?

    i my forum, there are different topics made by members, on daily bases but i found out that when a new member replies to an old topic, that topic automatically moves to the top of other new topics…
    this is a pain. pls is there a code to stop this, i don’t need plugins for it.

    #206069
    rederis
    Participant
    function new_forums_notice_to_menu($items, $args) {
    	 if(count_new_forum_posts() > 0){
              if( $args->theme_location == 'primary' )
              $items .= '<li><a href="http://***/forums/" text-transform="lowercase" text-shadow="2px 1px 2px black"><font color="red">Šios savaitės naujos žinutės forume: <span>'.count_new_forum_posts().' ('.count_new_forum_post_time().')</span></font></a></li>';
         return $items;

    I try to hook up to my menu (later on exact menu element “Forums” ) to print “There is (count_new_forum_posts()) new posts this week”

    My head menu should be Home Personel Phones Forum (2) News. But now there is problem only with replies count. I think there is problem with my query ‘key’ => ‘_bbp_last_active_time’ cant be assosiated with ‘replies’ data only with ‘Topics’. I am very green on programming so strugling. I already fixed kinda problem by adding (last reply date – current date time diference).

    #206064
    Robin W
    Moderator

    I’ve looked further at the code, and yes my translation won’t work for time.

    I am just a bbpress user who helps out on this forum, so I cannot say when the devs will complete the translations.

    #206049
    Chuckie
    Participant

    This is why I have switched off moderation:

    // Switch off bbPress Forum moderation
    add_filter( 'bbp_bypass_check_for_moderation', '__return_true' );

    Add that to your child theme functions.php or a snippet.

    #206043

    In reply to: Private forums

    brunov99
    Participant

    Hi Robin;
    you’re absolutely right and I did it but

    1) I have a very complex environment (Buddy Groups, Private and public stuff …)

    2) I wanted to be certain of my results so as not to have to start the whole structure again in case of error

    3) finally make everyone benefit from this answer.

    So for me the sub-forums of a private forum are private by default (but, I will still mark them private jus in case)

    Note: I also think that it is information that could be added in the bbPress codex.

    Thank you for answering.
    bV

    #206030
    Robin W
    Moderator

    this is because 2.6 has changed some wording and context, and the new translations have not been made yet

    to fix the above either use this

    add_filter(  'gettext',  'rew_bbpress_translate', 20 , 3  );
    add_filter(  'ngettext',  'rew_bbpress_translate' , 20 , 3 );
    
    function rew_bbpress_translate( $translated, $text, $domain ) {
    	if ($domain == 'bbpress') {
         $words = array(
                            
                            '%s day' => '%s jour',
    						'%s days' => '%s jours',
    						'Last Post' => 'Dernier message',
                 );
         $translated = str_replace(  array_keys($words),  $words,  $translated );
    	}
         return $translated;
    }

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

    Code Snippets

    or use the translations tab in my style pack plugin

    bbp style pack

    #206023
    Robin W
    Moderator

    ok, that may well be beyond free help, but what is doing that print out – nothing in your code send any of that to screen

    #205984
    Chuckie
    Participant

    Awesome indeed. I did not put two and two together. But then I noticed what it said on the screen:

    Customise your Forums root. Partner with a WordPress Page and use Shortcodes for more flexibility.

    Doh!

    #205978

    Caching plugins misbehaving could definitely contribute to problems in a lot of areas.

    Private and Hidden forums also do work a little bit strangely, especially without BuddyPress Groups on top of them to manage them a bit better, and especially when you have a mix of public and private within the same branch of a forum tree.

    Imagine, if you will:

    Public 1
    |--Private 1
    |--|--Public 2
    |--Public 3

    Now, I login and create a Topic in the Private 1 forum.

    How should that bubble up to the parent Public 1 category?

    Then someone creates a topic in the Public 2 forum. How can a public forum even exist under a private forum?

    bbPress won’t prevent you from doing these things, but it won’t really work very well when you do.

    I think, to work best, we could never cache these values ever, because they’d always be based on what the currently logged in user can see, instead of being attached to the forums or the categories like they always have been.

    But for now, for performance reasons, these Freshness values are working as intended, even though they aren’t a real great experience for Private and Hidden Forums underneath other Public ones.

    #205974
    Chuckie
    Participant

    Thanks. But I am not sure what you are suggesting I do?

    When I started out setting up bbPress I understood I had to create a page to list the forums. So I created a page (support-forums) and inserted this shortcode:

    [bbp-forum-index]

    Are you telling me I don’t actually need this page on my website or need to use this shortcode? #confused

    #205973

    I don’t really understand why you need 2 separate pages for your forums.

    If you create a page that matches the slug for your forum root, it will use that page instead, as well as the title.

    Then, you can use bbPress shortcodes to fill in the content.

    This is what we do here on bbPress.org, and it works pretty well.

    #205964
    Chuckie
    Participant

    Thanks for the suggestion. I have added the code, and got into private browser mode. And the same results sadly.

    #205963
    Robin W
    Moderator

    ok, so it is not that function.

    you could try just adding this to your child theme functions file

    remove_filter( 'bbp_new_reply_pre_content', 'bbp_filter_kses', 40 );

    let me know if that works

    #205953

    In reply to: Footer issues

    Robin W
    Moderator

    it is theme related

    the non forum pages have

    .social-navigation a {
    	border-radius: 40px;
    	display: inline-block;
    	height: 40px;
    	margin: 0 1em 0.5em 0;
    	text-align: center;
    	width: 40px;
    }

    the forum pages have an additional css class of .no-svg

    .no-svg .social-navigation a {
    	height: auto;
    	width: auto;
    }

    this needs removing, but I cannot say what you need to do to remove it – maybe a page thing

    #205952
    Chuckie
    Participant

    This is the full function:

    
    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(
    			'dir'    => 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,
    		),
    		'video'      => array(
    			'controls' => true,
    			'width'    => true,
    			'height'   => true,
    			'source'     => array(
    				'src'    => true,
    				'type'	 => true
    			)
    		)
    	);
    } 
    

    if I introduce source into the top level then the source inside the video tag gets stripped completely from the output. So I can’t do that. I think bbPress needs tweaking to stop escaping the video tag content. Some how. For not admin.

    #205950
    Robin W
    Moderator

    ok, so path wise it counts.

    on the <source> issue, less certain how to resolve. the code above looks like it should work, but you might need to add source as a top level as well

    if you need help with that, give me the entire function above

    #205948
    Robin W
    Moderator

    last active time on a topic would pick up if there had been replies.

    I loaded your code onto my site, and it worked fine.

    I’m not sure what other help you want

    1. topic will do what you want, it is saying that there are new topics within the period
    2. I don’t understand this question, works fine on my test site]
    3. yes it is counting any new topics or topics where there have been new replies – is that nit what you want?

    #205947
    Chuckie
    Participant

    I am using the TinyMCE Insert Video plugin. I paste the URL into that. It works fine for admin. It is only non-admin.

    My functions.php has some tags added to the array defined in here:

    add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' );

    Snippet:

    		'video'      => array(
    			'controls' => true,
    			'width'    => true,
    			'height'   => true,
    			'source'     => array(
    				'src'    => true,
    				'type'	 => true
    			)
    		)

    There must be a way for me to allow those without escaping for non-admin.

    The path begins https.

    #205945
    Chuckie
    Participant

    @robin-w

    I am struggling with your other request. Something isn’t right. I have moderation still switched ON …

    If I try to insert a video (only one video) as a non-admin and hit enter the video won’t play. When I edit the post the content looks like this:

    <video controls="controls" width="300" height="150">
    **source src="pathtovideo/pts-test-video.mp4" type="video/mp4" /**</video>

    bbPress has escaped the < and > symbols.

    If I log back in as admin and perform the same task. I get a functional video link:

    <video controls="controls" width="300" height="150">
    <source src="pathtovideo/pts-test-video.mp4" type="video/mp4" /></video>

    I know it is a side issue but I don’t understand how to fix that and until I do I can’t complete the testing you wanted.

    #205942
    Chuckie
    Participant

    @robin-w I can confirm that:

    add_filter( 'bbp_bypass_check_for_moderation', '__return_true' );

    switches off moderating because I was able to insert 5 images as a normal user. So that is one item ticked off the list – how to switch off moderation.

    I will now check the other.

    #205939
    thierrytregaro
    Participant

    Thanks for the time/code but closed bbpress this morning and moved to discourse. Lost the perfect integration with wordpress but this is a way more convenient way for me to handle a community maybe too big for bbpress

    #205938
    Robin W
    Moderator

    If you want to remove moderation, I think this will do it

    add_filter( 'bbp_bypass_check_for_moderation', '__return_true' );

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

    Code Snippets

    If someone could test and report back, that would be useful. I have no time availability to do this 🙂

Viewing 25 results - 3,301 through 3,325 (of 32,481 total)
Skip to toolbar