You are hereActivity Stream / sreiser's Activity Stream / Adding an ActivityStream block in Drupal

Adding an ActivityStream block in Drupal


Posted on May 16, 2008 at 00:05

As regular readers of my blog know I'm using Drupal's ActivityStream module to power the Life Stream page on my site.  I've wanted to add an activity stream block and remove the twitter / lastfm blocks for a while now, but haven't gotten around to it until tonight.  It's a short function but I figure I'll post it in case someone else is looking for it.

Just add the following function to activitystream.module

function activitystream_block($op = 'list', $delta = 0) {
if ($op == 'list') {
    $blocks[0]['info'] = t('Activity Stream');
    return $blocks;
}
else if ($op == 'view') {
    $block['subject'] = t('Activity Stream');
    $items = _activitystream_get_activity(null,false,15);
    $block['content'] = theme('activitystream',$items) .'<a href="/stream">more...</a>';
    return $block;
}
}

See original: iSeanReiser - ~ is where the <3 is Adding an ActivityStream block in Drupal



About Me

Welcome aboard!

I am a technologist, amateur photographer and social media enthusiast. I have a more detailed bio for the insanely curious. Share and Enjoy!

Web Footprint

Social Networks

Microblogging

Bookmarks and Links

Life Streams

Other