Skip to:
Content
Pages
Categories
Search
Top
Bottom

Site Wide Activity stream not working

  • @bbrian017

    Participant

    My activity stream isn’t working.

    Stuff is staying up top for hours and hour and it’s not moving down like it should

    What’s going on here?

Viewing 25 replies - 26 through 50 (of 68 total)
  • @bbrian017

    Participant

    I’m currently running You are using WordPress MU 2.9.1. I had an update after I added that information.,

    Sorry about that and thanks for the suggestion.

    @bbrian017

    Participant

    Something I have also taken note of is as follows.

    I get a member sign up e-mail but when I get to the website is saying member registers 7 hours ago.

    But I only got the e-mail now.

    Perhaps that will help figure out the issue?

    @bbrian017

    Participant

    Also take note I just posted an article and it went behind a few older activities saying it’s more then 14 hours old but its’ not I just wrote it.

    Any suggestions on how to fix this?

    @boonebgorges

    Keymaster

    It sounds to me like your server time is off. Are you on shared hosting? You may want to contact your host and ask them to verify whether the system time is correct.

    @bbrian017

    Participant

    The system time is Arizona time.

    I don’t know what I should be asking them.

    But right now it’s set to I think Central time or wherever Arizona is.

    @bbrian017

    Participant

    When a user posts in a group forums it will say posted 29 minutes but on the mian site is says 7 hours, 29 minutes ago

    Any suggestions :)

    @bbrian017

    Participant

    I also noticed changing the time in the general settings section doesn’t affect the mian site.

    I posted a wire message testing @ -1 and it said posted 7 hours ago.

    I posted a wire message testing @ -7 and it said posted 7 hours ago.

    Just thought it might be important to know that.

    @nuprn1

    Participant

    I also noticed changing the time in the general settings section doesn’t affect the mian site.

    Same problem here but always 2 hours behind (using trunk builds, prior update at rev 2315 and it displayed the posted updated time properly)

    @bbrian017

    Participant

    This is turning out to be the issue of the year for me…

    Apparently there is no fix either

    Any suggestions?

    @bbrian017

    Participant

    After getting support from the wpmu team the issue might in fact be with buddy press.

    Please see the thread at wpmu, https://mu.wordpress.org/forums/topic/16374?replies=20

    Final answer so far,

    Brian, you’re facing a code issue it seems. Looking at the current trunk of BP anyway.

    When BP generates the text for the “[time] ago” stuff, it passes a time string into a function in bp-core.php called bp_core_time_since.

    In this function the date passed in is compared against a possible second value passed to the function. By default, that value is false.

    When the value is false, it gets the current time as a numerical value (like using the time() function) for the current time as GMT using gmdate to create a date string, which is then converted to a numerical time value.

    Here’s the problem. The time being passed into the function as the first parameter is the current server time, and not the GMT time. The second parameter to the function is not passed, thus defaulting to a false condition which then generates the value based on GMT.

    The two times (older and newer as the vars are labeled) are then compared.

    See the problem yet?

    Yes, that’s right. It’s comparing one time to another, but they aren’t in the same timezone.

    If is set as say, 7 hours behind GMT, the initial time passed into the function will be GMT -7. It then creates the current time as GMT without any offset to check against the time passed into the function.

    So, no matter what you do, you’re already at a 7 hour difference within this function, and it will show something currently added to the activity as being 7 hours ago even though it just happened right now.

    The times coming into this function either need to be in GMT, or when the time to compare against is created, it needs to be the server time.

    Whichever happens, they need to both be in the same timezone so that 5 seconds ago is 5 seconds ago.

    In summary, you don’t have a server problem, or an install problem. It’s a BP problem somewhere.

    @apeatling

    Keymaster

    All true, however bp_core_time_since() runs gmdate() on both time values, converting them to GMT regardless of the time zone.

    @bbrian017

    Participant

    Hi Andy,

    This is all way beyond be.

    Do you have any idea on how I can fix this issue?

    @andrea_r

    Participant

    Andy, I’ve been working with someone else havign this exact same issues, and here’s what we’ve narrowed down (if it helps).

    For instance:

    In bp-activity/bp-activity-templatetags.php, about line 491 or so: bp_activity_insert_time_since();

    That function returns a value through a filter, which has a value created by the function bp_core_time_since();

    That function is is ./bp-core.php, around line 1329 or so.

    In this function, something quirky is going on, but not “always”.

    Thus far, it only seems to be related to activity updates, although it could be more?

    (Just created a group, it did it too, and shows 6 hours ago in the activity feed.)

    So, I’m putting some echo’s and a die in the time_since function.

    Here’s the output:

    date passed: 1264065210

    As passed into function. ($older_date)

    date strtotime: 1264065210

    The date passed is run through this:

    <?php $older_date = strtotime( gmdate( 'Y-m-d H:i:s', $older_date ) ); ?>

    This does nothing to the date passed. The string is the same.

    newer_date: 1264086810

    This is generated if there is not a $newer_date passed into the function to compare the older_date to.

    Code:

    <?php $newer_date = ( !$newer_date ) ? ( strtotime( gmdate( 'Y-m-d H:i:s' ) ) + ( 60*60*0 ) ) : $newer_date;?>

    This produces, for the first time, a different time string, which is 21600 seconds ahead of the current server time.

    since: 21600

    The difference between the newer_date, and the older_date.

    21600 seconds, or 6 hours, which is the difference between my server time and GMT.

    current_time: 1264065210

    This is just time() from the server. (Matches what was passed in)

    – The date passed into the function is the current server time.

    – The “newer_date” is generated as GMT.

    So now, the question is this.

    Theoretically, if the server time is ahead of GMT, the following will fail:

    <?php if ( 0 > $since ) ?>

    This is checked right after the difference between the date passed (older_date) and the newer_date.

    As the date passed in would be ahead of GMT (current server time), and newer_date will always be GMT if it is created within the function.

    Soooo…… does this look trac worthy? :)

    @mikepratt

    Participant

    @andrea_r I just did a test on my bleeding edge dev instal and got the exact same results. Then onto a test on testbp.org and saw no problem. Either @andy is using a server setting that masks the problems or the rest of us are doing something wrong. As a point of ref, I keep my dev site clean at first to see the default out of the box and this test was on a completely unadulterated install & theme.

    @msheu

    Participant

    Not sure if I can contribute, but I also have this problem.

    WPMU 2.9.1.1

    BP r2400

    In wp_signups a user has

    activated: 2010-01-22 03:06:39 (GMT)

    In wp_bp_activity it’s

    date_recorded: 2010-01-21 19:06:39 (America/Los_Angeles)

    In the activity stream is say “8 hours ago.” I’m not sure what the code does but it seems that when the time is moved to the activity table it’s converted to local time rather than staying in GMT.

    If I manually update wp_bp_activity to

    date_recorded: 2010-01-22 03:06:39

    the activity stream works as normal.

    Hope that makes sense and helps.

    @windhamdavid

    Participant

    andrea may be on to something there, this one’s got me too. I’m having the same issue. mu 2.9.1.1 + rc2406 – i know there had been some ‘time’ server bugs previously, but i’m duplicating easily. Replies within the activity stream itself are fine, but regardless of wp time settings or server settings, the bp_core_time_since is off.

    @apeatling

    Keymaster

    Hmm, if we can get all this in trac and I’ll see if I can get it fixed, strange. Thanks for the debugging info andrea_r very useful.

    @windhamdavid

    Participant

    @bbrian017

    Participant

    Alright guys I’m pretty excited to get this fixed thanks so much for coming and posting here Andrea_r.

    So when we say tracking this means were going to start watching for this issue?

    how long does something need to be tracked before a fix is found normally?

    Thanks,

    Brian

    @bbrian017

    Participant

    Guys I noticed that ticket was closed…

    I seen you linked to another ticket that was the same, https://trac.buddypress.org/ticket/1641

    I also see a file attached.

    is that file a fix?

    @developdaly

    Participant

    @Bbrian017 That ticket is still open which means it isn’t fixed yet. I attached a screenshot to that ticket just to help clarify the situation I was having, which is exactly what you’re experiencing.

    I’m browsing through the code to see if I can fix it, but it’ll probably take someone a lot smarter than me. Don’t fret though, it will be fixed in due time.

    @andrea_r

    Participant

    Hey, it’s not all me. I’ve been knocking my head together with another dev (not Ron, he’s too busy) to try and figure this out.

    Still doing some tests, still coming up weird. Took the code out of WP & BP entirely, and it worked just fine.

    @windhamdavid

    Participant

    @bbrian017

    Participant

    Hi Guys, I see there is a change set file to download.

    Should I download that and overwrite the files on my server?

    Thanks,

    Brian

    @windhamdavid

    Participant

    Yes!… i’ve tested that update backwards and forwards.. it will fix your issue.

Viewing 25 replies - 26 through 50 (of 68 total)
  • The topic ‘Site Wide Activity stream not working’ is closed to new replies.
Skip to toolbar