Individual User activities block for D5
| Project: | Activity |
| Version: | 5.x-4.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
I've started a new queue for this under 5 dev since I've already started testing and maybe others will to. I just inserted the following
$block['user']['info'] = t("Activity (User): show activity of the user being viewed");
and
case 'user':
if (user_access('view public activity') && arg(0) == "user" && is_numeric(arg(1))) {
$uid = arg(1);
$author = activity_user_load($uid);
$activity = activity_get_activity($uid, NULL, variable_get('activity_block_'. $delta, 5) + 1);
if ($count = count($activity)) {
drupal_add_css(drupal_get_path('module', 'activity') .'/activity.css');
if ($count > variable_get('activity_block_'. $delta, 5)) {
$more_link = theme('activity_more_link', 'activity');
array_pop($activity);
}
$activities = array();
foreach ($activity as $item) {
$item['delete-link'] = activity_delete_link($item);
$activities[] = theme('activity', activity_token_replace($item), $item);
}
return array(
'subject' => t("@username's activity", array('@username' => $author->name)),
'content' => theme('activity_block', $activities)
);
}
}
break;
in 5.x-4.x under hook_block() the same way it appears in the 6 dev version.
This works except unlike the (logged-in) user version this one does not work with block_refresh.

#1
5.x unsupported please see 6.x-2