Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Omit time stamps from Activity/feed so only date stamps show


Roger Coathup
Participant

@rogercoathup

@pjnu – unfortunately those “time since” messages are embedded quite deep in the core template tags used by the default theme, and are not the most obvious to remove / change.

It can be done however.

The time since text is inserted by a routine called bp_insert_activity_meta() that’s called from the tags the default template uses: bp_activity_action() and bp_activity_content_body().

There’s no easy way to filter those tags to alter the time presentation [EDIT: perhaps there is – see other comments], so the easiest route is to modify your theme taking out the calls to bp_activity_action() and bp_activity_content_body(), and replacing them with calls to get the parts of the message individually:

e.g. you can call bp_get_activity_date_recorded() to get the date as a datetime stamp which you can then format with the PHP date() function to display as you want it.

These template tags are all declared in bp-activity-templatetags.php

There’s no straight template tag to get the activity_action without the activity_meta (and timestamp) being added – so, we write our own function for that in bp-custom.php and call it from our theme:

function my_activity_action() {
global $activities_template;

return ($activities_template->activity->action);

}

You could do something similar for activity_content_body as well.

Here’s a snippet of what a modified activity/entry.php looks like in one of our themes:


<div class="activity-header">

<p class="metadata">
<?php if (has_delete_permissions()) {
echo bp_get_activity_delete_link();
} ?>

</div>

I hope that makes sense!

Skip to toolbar