I just installed the follow for bbpress plugin, and I have received four warnings about the coding on lines 36, 38, 42, and 44. I have not altered anything. This messaged popped up upon going to setting. I am not sure what to do to get rid of it. Below is what the error message says:
Warning: Trying to access array offset on value of type bool in /home/noisvjkg/public_html/wp-content/plugins/follow-bbpress/setting.php on line 36
Warning: Trying to access array offset on value of type bool in /home/noisvjkg/public_html/wp-content/plugins/follow-bbpress/setting.php on line 38
Warning: Trying to access array offset on value of type bool in /home/noisvjkg/public_html/wp-content/plugins/follow-bbpress/setting.php on line 42
Warning: Trying to access array offset on value of type bool in /home/noisvjkg/public_html/wp-content/plugins/follow-bbpress/setting.php on line 44
I used “inspect” in Chrome and the img code looked okay but http.
I copied the image URL (http) to a separate window and it worked.
In Inspect I copied the URL of an image from another thread in the site (Https) with an image which worked and it still worked.
I the copied the URL of an image from another HTTPS site that I manage and it showed.
So my assumption is that it is the http image within an Https page is making it fail to display.
Thanks for joining!
I am not a bbpress author, just someone who helps out.
Yes, I suspect that there are several places it could be done.
My code above should work (and if you can test it that would be great) , but if you fancy working up a better solution, please post back.
I will happily incorporate it into my bbp-style-pack plugin to save others needing to work out code and/or use child theme functions.
Hi, allow me to join in. I am Martin’s collegue and we are dealing with this issue together.
I went into the code to see how this works. The problem is that after spam is checked using bbp_new_reply_pre_insert filter currently on line 379 in includes/replies/functions.php, the wp_insert_post runs, which is fine, but a few lines later the hook bb_new_reply hooks the function bbp_new_reply that takes care about all the extra metadata non related to the post but to various counts and date updates. However if we have spam, this function should probably not run.
I guess we should unset this action if spam is found. Do you think this can be done using the bbp_akismet_check_post filter?
We’re currently working on integrating forums into our Community page. However, despite embedding the necessary shortcodes, we’re encountering an issue where the forums page loads correctly, but clicking on specific forums or topics results in blank pages. We’ve attempted to troubleshoot by uninstalling, but the problem persists.
Here’s our forum page https://membership.nationalhomeless.org/community/
Blank page: here:https://membership.nationalhomeless.org/forums/topic/welcome-members/
I don’t have any forums on my live sites (anymore), so don’t use akismet, so I’m relying on your better knowledge 🙂
so to save having to repeat bbpress code, the logic might be
add_action ('bbp_new_reply_pre_extras' , 'rew_askimet_check', 100 , 1 ) ; //might need to be run at a high priority to make sure it is last - not tested
function rew_askimet_check ($reply_id) {
//only execute is this is akismet spam
if ( bbp_get_spam_status_id() == get_post_status($reply_id) && !empty (get_post_meta( $reply_id, '_bbp_akismet_user_result', true ))) {
//unspam the reply (which takes it back to pending, and within that function runs the update_reply_walker)
bbp_unspam_reply( $reply_id) ;
//and then re-spam it
bbp_spam_reply( $reply_id) ;
}
}
which is actually what I do manually (I click unspam and then click spam on the front end admin) on this site when akismet does this.
I apologise for the late response, I was distracted by another urgent issue. So if my understanding is correct, this basically just reruns the bbp_update_reply_walker if the reply is flagged by spam. But from what I’ve seen in the code, this wouldn’t solve the specific issue, since the walker only checks for the replie’s pending status
As in:
// Only update if reply is published
if ( ! bbp_is_reply_pending( $reply_id ) ) {
// Last reply and active ID's
bbp_update_topic_last_reply_id ( $ancestor, $reply_id );
bbp_update_topic_last_active_id( $ancestor, $active_id );
// Get the last active time if none was passed
$topic_last_active_time = $last_active_time;
if ( empty( $last_active_time ) ) {
$topic_last_active_time = get_post_field( 'post_date', bbp_get_topic_last_active_id( $ancestor ) );
}
bbp_update_topic_last_active_time( $ancestor, $topic_last_active_time );
}
But the specific reply, if it has been marked by Akismet would have the status ‘spam’ and not ‘pending’, so the walker would still update the value wrong. Is my understanding correct?
just had a quick look (i’m working on soemthing else at the moment, but found 5 minutes)
maybe
if ( bbp_get_spam_status_id() == get_post_status($reply_id) && !empty (get_post_meta( $reply_id, '_bbp_akismet_user_result', true ))) {
in case you are working on this, basically if we hook to
bbp_new_reply_pre_extras
we can then do a check if it has been spammed by askimet and the if so, just do a reply walker update
so something like (totally untested)
add_action ('bbp_new_reply_pre_extras' , 'rew_askimet_check', 100 , 1 ) ; //might need to be run at a high priority to make sure it is last - not tested
function rew_askimet_check ($reply_id) {
//only execute is this is akismet spam
if ( bbp_get_spam_status_id() == get_post_status($reply_id) && [some check that this has been marked by akismet])) {
//just run the reply update walker as this will do a full refresh of all ancestors to the topic if just the reply ID is sent
bbp_update_reply_walker($reply_id) ;
}
}
The akismet check would be something like
if (get_post_meta( $reply_id, 'some akismet metadata', true )
I’m in the code, and can work out where we might link to a hook, it is really if there is a metadata field I can use to do a check – the name would be useful
thanks, yes this happens in this forum too, but I have limited access to the backend here, as I just help out.
I was asking so I can find a hook to try and fix. your post was helpful, so let me see if I can do some code later today
I have a very strange issue with links on my forum.
If a user posts this, the post will appear on the forum properly:
<a href="https://astrobin.com/okz16b/E/"><img src="https://astrobin.com/okz16b/E/rawthumb/gallery/get.jpg?insecure"/></a>
If they post this instead, it will not allow them to post it:
<a href="https://astrob.in/okz16b/E/"><img src="https://astrob.in/okz16b/E/rawthumb/gallery/get.jpg?insecure"/></a>
If you look, the difference is one link refers to astrobin.com and one to astrob.in. I cannot find anywhere to allow astrob.in links in users posts.
Anyone know where I can set this? 🙂
li.bbp-header {
display : none ;
}
That removes ‘creator’ ‘topic’ above the main topic post but not above the reply box which still shows ‘creator’ ‘topic’
The second css removes the post date which i would like to have.
With regards to the topic title I would like to achieve the same styling in this forum, a minimalistic topic title in bold with no breadcrumbs
Try
li.bbp-header {
display : none ;
}
div.bbp-topic-header div.bbp-meta {
display : none ;
}
So as a slight deviation, I managed to resolve how to add a login link to “You must be logged in to reply to this topic.” and not “You must be logged in to create new topics.”.
I use the login plugin (paid) created by Xootix and I asked them for the necessary code (PHP) to add a link to the “You must be logged in to reply to this topic.” or at least enable the wording to be clickable.
Below is PHP code provided by Xootix and I added it to the Themes functions.php and this works very well
add_action( ‘wp_footer’, function(){
if( is_user_logged_in() ) return;
?>
<style type=”text/css”>
.bbp-no-reply .bbp-template-notice{
cursor: pointer;
}
</style>
<script type=”text/javascript”>
jQuery(document).ready(function($){
$(‘body’).on( ‘click’, ‘.bbp-no-reply .bbp-template-notice’, function(){
$(‘.xoo-el-login-tgr’).trigger(‘click’);
} )
})
</script>
<?php
} );
I think this does what you want
add_filter ('bbp_get_reply_author_avatar', 'rew_avatar', 10 , 3) ;
add_filter ('bbp_get_topic_author_avatar', 'rew_avatar' , 10 , 3) ;
function rew_avatar ( $author_avatar, $id, $size) {
if ( bbp_is_reply( $id ) ) {
$author = bbp_get_reply_author_display_name( $id );
$text = 'alt="icon avatar for '.$author.'"' ;
}
if ( bbp_is_topic( $id ) ) {
$author = bbp_get_topic_author_display_name( $id );
$text = 'alt="icon avatar for '.$author.'"' ;
}
$author_avatar = str_replace('alt=\'\'',$text,$author_avatar);
return $author_avatar ;
}
I just got around to testing the above. I copied the code into themes function.php. Under fish caught it still says array instead of the fish species chosen in the dropdown. Also the image still does not show up.
Any other suggestions? the Fish caught I can change it so that the user has to type in the fish species caught. Just much easier for them to choose the dropdown when entering, especially if on the lake when posting.
It is important for the image to show up in the email because that draws much more interest than no image showing up.
Re: Website: allinop.comI have used the following css to modify the [bbp-topic-index]
.bbp-topic-voice-count,
.bbp-topic-reply-count,
.bbp-topic-freshness { /* Hides elements related to voice count, reply count, and topic freshness */
display: none;
}
.avatar-14 { /* Hides avatars with the class "avatar-14" */
display: none !important;
}
.bbp-search-form { /* Hides the bbPress search form */
display: none;
}
I have 2 issues:
Firstly, the topic titles do not take the entire horizontal space.
It is as if the hidden elements still occupy the space.
I have tried ‘hidden: none’ instead ‘display: none’ to no avail.
Secondly, I’ve been trying to also remove the border around the list of latest topics.
I have unsuccessfully tried:
.bbp-topic {
border: none;
}
and
.bbp-topic {
outline: none;
}
I would be grateful for any ideas.
Main problem, in addition to my non PHP abilities, was me using GPT 3.5. After a paid upgrade things started going way smoother, and the code works. Some parts of the parsed text such as some colouring are blocked by a theme or a plugin, but that is fine.
Anyway, it was nice to visualize the symbols and the hand histories to the forum users.
Hello, I used the shortcode [bbp-forum-index] for my forum page so that I could adjust the sizing and spacing, but when you enter a forum past the index page, I lose those adjustments as it of course loads a different page for the forums after the index page. Is there a way to add a shortcode to the pages that load after index or do I need to do all my styling via CSS?
To anyone stumbling into this thread wondering how the subscriptions are stored in the database, it has been updated.
To find out what users are subscribed to a topic or thread you need to look for the _bbp_subscription
meta_key in the wp_postmeta table. There is one for each user subscribed where meta_value is the ID of the user subscribed.
So for example, to know how many users are subscribed to a forum or topic, just count the number of _bpp_subscription metadata present with post_id of the specific forum or topic
Any guidance on the code I need to add would be most welcomed after the You cannot create new topics.
Thanks
Hi
I am running BBPRESS and am looking to add a login link to Add login link to “You must be logged in to create new topics.” which appears at the bottom of Topics list when you are not logged in.
I have copied out the Forum-Topic.php file and it is located in my Themes BBPRESS folder.
Code in my Forum-Topic.php that I am looking to add to is ….
<div id=”no-topic-<?php bbp_forum_id(); ?>” class=”bbp-no-topic”>
<div class=”bbp-template-notice”>
- <?php is_user_logged_in()
? esc_html_e( ‘You cannot create new topics.’, ‘bbpress’ )
: esc_html_e( ‘You must be logged in to create new topics.’, ‘bbpress’ );
?>
.bbpress .forum h4.author {
display: none;
}