Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 3,226 through 3,250 (of 14,188 total)
  • @robin-w

    Moderator

    ok, can you you confirm that you know how to FTP a file to your PC and back again ?

    That will save a lot of explaining !!

    @robin-w

    Moderator

    thanks for posting πŸ™‚

    @robin-w

    Moderator

    I took a look at this, but cannot see what is causing the issue

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back

    @robin-w

    Moderator

    login here came with 2.6.x

    bbpress has a template in

    \templates\default\bbpress\form-user-login.php

    you can change this to have a click link to any url you wish

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-user-login.php

    transfer this to your pc and edit

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

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

    Then amend this file to take out the current form and put in a link

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-user-login.php

    bbPress will now use this template instead of the original

    @robin-w

    Moderator

    I took a look, it is theme related, but I cannot offer a fix.

    @robin-w

    Moderator

    As a test can you try not having the underscore eg customforum as a single word and see if that makes a difference.

    Also are you running buddypress as well ? (question not suggesting you should or shouldn’t !)

    In reply to: Feature

    @robin-w

    Moderator

    also have

    bbResolutions

    still works as far as I know

    @robin-w

    Moderator

    ok, I can not help unless I can see an example – iIneed to look at what is downloaded to my PC’s browser

    @robin-w

    Moderator

    This is theme related, but if you can give me a link to a live example, I might be able to give you some code

    @robin-w

    Moderator

    line 309 of includes/replies/functions calls a function calledbbp_check_for_duplicate within the bbp_new_reply_handler function

    That function checks for duplicates and is in includes/common/functions line 663

    within that function line 676 for a check

    if ( user_can( (int) $r['post_author'], 'throttle' ) ) {
    		return true;
    	}

    so allowing participants to throttle allows duplicates

    It is a bit of a fudge, but should work !!

    @robin-w

    Moderator

    the easiest way to do this is to allow participant to ‘throttle’ – this then lets them bypass this check

    so the code (untested) should be :

    add_filter( 'bbp_get_caps_for_role', 'rew_throttle_bypass', 10, 2);
    
    function rew_throttle_bypass ($caps, $role) {
    	if ($role == bbp_get_participant_role() ) {
    		$caps['throttle'] = true ;
    	}
    return $caps ;
    }

    ut 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

    @robin-w

    Moderator

    there’s no problem with using priorities, especially as you know what it is affecting, just keep in mind that if you add a further bbpress content realted plugin and it doesn’t do what you want it might be related to this

    In reply to: Broken Pagination

    @robin-w

    Moderator

    try

    dashboard>settings>permalinks and just click save – this resets the links and may help

    @robin-w

    Moderator

    @robin-w

    Moderator

    bbpress is very large, and finding the right bit of code not easy !!

    have you heard of notepadd++ ?

    Google it and install it.

    Then download bbpress 2.6 to your PC and unzip it.

    Then when you are looking in your browser at bbpress, you’ll usually find a class or ID wrapped around the code you want to change.

    In Notepad++ do ‘search>find in files’ and search the class ot ID name in the bbpress directory you created.

    That will get you to lots of bits of code which are usually around what you are trying to find

    I do this a lot !!

    @robin-w

    Moderator

    on 2. – no problem πŸ™‚ πŸ™‚ πŸ™‚ I recently spent several hours trying to fix an issue and when I posted all I got back was ‘already fixed elsewhere’ as the response, so this is a current hot button for me – apologies if I sounded irritable πŸ™‚

    on your filter – quite a few bbpress additional plugins authors use ‘bbp’ as a prefix to indicate the the class/code is bbpress related. bbpress itself does not have a class of bbp-attachments so suspect this is attachments plugin related.

    I would try Milan as a first port of call, he is usually helpful, but do come back if he can’t help.

    @robin-w

    Moderator

    on 2. ok, I see this as just a question, with no response

    https://wordpress.org/support/topic/attachment-with-empty-text-message-fails/

    do you see it differently?

    @robin-w

    Moderator

    ok, 2 things I would say

    1. since this relates to bbpress attachments plugin specifically, it would be better to ask there – Milan should be able to help
    2. On looking at the attachments support forum I notice that you also asked about empty replies in that forum as well as this forum where I gave you a fix – it is very frustrating for plugin authors and helpers when they spend time on an issue only to find that the original poster has already fixed it, and if you post in multiple places and get a fix from one, it is good to update the other places and maybe even post the solution there as well to help others. It would be polite to do this πŸ™‚

    @robin-w

    Moderator

    ok, so in the example above, what does $value2 equal

    $value2 = get_post_meta( $topic_id, 'bbp_extra_field2', true);

    and what is the full url that you want?

    @robin-w

    Moderator

    I tried your code but it created a fatal issue on the site..

    ok, can you post the exact code you used, and that you put this in your child theme functions file

    @robin-w

    Moderator

    ok, I’ve just run the above through an online difference checker and it says no difference πŸ™‚

    In reply to: Allow empty replies

    @robin-w

    Moderator

    I must hang my head in shame and admit that I had inadvertently hidden the error message. How many times do I have to read β€œremove all plugins and use default theme” before I remember to do it completely every time.

    πŸ™‚ πŸ™‚

    great – glad you are fixed πŸ™‚

    In reply to: Allow empty replies

    @robin-w

    Moderator

    there should be an error message at the top saying

    Your reply cannot be empty.

    but the other plugin may be affecting this.

    the quickest way to correct this is to create some content if it is blank.

    This filter (untested) will deal with empty content and add a space character.

    add_filter ('bbp_new_reply_pre_content' , 'rew_allow_blank_content') ;
    
    function rew_allow_blank_content ($reply_content) {
    	if ( empty( $reply_content ) ) {
    		$reply_content = ' ' ;
    	}
    return $reply_content ;
    }

    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

    I have initially set it to change empty content to a single space character ie

    $reply_content = ' ' ;

    however later checking by WordPress may delete this, so it may need some actual text – maybe like

    $reply_content = 'this reply is has no text' ;

    @robin-w

    Moderator

    ok, I should say that I am NOT a bppress author, I am just a user who tries to help others.

    I am author of bbp private groups plugin, which would not help you directly as you want non logged in to see topics, but does mean that I spent a great deal of time locking down bbpress, and knowing where the code displays stuff.

    so for instance my code will not stop searches, access via a users profile, direct entry of urls and many more.

    so if your site needs to seriously hide replies to non logged in, then you would need to hire a very experienced dev. I am trying to retire, so desperately not trying to take on work !!

    I haven’t looked at your solution, and with a smile, will not have time to do this.

    @robin-w

    Moderator

    This should do what you want

    <?php
    
    /**
     * Replies Loop - Single Reply
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;
    
    ?>
    
    <?php 
    $reply_id = bbp_get_reply_id() ;
    // first topic reply shouldn't be hiding
    $rep_position = bbp_get_reply_position($reply_id);
     
    // if user is not logged in and not the first post topic
    if ( !is_user_logged_in() && $rep_position == 2 ) {
    	echo "<br/><strong>Replies only viewable for logged in users</strong>" ;
    bbp_get_template_part( 'form', 'user-login' );
    } 
    elseif ( !is_user_logged_in() && $rep_position > 2 ) {
    	//do nothing !!
    }
    
    //otherwsie use is logged in and/or this is reply 1 !
    else {
    
    ?>
    
    <div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    	<div class="bbp-meta">
    		<span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span>
    
    		<?php if ( bbp_is_single_user_replies() ) : ?>
    
    			<span class="bbp-header">
    				<?php esc_html_e( 'in reply to: ', 'bbpress' ); ?>
    				<a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a>
    			</span>
    
    		<?php endif; ?>
    
    		<a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
    
    		<?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
    
    		<?php bbp_reply_admin_links(); ?>
    
    		<?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>
    
    	</div><!-- .bbp-meta -->
    </div><!-- #post-<?php bbp_reply_id(); ?> -->
    
    <div <?php bbp_reply_class(); ?>>
    	<div class="bbp-reply-author">
    
    		<?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
    
    		<?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
    
    		<?php if ( current_user_can( 'moderate', bbp_get_reply_id() ) ) : ?>
    
    			<?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>
    
    			<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
    
    			<?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
    
    		<?php endif; ?>
    
    		<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
    
    	</div><!-- .bbp-reply-author -->
    
    	<div class="bbp-reply-content">
    
    		<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    
    		<?php bbp_reply_content(); ?>
    
    		<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    
    	</div><!-- .bbp-reply-content -->
    </div><!-- .reply -->
    
    <!-- end of else!!!-->
    <?php 
    }
    ?>

    BUT be aware this is only hiding replies at this point – there are many ways to see replies in bbpress.

Viewing 25 replies - 3,226 through 3,250 (of 14,188 total)