[buddypress-trac] [BuddyPress] #4310: Members Profile Shows "active sometime ago"

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Thu Jul 12 11:46:32 UTC 2012

#4310: Members Profile Shows "active sometime ago"
 Reporter:  frank13                        |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Core                           |     Version:  1.5.6
 Severity:  normal                         |  Resolution:
 Keywords:  needs-patch reporter-feedback  |

Comment (by boonebgorges):

 > Below is the correct code to make the bp_core_time_since() work properly

 The operative change here is that you're converting `$newer_date` into
 UTC. But you should not need to do this: bp_core_current_time() is
 *already* UTC. You are double converting. For instance, for UTC 1230
 (8:30am Eastern time), you are running it through gmmktime as if it were a
 local time. Thus, if I'm understanding correctly, it's *adding* 4 hours,
 to give you the equivalent of UTC 1630.

 The fact that this works for you means that one of the following two
 things are happening:

 1) last_activity items are being recorded with a date that is off by 8
 hours; or
 2) bp_core_current_time() is giving you a local time rather than UTC

 It seems like, in the discussion above, we've ruled out both
 possibilities. But they seem like the only possibilities, given the new
 code you've posted.

 It sounds as if we may not get to the bottom of this. I highly, highly
 suggest that you move your core modifications to a filter, either on
 `bp_core_current_time`, or on the template functions
 `bp_get_last_activity` and `bp_member_last_active`. If you leave the
 current fix in place, it will be overwritten every time you update

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4310#comment:21>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list