Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,826 through 1,850 (of 32,448 total)
  • Author
    Search Results
  • #218626
    Robin W
    Moderator

    oops sorry should read

    $forum_id = bbp_get_topic_forum_id()
            if((!bee_catch_image() == '') && $forum_id == '12345'){

    == being compare

    #218625
    purityboy83
    Participant

    Hi @robin-w

    echo (bbp_topic_permalink().'">

    Is there a way to set forum_id here?

    Thanks for always help

    #218624
    purityboy83
    Participant

    Hi @robin-w

    You who always help are probably an angel.

    I followed your advice and modified the code
    However, thumbnails are displayed on all forums topic….

    Thanks~

    #218623
    Robin W
    Moderator

    probably

    $forum_id = bbp_get_topic_forum_id()
            if((!bee_catch_image() == '') && $forum_id = '12345'){
    #218622
    purityboy83
    Participant

    Hi

    I want the thumbnail to appear on the topic
    Search results found a plugin similar to the function I’m hoping for

    bbpress-topic-thumbnails
    https://wordpress.org/plugins/bbpress-topic-thumbnails/

    I want to add one more feature in this plugin.
    With this plugin, thumbnails of all forum topics are displayed

    I only want to use this feature for 1 specific forum
    reason for write topic is because the plugin has not been updated for a long time.

    So I ask for help here

    code is

    
    /*Hooks into the loop-topic.php output to print image*/
    add_action( 'bbp_theme_before_topic_title', 'bee_insert_thumbnail' );
    function bee_insert_thumbnail() {
    
            if((!bee_catch_image() == '')){
            echo('<a href="'); 
        echo(bbp_topic_permalink() . '"><img class="bbp-topic-thumbnail"  width="100%" style="max-width: ' . get_option('thumbnail_size_w') . 'px; max-height: ' . get_option('thumbnail_size_h'). 'px; vertical-align:middle;" src="' . bee_catch_image() . '"/>' .'</a>');
            }
    }
    
    /*Function that retrieves the first image associated with the topic*/
    function bee_catch_image() {
      global $post, $posts;
      $first_img = '';
      ob_start();
      ob_end_clean();
      $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
      $first_img = $matches [1] [0];
      return $first_img;
    }
    

    Anyone can help?
    Thanks

    #218620
    Robin W
    Moderator

    for ‘Follow this link to join the discussion’ – you are welcome to style it as a button if you wish

    go to

    dashbaoard>settings>discussion and change

    Follow this link to join the discussion

    to

    <div class="myButton">Follow this link to join the discussion</div>

    you can then style a button, if you don’t know how go to

    https://www.bestcssbuttongenerator.com/

    #218600
    st11
    Participant

    I am trying to create a custom role that can only reply to existing topics.

    I followed this to create new role. At first, the role did appear in dropdown list in admin edit user screen, but after saving, it went back to “— No role for these forums —”.

    I found this thread, so.. I created custom WordPress role in the same name. This made the bbPress role to be “saved” but it doesn’t seem to add capabilities. The user with this role can’t see forum or topics.

    How can I get this custom bbPress user role to have custom capability?

    WordPress 5.5, bbPress 2.6.6

    #218557
    xprojectsx
    Participant

    I know this is an old thread but it is about the most useful on this issue but unfortunately did not solve my problem. (I got zero results returned in the TMP table) I wanted to point out however in case it is useful for anyone else, that in step 3 of @giobby post above there seems to be some extraneous text in there.

    these three lines:

    wp_posts.post_excerpt, 
    pescasubac, 
    wp_posts.quea.wp_posts.post_status, 

    I believe should be:

    wp_posts.post_excerpt, 
    wp_posts.post_status, 

    pescasubac doesn’t seem to refer to anything and “wp_posts.quea” also is not a thing. All of the other fields in wp_posts are accounted for without those two items.

    #218555
    Robin W
    Moderator

    So have you got the shortcode [bbp-forum-index] in that page?

    #218554
    einar2507
    Participant

    Ok, thanks and sorry for my frustration – my bad! You write “In essence the forum root slug simply needs to match the permalink of the page where you have put the shortcode on, then it all works.”

    That is not correct. Just take a look at my page https://fakta360.no/forums/forum/folkeopproret-mot-klimahysteriet/ and then click on the breadcrumbs. At he moment the page name and forum rot do not match but it works, and only the breadcrumbs goes wrongly to the “forums” root page that dont exists. If I change the page slug to match the forum rot, then nothing displays except the text “Forums”.

    #218552
    Robin W
    Moderator

    writing threads that complain about free software offered with free support is not the way to get your problem fixed – so I deleted that one as it serves no purpose.

    In essence the forum root slug simply needs to match the permalink of the page where you have put the shortcode on, then it all works.

    #218548
    einar2507
    Participant

    I also find out that if I have the Forum page named “Forum” with slug “forum” and the Forum rot=”forums” then the shortcode works but the breadcrumbs points to the “forums” root and does therefore not display any forum. Only the text “formum” with at random link it seems to me.

    Forum

    #218547
    einar2507
    Participant

    Now I see that I get the same result when I use the shortcode or not in the https://fakta360.no/forums/ page. The shortcode [bbp-forum-index] has no effekt.

    #218541

    In reply to: List Of Shortcodes

    Robin W
    Moderator

    Is there no way I could add the profile as I did with the forum index? It was super easy just using [bbp-forum-index]

    – no, the way profiles work doesn’t easily lend to that 🙂

    1. Go to

    bbp-add-menu-profile-item

    and download the plugin to your computer – make a note of where you saved it !

    2. on your website go to dashboard>plugins>add new>upload plugin and browse to the file you downloaded in 1. above
    3. Install and Activate
    4. If you already have a page called ‘Profile’ then make sure this has the permalink ‘profile’
    5. If not then create a page called ‘Profile’ and make sure it has the permalink ‘profile’
    6. in the content of the profile page put something like

    ‘You need to be logged in to see your profile’ – you can add the bbpress login shortcode in here as well if you wish ie [bbp-login]

    The above is what will show to people who click the profile menu item who are not logged in

    Save the page and exit

    7. In Dashboard>appearance>menu’s add the profile page to the menu you want to.

    now you will have ‘Profile’ showing as the menu item, and if clicked and logged in you will go to your profile page, if not logged in, you will see the content above.

    #218537

    In reply to: List Of Shortcodes

    Robin W
    Moderator

    @flamuren great – do you want it as code to out in your child theme functions file or a baby plugin?

    #218532
    einar2507
    Participant

    Hi.
    /Forum/ or /Forums/ ???

    After installing bbpress I created a page “Forum” with the shortcode [bbp-forum-index]. I made a menu with a link to that “Forum” page. All fine and the forum index listed.

    But when I go in to a forum and the click on the breadcrumbs “Forums” to get back, I land on a blank page with the text “Forums” ???
    I have also tried to make a page Forums with shortcode [bbp-forum-index] but that does not change anything.
    I dont understand this and what I do wrong?
    Here is my two pages where first is ok, but breadcrumbs lead to second with error.

    Forum


    https://fakta360.no/forums/

    #218527

    In reply to: New posts freezing

    Robin W
    Moderator

    @mike80222 Mike – saw that thread, but buried in paid work at the mo – but what are you using to show the visual part -some code, a plugin (maybe bbp style pack) or something else?

    #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

Viewing 25 results - 1,826 through 1,850 (of 32,448 total)
Skip to toolbar