Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 876 through 900 (of 32,297 total)
  • Author
    Search Results
  • #230433
    Robin W
    Moderator

    no it’s my bad coding !!

    I hadn’t spotted that you were using a child theme.

    I add some code to pick up on this, and be back in the next day

    gtatar
    Participant

    Robin, your code change worked for new topics. Did you say we would need an additional code change for replies?

    rinh
    Participant

    Oh! I did not see that the code changed when I pasted it in here and the ‘;’ even disappeared. I kept retrying with the one in the documentation.

    Thanks again Robin, you’re awesome 🙂

    Robin W
    Moderator

    ok, so just looked the documentation says

    ‘& lt;’

    when it should say

    ‘<‘
    etc.
    This is just internet stuff between stating and interpreting.

    so if you copy the code in your first post, then this is the correct code to have.

    I’ll look to correct the documentation

    rinh
    Participant

    Thank you for trying.

    That’s odd.

    I’ve tried it again, and also in my functions.php instead of Code Snippets. It doesn’t say there’s any errors until I try to save it.
    I tried another theme as well and also to remove all other custom snippets I got, but the same result.

    Robin W
    Moderator

    just loaded that code to my test site, and it runs fine.

    suggest you delete and try it again

    rinh
    Participant

    Hi!
    I tried a snippet from this page: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#24-show-status-labels-for-bbpress-topics
    to get a label or icon for sticky topics.

    function rk_sticky_topics() {
     
       if ( bbp_is_topic_sticky() && !bbp_is_topic_closed() )
          echo '<span class="sticky">[Sticky]</span>';
    }
     
    add_action( 'bbp_theme_before_topic_title', 'rk_sticky_topics' );

    I get a fatal error with syntax error unexpected ‘;’ on the line starting with if.

    Thank you in advance

    #230409
    cathyskach
    Participant

    I tested this on our staging site. Switching out for the Twenty Twenty theme, the dates populated, so I presume the problem to be the theme. What advice do you have for a fix?

    PS: I tried taking out the short code on the member-only (parent) page to allow you access to the forum but it seems to still want a password.

    Cathy

    #230408
    coopersita
    Participant

    I haven’t made much progress. I tried adding a rewrite rule and changing from ‘users’ from ‘members’ to avoid rules clashing:

    function bbp_custom_author_rewrite(){
        add_rewrite_rule(
            "^forums/members/([^/]*)$",
            'index.php?bbp_user=$matches[1]',
            "top"
        );
    }
    add_action( 'init', 'bbp_custom_author_rewrite', 10);

    But I think I’m missing the part where the template uses the query var to load the correct content because I keep getting 404 errors.

    #230405
    chenryahts
    Participant

    BBpress keeps loading the empty index.php in the TwentyTwentyTwo Child theme I’m working on, which loads a WSOD.

    I can’t get any of the template filters to use one of the html files, so temporarily have it working with the index.php file as:

    wp_head();
    block_header_area();
    block_template_part( 'page-inner' );
    wp_footer();
    block_footer_area();

    And… its almost all working? But, this can’t be the right way to get it to use the new default page template in the block theme.

    Thoughts? Ideas? How can I get it to use the new theme templates?

    Thanks!

    #230370
    Robin W
    Moderator

    ok, so to restrict :

    dashboard>forums>all forums>edit the forum you want>right hand side you will find a box called ‘Forum Moderators’ add his name

    Then make him a participant.

    see thsi for role fresponsibilities

    bbPress User Roles and Capabilities

    I’m not sure that this wil let him create forums – but I suppose I would ask if he is that dangerous, maybe that’s something he should be asking you to do 🙂

    gtatar
    Participant

    Robin, I applied your code change. Will report results once I have them.

    #230348
    Robin W
    Moderator

    just taken a look, that theme is a ‘block theme’ the new way that themes are written.

    If you want to use it. come back and I’ll give you some code to try

    #230340
    Robin W
    Moderator

    ok, so page is now ok, but suspect from

    https://middleagedwitch.com/Forums/forum/general-discussion/

    that you have a capital F somewhere

    so either your permalink is ‘Forums’ or in

    dashboard>settings>forums>root forum slug you have ‘Forums’

    it needs to be lower case ‘forums’

    #230339
    Robin W
    Moderator

    ok, so I’m guessing you have a page called ‘Forum’ in which you have put the shortcode

    [bbp-forum-index]

    If so change the permalink on this page from ‘forum’ to ‘forums’ and it should all work

    ppoirier1995
    Participant

    Hi there,

    I’m trying to find a solution to the problem of participants being able to remove single topic tags by simply removing them from the “Tags” input field on the reply-to form.

    I’ve found this thread that clearly explains the issue

    Topic tags deleted by other participants


    and offers a solution that is unfortunately not working on my end.

    My form-reply.php currently has this line:
    <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() )) : ?>
    which I tried to replace with:
    <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) && current_user_can('moderate') ) : ?>
    to no avail.

    Has anyone solved this issue? Would love some guidance here! 🙂

    #230304
    coopersita
    Participant

    Is there a way to redirect all profile page links so they use the user id, instead of user login/nicename? Some users have their email as their username, so we want to hide it.

    So to go from
    /forums/users/{login}

    to
    /forums/users/{id}

    I was able to change the URLs so they point to the right place:

    function bbp_custom_author_link(  $url,  $user_id,  $user_nicename){
                $url = site_url()."/forums/users/".$user_id;
    	   return $url;
        }
        add_filter( 'bbp_get_user_profile_url', 'bbp_custom_author_link', 10, 3);

    But once you click on the link, you end up in a 404.

    janecarole
    Participant

    Thank you, Robin, that worked. So grateful for you! Please provide me the link you gave me before (on a different topic) so I can thank you meaningfully ($) for your research/coding for me!

    I ended up creating a link on my “Member Profile” page to the new “profile” page you had me create. (I did this so the user would still see WP-Members “Member Profile” page with its unique information.) I used Code Snippets to add your code.

    Not that you need to know this, but: Right after making this change, I had to restore my site because a plugin update (WP-Crontrol) broke the site, and it wouldn’t load. The restore fixed that problem, but caused a problem with my Wordfence connection which messed up my site log-in. It took a while to figure that one out, but after disconnecting and reconnecting Wordfence, I am back to normal (except for needing to make your change again 🙁 …). Plan to do that later.

    Robin W
    Moderator

    or might not – I’m trying to look at this in limited free time and trying not to get sucked into too deeper a code dive 🙂

    #230292
    rinh
    Participant

    Sorry for double post, but I got the toggle button back by adding wp_adv, as well as the image button. Full code below if anyone needs it too

    function bbp_enable_visual_editor( $args = array() ) {
      
        $args['tinymce'] = array('toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright, link, image, wp_adv');
        $args['quicktags'] = false;
        $args['teeny'] = false;
    
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    For toolbar 2 I hid the unwanted buttons with CSS. I’m happy with the results 🙂 Still curious though if toolbar 2 can be customised, but it’s nothing necessary.

    #230290
    rinh
    Participant

    Hi,
    I’m trying to customise the toolbar in TinyMCE.

    Initially I just enabled the advanced one:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        $args['teeny'] = false;
        $args['quicktags'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    I thought of adding a button for underline and it led to trying to get only what I needed in one toolbar:

    function bbp_enable_visual_editor( $args = array() ) {
      
        $args['tinymce'] = array('toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright, link, strikethrough, forecolor, outdent, indent, undo, redo');
        $args['quicktags'] = false;
        $args['teeny'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    This is causing it to repeat some things in toolbar 2 (as well as the ability to toggle toolbar 2 on and off). I tried adding toolbar 2 to the code above, but then it goes back to default. I could stop there though and just add underline and the tools that’s in toolbar 1 by default, but I’m curious if I can customise things further.

    To my question:
    Is there a way to add everything in one toolbar and then disable toolbar 2?
    Or is there a way to get the toogle for toolbar 2 back when I’ve customised toolbar 1?

    I also tried enabling teeny which would’ve worked best, but then I lose the forecolor toolbar box so I’d need a way to add it back.

    Thanks in advance

    Robin W
    Moderator

    maybe it’s the if function, try

    add_action ('bbp_new_topic_post_extras', 'rew_spam_update_last_active', 10 ,1 ) ;
    
    function rew_spam_update_last_active ($topic_id) {
    	//this function tests if a new topic has been marked as spam by Akismet.  If so then the last active date will be wrong
    	//So we use topic walker to recalculate it
    	bbp_update_topic_walker ($topic_id,  '', 0, 0, true) ;
    	}

    It’s not the answer, but might help get to the solution problem

    Robin W
    Moderator

    So there is some code in bbpress that can fix the link (I am guessing by changing something in the database?).

    yes it is the function ‘bbp_update_topic_walker ‘ called in my code 🙂 🙂

    I’ll look further at why it isn’t recalculating based in that info

    gtatar
    Participant

    Still the same result with the new code.

    But I noticed that emptying the spam folder causes “Last Post” link to change to the correct value. So there is some code in bbpress that can fix the link (I am guessing by changing something in the database?).

    Robin W
    Moderator

    ‘It looks like if the fix was inside bbp_topic_freshness_link() it would be much easier to test, ;’

    agree but it just wouldn’t work there, that is not where or when the issue is occurring.

    Try

    add_action ('bbp_new_topic_post_extras', 'rew_spam_update_last_active', 10 ,1 ) ;
    
    function rew_spam_update_last_active ($topic_id) {
    	//this function tests if a new topic has been marked as spam by Akismet.  If so then the last active date will be wrong
    	//So we use topic walker to recalculate it
    	if (!empty (get_post_meta( $topic_id, '_bbp_akismet_user_result' ))) {
    	bbp_update_topic_walker ($topic_id,  '', 0, 0, true) ;
    	}
    }
    
Viewing 25 results - 876 through 900 (of 32,297 total)
Skip to toolbar