Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,026 through 3,050 (of 32,517 total)
  • Author
    Search Results
  • #209608
    Mohamad Zidani
    Participant

    No there is an other topic but its not showed, i can see it in wp-admin.

    This https://infocontact.ma/communaute/t/evenements-sur-casablanca/

    #209606
    Mohamad Zidani
    Participant

    https://infocontact.ma/communaute/f/beaute-mode/

    #209605

    In reply to: writing to contents

    Robin W
    Moderator

    code that works is never bad !!

    thanks for posting the final solution, and great that it works !

    #209604

    In reply to: writing to contents

    Clivesmith
    Participant

    Just to update, all seems to be working so I thought I would share this. I am sure the coding is bad but it works !!
    I am the only one that can create topics, I moderate all replies and want to add to the end of each reply ‘#plasticfree’ and a custom metadata value for each topic that I put in when I create a topic.
    This means that the hashtag and twitter name goes out with the RSS feed to tiwtter etc.
    Thank you Robin for all your help.

    /***   
    To add #plasticfree and twitter name to reply
    ***/
    
    function waa_content( $content, $post_id ){
    	// get the topic id 		
    	$post_id = get_the_ID();
    	$reply_topic_id = bbp_get_reply_topic_id( $post_id );
    	// get value from table
        $twitname = get_post_meta( $reply_topic_id, 'bbp_twitname', true );
    	$twithash = '#plasticfree';
    
    	$post = get_post($id);
    
    if ($post->post_type =='reply'){
    $pos = strpos($content, '#plasticfree');
    
        if ($pos == false) {
    		$content .= '<br>'. $twithash .' ' .$twitname;
        } 
    }
    	return $content;
    }
    add_filter( 'content_edit_pre', 'waa_content', 10, 2 );
    
    #209603

    In reply to: writing to contents

    Robin W
    Moderator

    the $post array does not exist in this function

    try

    if (get_post_type ($post_id) == bbp_get_reply_post_type() ) {

    #209599

    In reply to: writing to contents

    Robin W
    Moderator

    try this

    function waa_content( $content, $post_id ) {
     $extra_text = 'hello' ;
    //append extra text to the end of reply content
    $content.= $extra_text ;
    return content ;
    }
      
    add_filter( 'content_edit_pre', 'waa_content', 10, 2 );
    #209598
    Manuel Camargo
    Participant

    Is it possible to apply the post moderation just to certain flagged users?
    I see that this is possible by keywords:

    Moderation and BlackListing

    But cannot find any specific info regarding users.

    #209587
    Robin W
    Moderator

    add this to the custom css of your theme

    #bbp_stats_widget-2 dt {
    float : left  ;
    }
    
    li#bbp_stats_widget-2.widget-container.widget_display_stats dl dd strong {
    padding-left : 10px ;
    }
    
    li#bbp_stats_widget-2.widget-container.widget_display_stats dl dd {
    margin-bottom : 5px ;
    }

    you can adjust the number in margin-bottom : 5px ; to get the separation between lines that you want

    #209586
    mattiejas
    Participant

    I have the same problem on my website also with bbPress 2.6.4 and BuddyPress 5.1.2. @robin-w Thanks for the suggested fix. Unfortunately, inserting your code into my child theme’s functions.php did not fix the problem for me.

    #209583

    In reply to: Managing too long URL

    webcreations907
    Participant

    How about the below?

    
    
    #bbpress-forums div.bbp-reply-content a, 
    #bbpress-forums div.bbp-topic-content a{
    	word-wrap: break-word;
    }
    
    
    #209571

    In reply to: writing to contents

    Robin W
    Moderator

    something like this should do it

    add_filter( 'bbp_new_reply_pre_content', 'my_function'  );
    
    function my_function ($reply_content) {
    $extra_text = 'hello' ;
    //append extra text to the end of reply content
    $reply_content.= $extra_text ;
    
    return $reply_content ;
    }
    #209570
    kasperdalkarl
    Participant

    I actually found a solution by trying some stuff out.

    Go to this file: …/wp-content/plugins/bbpress/includes/common/formatting.php

    And at the bottom of that file, add this:

    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,
    		)
    	);
    }
    #209565
    kasperdalkarl
    Participant

    Thanks for posting this. I installed the plugin, and added

    			// Paragraph
        	'p'          => array(
        	    'class'    => true,
            	'style'    => true,

    But sadly I still get this in cleartext:
    <p style=”text-align: center;”>Test 3</p>

    Any suggestions? Thanks!

    #209563
    kasperdalkarl
    Participant

    Hi!

    I was wondering if anyone knows how to allow users to align text in posts/threads?
    Right now it just comes out as raw code text:
    <p style=”text-align: center;”>Test test test</p>

    I have been trying to mess a bit in /wp-content/plugins/bbpress/includes/common/formatting.php but to no success. Does anyone have a suggestion on how to allow p style and text alignments?

    Thank you!

    #209547
    WorldWideWebb
    Participant

    OK – implemented a fix that seems to be working (time will tell). Hope this helps someone else:

    The issue was indeed the redirect that happens when you click the reply links. The fix was to trap the default behavior of those links (using preventDefault so that the link is not followed), so added that to the link output. In the following file on line 1612:

    bbpress/includes/replies/template.php

    Change the line to this:

    $onclick = ' onclick="event.preventDefault(); return addReply.moveForm(\'' . implode( "','", $move_form ) . '\');"';

    #209510
    Robin W
    Moderator
    #209492
    AnnieBVT
    Participant

    I have been spending way too much time on trying to change the text editor for bbPress forums. Members should not be expected to know how to use html (which most don’t), and many will post text from other websites into a text box. I don’t understand, after so many updates to the bbPress core and so many questions in your Support forum about it, that this issue has not been resolved.

    I added code recommended on the bbPress site in the child theme functions.php for my site, added TinyMCE Advanced, and searched for a checkbox in Forums Settings to enable a fancy editor. That checkbox is not in the list of options on my site. And all I see in the text editor for topic replies is the html buttons. Could someone please help us with fixing this issue. The plugin recommendations on this support forum are from many years ago, and those recommended plugins are out of date, no longer being updated, or cause problems for sites when installed.

    I would really appreciate assistance. Thanks.

    #209471

    Topic: Recent Topics

    in forum Troubleshooting
    iamthewebb
    Participant

    Hi,

    On the front page of this site there is a Recent Topics box that only shows 5 topics, how do I replicate this on my own site? I can only see a shortcode that displays 15.

    Thanks

    #209469
    Robin W
    Moderator

    no need to change them – they are only names, although you could change

    add_action('bbpress_daily_event', 'bbpress_close_old_topics');

    to

    add_action('bbpress_daily_event', 'bbpress_delete_old_topics');

    and

    function bbpress_close_old_topics() {
    	// Auto close old topics

    to

    function bbpress_delete_old_topics() {
    	// Auto delete old topics

    which would just make it clearer what it was doing – but not necessary !!

    #209468
    writersabroad
    Participant

    Robin, sorry another quick question do I have to replace all references to ‘close’ with ‘delete instead in the other sections of the code? e.g in this one

    add_action(‘bbpress_daily_event’, ‘bbpress_close_old_topics’)

    Thanks… sorry I’m not more up on this kind of thing…

    boomer48
    Participant

    Thanks for the tips. I did the right click and it clearly showed the #ccc color code. I didn’t realize that this was loading from the browser cache. I’m used to programming microcontrollers, not websites. Cleared the browser cache on all my web browsers and now the closed link stays black.

    Robin W
    Moderator

    Not sure what you would see other than a grayed out post.

    lots of front end tools we can use to see what is happening, which we can’t with pictures.

    My real question is why manually editing the color code in the CSS files doesn’t have any effect.

    could be loads of things, including caching as Chuckie says, theme and child theme issue or other things.

    #209429
    writersabroad
    Participant

    Thanks, Robin. One last question 🙂 If I want it to delete topics I presume I change the code

    bbp_close_topic( $topic_id );

    to

    bbp_delete_topic( $topic_id );

    A lot of the posts I want to get rid of have images so trying to clean up and free space… thanks again!

    #209428
    Stephen Ekpa
    Participant

    Wow…Thanks for these code.
    I tested it on my test site with newmag wordpress theme by tagdiv and it worked.
    But on the main site, I’m using Jnews Child theme. I tried it, but it did not work. Perhaps it because I don’t know which function.php to use; main theme or child theme funtion. Tried with child theme, but it did not work.

    boomer48
    Participant

    It’s a private website for our HOA so I would need to change it to public to make the link work. Not sure what you would see other than a grayed out post. The settings for the post are “Super Sticky” and “Closed”. Simple plain text.

    My real question is why manually editing the color code in the CSS files doesn’t have any effect. I have deleted the forum, deactivated bbpress, activated bbpress, and created a new forum. Shouldn’t that pick up the changed CSS files? My host is Bluehost if that makes any difference.

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