Forum Replies Created
-
In reply to: BBpress lost password form not showing message
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
In reply to: Error on “Layout and functionality” pageok, I’ve just run the above through an online difference checker and it says no difference 🙂
In reply to: Allow empty repliesI 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 repliesthere 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
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' ;
In reply to: Please make replies not viewable to non-users.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.
In reply to: Please make replies not viewable to non-users.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.
as
<img src="http://www.kimberleygundogs.com/wp-content/uploads/2019/12/dog-jumping.jpg" alt="" />
gives you
I did give you the proper code – you need to link to the full url of an image ie a file that is an image file
yes, unless you can can tell the server precisely where to find the image, it cannot display it 🙂
ok, I’ll give it one more try, and then you are on your own!!
your code would produce
<img src="84396884_480x480.jpg">
which is not a valid url, so produces nothing.
you need a link which is a valid url to an image, so one where you see an image if you put the url into your browser
you need to wrap the url into an image tag as in
https://www.w3schools.com/tags/tag_img.asp
so (untested so may need fixing) and image sizing but try
add_action('bbp_template_before_replies_loop', 'bbp_show_extra_fields'); function bbp_show_extra_fields() { $topic_id = bbp_get_topic_id(); $value1 = get_post_meta( $topic_id, 'bbp_extra_field1', true); $value2 = get_post_meta( $topic_id, 'bbp_extra_field2', true); $img1 = '<img src="'.$value1.'">' ; echo "Field 1: ".$img1."<br>"; echo "Field 2: ".$value2."<br>"; }
In reply to: Please make replies not viewable to non-users.the problem is that you are changing the actual content box, so it will still display 20 boxes with author details and only blank the boxes.
you basically need to alter the bbpress template loop-single-reply.php to achieve what you want
see
section 3
In reply to: Getting 404 response on forum archive pageif you mean you are getting 404 to https://bbpress.org/forums/page/2/ , the this is working fine as far as I can see
In reply to: Users unable to turn of email notifications🙂
🙂
In reply to: There has been a critical error on this website.In reply to: Hide participant role at messages🙂
In reply to: Best way to change forum name roles?🙂
In reply to: Edit Lock could not be set to 0that is a bug which is in the list for fixing
in the meantime just set it for 5256000 which is 10 years !
just tested it on my site, and it seems to work.
where did you put the code?
untested but try this
add_filter ('bbp_new_reply_redirect_to', 'rew_redirect_to_topic', 10 , 3) ; function rew_redirect_to_topic ($reply_url, $redirect_to, $reply_id ) { $topic_id = bbp_get_reply_topic_id ($reply_id) ; $redirect_url = bbp_get_topic_permalink( $topic_id, $redirect_to ); return $redirect_url ; }
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
In reply to: Help to style bbpressIn reply to: breadcrumb style with cssgreat – glad to have helped !!
In reply to: breadcrumb style with cssyou can wrap the breadcrumb in a container – there is a filter
'bbp_get_breadcrumb' return apply_filters( 'bbp_get_breadcrumb', $trail, $crumbs, $r, $args );