Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,851 through 3,875 (of 32,522 total)
  • Author
    Search Results
  • #198757
    Robin W
    Moderator

    it’s not much of a codex, but it’s the only one there is! I wrote quite a lot if it when I started using bbpress – I’m just a bbpress user who helps on here. If you’d like to contribute, post suggested improvements and I’ll add them – just saying 🙂

    So if your code was working a few days ago, and it now isn’t, then you must have upgraded the theme, a plugin or changed something else. Without knowing what it’s hard to help.

    neon67
    Participant

    It’s working! Great!
    1.New scheduled topic: time of publication and the timestamp in tracker coincide now!
    2.Old topic (written 5 years ago) after time-correction for today – appear in the tracker correctly!
    3.But, does not work for scheduled replay in topic. If replace the word “topic” for word “replay” in the code – will this work?

    #198735
    Pleiades
    Participant

    I have a bbPress forum integrated with WooCommerce.
    Until a few days ago it was working fine, but now

    $uid = bbp_get_current_user_id();
    
    if ( bbp_has_forums( array(
         'author' => $uid
     )) ) :

    returns bool(false) regardless of the user or user role.

    On a side note, when searching codex.bbpress.org, the results I (don’t) get:

    bbp_get_current_user_id – “Sorry, no posts matched your criteria.”
    bbp_has_forums – “Sorry, no posts matched your criteria.”
    bbp_forums – “Sorry, no posts matched your criteria.”
    bbp_the_forum – “Sorry, no posts matched your criteria.”

    I understand these are just wrappers for WP_Query, but there are some obviously also forum-specific options. It doesn’t seem like much of a codex. Just saying.

    Robin W
    Moderator

    this is more complicated than it as first looks, as there is forum data that needs updating

    but as a start

    function rew_status_transitions( $post ) {
    	if ( $post->post_type == 'topic') {
    		//update the post meta
    		update_post_meta ($post->ID, '_bbp_last_active_time' , $post->post_date) ;
    	}
    	 
    }
    add_action(  'future_to_publish',  'rew_status_transitions', 10, 1 );
    #198659

    In reply to: Links in new topic

    Oaz
    Participant

    yes, apostrophes are okay now, with same result as before : links do not appear anymore in new topics. i disable the code, links display…

    So strange this function is not in bbpresscore, I suppose many of us need it..

    Anyway, thank you so much for your help and patience Robin. I spent much time on this without results. I think I’ll just lokk for another system than bbpress for my forum..

    #198657

    In reply to: Links in new topic

    Robin W
    Moderator
    function custom_bbp_has_replies($args) {
     $args[‘order’] = ‘DESC’; // 'ASC' (Ascending, Default), 'DESC' (Descending)
    
    return $args;
     }

    needs the apostrophies sorting on it !!

    #198656

    In reply to: Links in new topic

    Oaz
    Participant

    here it is

    function custom_bbp_has_replies($args) {
     $args[‘order’] = ‘DESC’; // 'ASC' (Ascending, Default), 'DESC' (Descending)
    
    return $args;
     }
     
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
    
    function custom_bbp_show_lead_topic( $show_lead ) {
    $show_lead[] = 'true';
    return $show_lead;
    }
    
    add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );
    #198655

    In reply to: Links in new topic

    Robin W
    Moderator

    can you post the code you are now using

    #198643
    williamlucas
    Participant

    Thank you, Stephen, for sharing the examples link.Now i know where i was doing the mistake and after applying the code it work like anything.

    #198608
    shibaa987
    Participant

    Well, this thread is pretty old and I have a way how you can enable AMP for bbpress pages.

    Before going to enable AMP support you need below things:
    – Code snippets plugin
    – AMP plugin

    Create a new code snippet and add the following code:
    add_action( ‘amp_init’, ‘amp_bbpress_init’ );
    function amp_bbpress_init() {
    add_post_type_support( ‘topic’, AMP_QUERY_VAR );
    }

    Read more @ How to Implement AMP on bbPress

    #198602
    Robin W
    Moderator

    @poonasor

    function rew_check_forum_root () {
    $forum_slug = '/'.bbp_get_root_slug().'/' ;
    $page_slug = $_SERVER['REQUEST_URI'] ;
    if ($page_slug == $forum_slug) return true ;
    else return false ;
    }
    
    if (rew_check_forum_root() ) echo 'we are at the forum root!'  ;
    #198601
    Robin W
    Moderator

    this should do it

    function rew_check_forum_root () {
    $forum_slug = '/'.bbp_get_root_slug().'/' ;
    $page_slug = $_SERVER['REQUEST_URI'] ;
    if ($page_slug == $forum_slug) return true ;
    else return false ;
    }
    
    if (rew_check_forum_root() ) echo 'we are at the forum root!'  ;
    #198589

    In reply to: Links in new topic

    Robin W
    Moderator

    I’m pretty sue that you code is suffering from apostrophe differences.

    When you copy code differ3ent editors change the ‘ !

    so your code has for instance

    (‘bbp_before_has_replies_parse_args’,

    suggest you remove the start and end apostrophies and replace eg

    ('bbp_before_has_replies_parse_args',

    #198574

    In reply to: Links in new topic

    Oaz
    Participant

    here is all the code I have (line 614 to 626) :

    function custom_bbp_has_replies($args) {
    $args[‘order’] = ‘DESC’; // ‘ASC’ (Ascending, Default), ‘DESC’ (Descending)

    return $args;
    }
    add_filter(‘bbp_before_has_replies_parse_args’, ‘custom_bbp_has_replies’ );

    function custom_bbp_show_lead_topic( $show_lead ) {
    $show_lead[] = ‘true’;

    return $show_lead;
    }
    add_filter(‘bbp_show_lead_topic’, ‘custom_bbp_show_lead_topic’ );

    The errors :

    Notice: Use of undefined constant ‘custom_bbp_has_replies’ – assumed ‘‘custom_bbp_has_replies’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 619

    Notice: Use of undefined constant ‘bbp_show_lead_topic’ – assumed ‘‘bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 626

    Notice: Use of undefined constant ‘custom_bbp_show_lead_topic’ – assumed ‘‘custom_bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 626

    In fact answers are not inverted anymore…

    #198573

    In reply to: Links in new topic

    Robin W
    Moderator

    hmmm…

    1. did you leave in the code, from what you say that is needed as well

    
    function custom_bbp_show_lead_topic( $show_lead ) {
    $show_lead[] = ‘true’;
    return $show_lead;
    }
    add_filter(‘bbp_show_lead_topic’, ‘custom_bbp_show_lead_topic’ );

    on your other errors, can you post lines from say 615-630 from your functions file

    #198572

    In reply to: Links in new topic

    Oaz
    Participant

    Hi Robin and thanks for your answer,

    I tried with your code, and :

    replies are inverted but I cannot see the Topic itself anymore, only answers

    – I have this handful of mistakes appearing

    f undefined constant ‘custom_bbp_has_replies’ – assumed ‘‘custom_bbp_has_replies’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 620

    Notice: Use of undefined constant ‘bbp_before_has_replies_parse_args’ – assumed ‘‘bbp_before_has_replies_parse_args’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 621

    Notice: Use of undefined constant ‘custom_bbp_has_replies’ – assumed ‘‘custom_bbp_has_replies’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 621

    Notice: Use of undefined constant ‘bbp_show_lead_topic’ – assumed ‘‘bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 628

    Notice: Use of undefined constant ‘custom_bbp_show_lead_topic’ – assumed ‘‘custom_bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 628

    I am not a developper, so I do not know what to do with these

    #198571

    In reply to: Links in new topic

    Robin W
    Moderator

    your first bit of code should be

    function custom_bbp_has_replies($args) {
     $args[‘order’] = ‘DESC’; // ‘ASC’ (Ascending, Default), ‘DESC’ (Descending)
    
    return $args;
     }
    
    add_filter(‘bbp_before_has_replies_parse_args’, ‘custom_bbp_has_replies’ );
    

    The ($args) brings in all the existing args and then your next line modifies just the ‘order’ arg. Otherwise the only argument passed to the query is the ‘order’ arg, so there is nothing to display.

    #198561
    Robin W
    Moderator

    Great – glad you are fixed, and for anyone reading this later the code should be

    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply') ;
    
    function rew_no_reply ($no_reply) {
    	$no_reply = 'abc@def.com' ;
    return $no_reply ;
    }
    #198557
    rhodesengr
    Participant

    I fixed it. Needed single quotes around the email address. I don’t uslly code much in php so I am not super on top of the syntax. Thanks for the code. Now it does just what I want. Only the admin email gets notified when someone posts. That is what i want for now. Thanks again.

    #198556
    rhodesengr
    Participant

    I tried your code snipet and it killed my site. I commented it back out and the site is working again. here is exactly what I put in functions.php except i changed the actual email name to “myemail”

    add_filter (‘bbp_get_do_not_reply_address’, ‘rew_no_reply’) ;
    function rew_no_reply ($no_reply) {
    $no_reply = myemail@gmail.com ;
    return $no_reply ;
    }

    #198554
    rhodesengr
    Participant

    ok thanks. I am trying the asynchronnous one first. Not really sure what it is doing. Now it seems like no email gets sent at all. Not to noreply, not to the poster, and not to site admin. I have asked about this on that plugin support page.

    Your code snippet goes in functions.php?

    #198553
    Robin W
    Moderator

    by default bbpress send one email to the noreply address and bcc’s in the subscibers, so only one email sent.

    code to change

    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply') ;
    
    function rew_no_reply ($no_reply) {
    	$no_reply = abc@def.com ;
    return $no_reply ;
    }

    You’d think the bbpress coders would have created setting for this by now

    the bbpress coders are busy people who can code what they wish to. Not up to us to criticise free software

    #198552
    rhodesengr
    Participant

    ok. thanks. What are “individual emails”

    Also, is there a reference to how to change the code? I would like to consider that option.

    I searched and found some other threads about this issue. One was from 2016. You’d think the bbpress coders would have created setting for this by now. Seems a lot of plugins have problems if you don’t have an enmail address with the website domain but it is very commone to use the built in system, your own pop, or gmail. Then the noreply@yourdomain.com is invalid. Common and forseeable.

    #198550
    Robin W
    Moderator

    bbpress sends an email to the noreply address and bcc’s in the intended recipients.

    2 solutions

    1. my style pack plugin lets you amend the ‘to’ address (see email subscriptions tab), or you can do this with code, and amend it to a real address on your website.

    bbp style pack


    2.switch to individual emails – this plugin does that https://wordpress.org/plugins/asyncronous-bbpress-subscriptions

    manuuu1127
    Participant

    I looked through all the entries and didn’t find the answer. Maybe if someone else goes searching they will see my answer.

    If you remove the sidebar and change your page to full-width it won’t work…buttt if you create a new page and set it as full width and then put the bbpress code into it, it will go full width. My only thing now is I will probably install a plug in to put sidebars where I want them

Viewing 25 results - 3,851 through 3,875 (of 32,522 total)
Skip to toolbar