Skip to:
Content
Pages
Categories
Search
Top
Bottom

Freshness is way off

Viewing 20 replies - 1 through 20 (of 20 total)

  • Robin W
    Moderator

    @robin-w


    Editor Mike
    Participant

    @editor-mike

    Tried that, did not help.
    Tried excluding forums from cache, turning cache off…


    Editor Mike
    Participant

    @editor-mike

    So, only some forums are incorrect based on this display:

    It seems this bar is having issues pulling its data?

    At a push, can this bar be hidden?


    Robin W
    Moderator

    @robin-w

    try

    dashboard>tools>forums>repair forums and run one at a time


    Robin W
    Moderator

    @robin-w

    that bar can be hidden

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Forum Display


    Mike Witt
    Participant

    @mike80222

    I’m having this problem too (on v 2.6.3). Running the “repair” scripts above does fix the freshness, but you have to run them every time there’s a new reply. So there must still be a bug there, right?


    Editor Mike
    Participant

    @editor-mike

    The tools did not repair it for me, however I have installed the bbp Refresh Last Active Time plug in.

    In the few days since reporting this and installing the plugin, there have been enough new topics and new replies to bury the incorrect data.
    So for the most part the forum is up to date.
    Hopefully no more BBPress updates for a while!

    😀


    ericsims
    Participant

    @ericsims

    This is still not working for me. I repaired the forum about a week ago, which worked temporarily, but now it’s wrong again. I repaired it again, but I can’t do it every day.


    Mike Witt
    Participant

    @mike80222

    Still not working for me either, bbPress 2.6.4.


    Mike Witt
    Participant

    @mike80222

    Sorry, I guess this is still an open ticket, right?
    https://bbpress.trac.wordpress.org/ticket/3297


    Robin W
    Moderator

    @robin-w

    yes


    webcreations907
    Participant

    @webcreations907

    I’m working on a fix/solution for this, will post it up here in a bit so you can all try it out.


    webcreations907
    Participant

    @webcreations907

    The below should update the “Topic” page and the main “Forum” page.

    Once you add the code, you’ll have to add a reply to a topic for it to update. Or run the forum repair Robin W mentioned above.

    Add the below code to your functions.php file of your theme (preferably child theme), or use the code snippet plugin.

    
    if(!function_exists('ticket3297_bbpress_update_latest_activity')){
    	function ticket3297_bbpress_update_latest_activity( $reply_id, $topic_id, $forum_id ){
    		
    		$new_time = get_post_field( 'post_date', $reply_id );
    		
    		if ( ! empty( $new_time ) ) {
    			update_post_meta( $forum_id, '_bbp_last_active_time', $new_time );
    		}
    		update_post_meta( $forum_id, '_bbp_last_active_id', $reply_id);
    		update_post_meta( $forum_id, '_bbp_last_reply_id', $reply_id );
    
    		$forum_obj = get_post( $forum_id );
    		if( $forum_obj && $forum_obj->post_parent !== 0 && bbp_is_forum_category( $forum_obj->post_parent ) ){
    		
    			update_post_meta( $forum_obj->post_parent, '_bbp_last_active_id', $reply_id );
    			update_post_meta( $forum_obj->post_parent, '_bbp_last_reply_id', $reply_id );
    			if ( ! empty( $new_time ) ) {
    				update_post_meta( $forum_obj->post_parent, '_bbp_last_active_time', $new_time );
    			}
    		}
    
    	}
    	add_action( 'bbp_new_reply', 'ticket3297_bbpress_update_latest_activity',10,3 );
    }
    
    if(!function_exists('ticket3297_bbpress_delete_update_latest_activity')){
    	function ticket3297_bbpress_delete_update_latest_activity(){
    			$reply_id = bbp_forum_query_last_reply_id();
    			
    			ticket3297_bbpress_update_latest_activity( $reply_id, bbp_get_reply_topic_id( $reply_id ), bbp_get_reply_forum_id( $reply_id ) );
    
    	}
    	add_action('bbp_deleted_reply','ticket3297_bbpress_delete_update_latest_activity');
    	add_action('bbp_trashed_reply','ticket3297_bbpress_delete_update_latest_activity');
    }
    
    

    That should run when replying, deleting, and trashing replies.


    ericsims
    Participant

    @ericsims

    Alright, I pasted it in to functions.php, and it seems to be working so far. Thanks so much for sharing! I’ll keep an eye on it over the coming days and hope it keeps working.

    Will I need to remove this code if/when bbPress is updated to incorporate this fix?


    webcreations907
    Participant

    @webcreations907

    No problem, glad that’s working out for you so far. 🙂

    You can remove the code when bbpress releases a fix for it, it’s just a temporary solution until it gets worked out.


    ncarring
    Participant

    @ncarring

    A recent plugin update (unfortunately I can’t pinpoint it because a colleague ran the updates and didn’t record which ones they were), has killed this fix. Currently the situation is that new topics update the freshness on the front page, but replies don’t. The fix is still there in the theme, but it doesn’t seem to be being triggered. Any ideas?


    Robin W
    Moderator

    @robin-w

    try dashboard>tools>forums>repair forums

    and run as needed.

    this may get it back, and then use

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>bug fixes and use that fix.


    masoud180
    Participant

    @masoud180

    Thanks it worked for me


    Robin W
    Moderator

    @robin-w

    great !

Viewing 20 replies - 1 through 20 (of 20 total)
  • You must be logged in to reply to this topic.
Skip to toolbar