Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,926 through 1,950 (of 32,522 total)
  • Author
    Search Results
  • #218521
    kjah456
    Participant

    Hi Community,

    I would like to insert a specific topic of a forum into a page via shortcode, but without a long list of replies. Is there a shortcode option to show this specific topic, but with a “more” button to see all the replies or with a definied amount of replies?
    I hope you get what I mean.

    Best regards!

    #218503

    In reply to: Topic/Reply Form

    This is the default behavior of bbPress. Unless a plugin already provides a simple modification of this behavior, the easiest way to customize this would be by overriding the /bbpress/form-reply.php template part in your WordPress child theme.

    #218483
    purityboy83
    Participant
    
                $hitCount = (int)$hitCount + 1;
    

    When I check again, I think I can only correct that part

    Thanks~!

    #218481
    purityboy83
    Participant

    Hi~!

    Thanks for the guide
    I tried to fix it because it didn’t work
    I finally solved the problem through your idea

    
    (int)$hitCount = get_post_meta($post_id, 'bbp_svc_viewcounts', true);
    (int)$hitCount = (int)$hitCount + 1;
    

    hahahah , integer hard cording

    problem clear ^^;;;

    Best Regards,
    Hyunho

    #218478
    Robin W
    Moderator

    “Health Check & Troubleshooting” This plugin is very useful

    yes, I only found that plugin a few months ago – it is good 🙂

    given that the simple counts plugin is not being maintained, there seems no reason why you should not just alter it.

    The problem is that it is seeing the value retrieved from the database as a string, so we need to convert it to an integer

    so try changing line 94

    from

    $hitCount = get_post_meta($post_id, 'bbp_svc_viewcounts', true);

    to

    $hitCount = int (get_post_meta($post_id, 'bbp_svc_viewcounts', true));

    #218477
    purityboy83
    Participant

    hi @robin-w

    i found problem root cause

    “bbPress Simple View Counts” was the problem.

    “Health Check & Troubleshooting” This plugin is very useful
    Troubleshooting Mode is very good And a log was also left.

    
    ### Nginx Log
    2021/02/18 00:35:57 [error] 13752#13752: *888 FastCGI sent in stderr: "PHP message: PHP Fatal error:  
    Uncaught TypeError: Unsupported operand types: string + int in /source/wp-content/plugins/bbpress-simple-view-counts/bbpress-simple-view-counts.php:95
    Stack trace:
    #0 /source/wp-includes/class-wp-hook.php(289): bbpress_simple_view_counts->show_views_topic_page()
    #1 /source/wp-includes/plugin.php(212): WP_Hook->apply_filters()
    #2 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3348): apply_filters()
    #3 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3278): bbp_get_single_topic_description()
    #4 /source/wp-content/plugins/bbpress.new/templates/default/bbpress/content-single-topic.php(33): bbp_single_topic_description()
    #5 /source/wp-includes/template.php(732): require('/source...')
    #6 /source/wp-content/plugins/bbpress.new/includes/core/template-functions.php(103): load_template()
    #7 /source/wp-conten" while reading response header from upstream, client: 192.168.0.1, 
       server: fedora.h2code.cf, request: "GET /forums/topic/23118 HTTP/2.0", 
       upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "site.name"
    
    ### PHP-FPM Log
    [pool www] child 13731 said into stderr: "NOTICE: sapi_cgi_log_message(), line 611: PHP message: PHP Fatal error:  
    Uncaught TypeError: Unsupported operand types: string + int in /source/wp-content/plugins/bbpress-simple-view-counts/bbpress-simple-view-counts.php:95"
    
    [pool www] child 13731 said into stderr: "Stack trace:"
    [pool www] child 13731 said into stderr: "#0 /source/wp-includes/class-wp-hook.php(289): bbpress_simple_view_counts->show_views_topic_page()"
    [pool www] child 13731 said into stderr: "#1 /source/wp-includes/plugin.php(212): WP_Hook->apply_filters()"
    [pool www] child 13731 said into stderr: "#2 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3348): apply_filters()"
    [pool www] child 13731 said into stderr: "#3 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3278): bbp_get_single_topic_description()"
    [pool www] child 13731 said into stderr: "#4 /source/wp-content/plugins/bbpress.new/templates/default/bbpress/content-single-topic.php(33): bbp_single_topic_description()"
    [pool www] child 13731 said into stderr: "#5 /source/wp-includes/template.php(732): require('/source...')"
    [pool www] child 13731 said into stderr: "#6 /source/wp-content/plugins/bbpress.new/includes/core/template-functions.php(103): load_template()"
    [pool www] child 13731 said into stderr: "#7 /source/wp-conten..."
    

    “bbPress Simple View Counts” This plugin is out of date.
    I’ll try to disable it and think more about what to do.

    Thank you again

    Best Regards,
    Hyunho

    anhduc.bkhn
    Participant

    I just test, it worked on my new testing:

    
    WordPress version: 5.5.3
    WooCommerce version: 4.4.1
    
    On WP 5.5.3, It could call to bsp_test_email function ( includes/functions_email.php)
    
    On WP 5.6, It could not call to  bsp_test_email function ( includes/functions_email.php)
    
    #218429
    neon67
    Participant

    There are many plugins to allow approve a new user by moderator.

    But, Is there a simple solution to do the same by editing function.php? Without new plugin?

    Thank you in advance

    #218423

    In reply to: List Of Shortcodes

    flamuren
    Participant

    I have you eminent plug in and love it already 🙂 And already checked the shortcodes there. However there is only a shortcode to add a button/text to press that links to the profile. I would love a shortcode as the [bbp-forum-index] but for example [bbp-forum-profile]. Cant find any but maybe there is non?

    #218422

    In reply to: List Of Shortcodes

    Robin W
    Moderator

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>shortcodes

    #218421

    Topic: List Of Shortcodes

    in forum Themes
    flamuren
    Participant

    How come I cant find a shortcode for the bbpress user profile?

    #218408
    uksentinel
    Participant

    This is the plugin for using shortcodes in menu – hope this helps ?

    Shortcode in Menus

    #218398
    WWW_Marieke
    Participant

    Thanks for your quick answer!

    That shows the text ‘my profile’ and when you click on it, you go to your profile.

    Screenshot: https://prnt.sc/zpyin3

    The profile URL = https://despelletjesvrienden.nl/forums/users/xxx (xxx = username) so I can’t use that URL.

    Could you tell me: how can I add a shortcode to the menu? Since it’s not an URL.

    (I still prefer to put the profile in my other page as a part of the page.)

    #218397

    In reply to: Reply order?

    Robin W
    Moderator

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    function change_reply_order() {
    $args['order'] = 'DESC';
     return $args;
    }
    add_filter('bbp_before_has_replies_parse_args', 'change_reply_order');
    #218395
    uksentinel
    Participant

    Does the [bsp-profile] shortcode not work if placed upon a page and is already logged in ?

    I am using the [bsp-profile] shortcode via a menu option, as simpler for users to see and use and can be hidden if user is not logged in etc ?

    #218391
    WWW_Marieke
    Participant

    Is there a shortcode that show the profile instead of linking to the profile?
    A shortcode that I can add to a page, so viewers can go to that page and view their profile?

    I added [bsp-profile label=’Bekijk mijn profiel’] to this page but I would like to just show the profile on this page because the url/shortcode looks kinda hidden.

    Forum dashboard

    (I googled a lot to fix this but this topic was the best I could find so far.)

    #218370
    dogwomble
    Participant

    Hi there,
    I’m trying to work out what’s actually going on here.
    Whenever any person (including myself as keymaster) inserts a link, it is stripped from the post when it gets displayed. All othe formatting seems to make it through.
    I have added the following code to the theme’s functions.php to try and enable this functionality:

    add_action( 'bbp_kses_allowed_tags','pyg_kses_allowed_tags',999,1);
    function pyg_kses_allowed_tags($input){
            return array(
    
                            // paragraphs
                    'p' => array(
                            'style'     => array()
                    ),
                    'span' => array(
                            'style'     => array()
                    ),
    
                    // Links
                    'a' => array(
                            'href'     => array(),
                            'title'    => array(),
                            'rel'      => array()
                    ),
    
                    // Quotes
                    'blockquote'   => array(
                            'cite'     => array()
                    ),
    
                    // Code
                    'code'         => array(),
                    'pre'          => array(),
    
                    // Formatting
                    'em'           => array(),
                    'strong'       => array(),
                    'del'          => array(
                            'datetime' => true,
                    ),
    
                    // Lists
                    'ul'           => array(),
                    'ol'           => array(
                            'start'    => true,
                    ),
                    'li'           => array(),
    
                    // Images
                    'img'          => array(
                            'src'      => true,
    
                            'border'   => true,
                            'alt'      => true,
                            'height'   => true,
                            'width'    => true,
                    )
    
            );
    }

    I have tried to find other documentation to try and work out why this is occurring and have drawn a blank. Anybody have any other suggestions?

    #218361
    purityboy83
    Participant

    Hi

    I use wordpress + bbpress

    For example, i need to write a query statement(mysql) on a topic.
    ex)
    selectid,numberfrom tab

    When an grave accent is entered, the [code] tag is automatically inserted.

    ref img : https://ibb.co/9bhG177

    I want it to be typed exactly as you type it.
    So I want to disable the function for the code tag.

    I need your help and support

    Best Regards,
    Hyunho

    #218353
    Robin W
    Moderator

    put this in your custom css to remove the background

    .bbp-author-link {
    	background: none !important;
    }
    #218339
    Robin W
    Moderator

    @newest the issue relates to how gutenberg does an update – it uses AJAX rather than refresh the post, so the initial settings are not seen, and the post considers the update as a new publish.

    I’ll need to work on some code to fix

    #218307
    Robin W
    Moderator

    great, and yes please post the completed functioning code once you have got it working !!

    #218306
    athep
    Participant

    I set $forum_id = bbp_get_forum_id() ;

    and change these two

    if (!empty ($prev_id) && wp_get_post_parent_id($prev_id) == $forum_id) {

    and

    if (!empty ($next_id) && wp_get_post_parent_id($next_id) == $forum_id) {

    Notice the equal sign, that solved the problem!

    Thank you so much Robin!

    EDIT:

    The last topic links in every forum somehow get left behind, only the last ones.. I’ll tinker around and post my findings

    #218304
    Robin W
    Moderator

    hmmm…not sure about the ‘leak in’ bit, how are lines being displayed if $prev etc. is blank?

    you could add a check

    so set

    $forum_id = bbp_get_forum_id() ;

    above the while statement and then check at the appropriate point

    if (wp_get_post_parent_id($prev_id)  != $forum_id) {
    etc.
    }
    #218303
    athep
    Participant

    Thank you Robin,

    I tried this, I was inserting this in single-topic.php so I was not sure which one would work.

    $topic_id = bbp_get_topic_id() ; works well, the only issue is that once it nears the end, the other forums start leaking in, if prev or next is empty they leak in

    Otherwise it’s working as expected, also I fixed if ($cur == $topic_id) { to if ($cur_id == $topic_id) {

    #218302
    Robin W
    Moderator

    just had a quick look

    this should get you close, totally untested !!

    <?php $args = array( 'post_type' => 'topic', 'post_parent' => bbp_get_forum_id() ); 
    $loop = new WP_Query( $args );
    //get the current topic id or maybe depending in where you are putting this - bbp_get_reply_topic_id or bbp_get_reply_id()
    $topic_id = bbp_get_topic_id() ;
    while ( $loop->have_posts() ) : $loop->the_post(); 
    	$cur_id = get_the_ID();
    	if ($cur == $topic_id)  {
    		$prev = get_previous_post() ;
    		$prev_id = $prev->ID ;
    		$next = get_next_post();
    		$next_id = $next->ID ;
    	break ;
    	}
    endwhile;
    //so you now have $cur_id, $prev_id and $next_id
    //so create 3 lines
    if (!empty ($prev_id)) {
    	$permalink = get_permalink($prev_id) ;
    	$title = get_the_title ($prev_id) ;
    	echo '<a href="'.$permalink.'">'.$title.'</a>' ;
    }
    if (!empty ($cur_id)) {
    	$permalink = get_permalink($cur_id) ;
    	$title = get_the_title ($cur_id) ;
    	echo '<a href="'.$permalink.'">'.$title.'</a>' ;
    }
    if (!empty ($next_id)) {
    	$permalink = get_permalink($next_id) ;
    	$title = get_the_title ($next_id) ;
    	echo '<a href="'.$permalink.'">'.$title.'</a>' ;
    }
    ?>
Viewing 25 results - 1,926 through 1,950 (of 32,522 total)
Skip to toolbar