Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Freshness


  • melodies
    Participant

    @melodies

    On my forum, the timestamp on the posts are 7 hours in the past.
    When a new post is made, it starts at “7 hours ago” rather than “just now,” “1 minute ago,” etc.

    The general time is set correctly in the WP > Dashboard > settings and all other timestamps displayed across the site are accurate (messages, notifications, etc). Only notifications relating to bbPress are off by 7 hours.

    This same issue can be found in an old thread post (Link below):

    The time zone is off by 7 hours in my bbpress plugin forums

    However, the solution in that post is outdated, since the code layout in has changed, and “line 178 in /wp-content/plugins/bbpress/bbp-includes/bbp-common-functions.php” no longer exists for manual alteration.

    Can you please tell me which file I can edit in bbPress to manually subtract 7 hours from the freshness output timestamp of all future forum posts?

    Thank you.

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

  • Robin W
    Moderator

    @robin-w

    suggest you try this in your functions file

    add_filter ('bbp_convert_date', 'rew_convert_date', 10 , 3 ) ;
    
    function rew_convert_date ($time, $d, $translate) {
    $d = 'G' ;
    $time = mysql2date( $d, $time, $translate );
    return apply_filters( 'rew_convert_date', $time, $d, $translate );
    }

    may or may not work !


    melodies
    Participant

    @melodies

    Hi @robin-w,

    Thank you for the suggestion.
    I tried it in my theme’s function.php file, but it did not work.

    Was that the correct functions file to try it in?


    Robin W
    Moderator

    @robin-w

    correct place – I was guessing at whether the code will work, I’ll take a further look at it if I get a chance


    melodies
    Participant

    @melodies

    Hi @robin-w,

    Alright, thanks. I will appreciate it.


    melodies
    Participant

    @melodies

    I know that changes made directly inside the bbPress plugin will be overridden during the next update, but I’m just wondering if in the meantime there is a line of code I could change within the plugin as a temporary fix?

    …Similar to the way the person who was experiencing the same problem in the link provided above did, stating: “In my case (Pacific Time) I needed to subtract 7 hours which translated to 25200 seconds” and made the temporary fix directly inside his install of the plugin.


    melodies
    Participant

    @melodies

    Hi @robin-w,

    Did you get a chance to take a further look at this?

    I noticed that if I change the “Dashboard > Settings > General” timezone to UTC+0, bbPress starts displaying the correct time freshness, but all other timestamps across the website become incorrect, because UTC+0 is the incorrect timezone for the website’s location. It should be UTC-7.

    Please tell me how I can apply the “UTC+0” timezone exclusively to bbPress alone, so that it starts displaying the correct freshness?


    Robin W
    Moderator

    @robin-w

    sorry, I’m buried in paid work at the moment – I’d love to find some time to work on this, but none available!

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