[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 12:24:38 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 frank13):

 Replying to [comment:21 boonebgorges]:
 > > Below is the correct code to make the bp_core_time_since() work
 > 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

 Thanks @boonebgorges. I have a lengthy and detailed document that itemizes
 all the core changes I have made. I have needed to re-apply them twice now
 as I have upgraded WP and the BP Plug-in. I am a newbie to adding filters
 and learning along the way. I want to put all my hacks into custom
 overrides so I don't have to mod core files each time I do an upgrade, but
 I am not clear on where, how, when to do filters. Limping along as we
 go...thanks again.

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

More information about the buddypress-trac mailing list