I am thinking that I can copy the example Heartbeat site activity module and change references heartbeat_example too whatever I want and that will create new streams and blocks which I can then make role specific. Am I right?

Or should I be making some sort of copy of the public heartbeat module.

Basically I'm trying to make a few extra heartbeat streams that will be filtered for specific heartbeat templates and then role specific. I tried making views for this purpose but had trouble getting the react fields to appear.

Am I on the right track?

Comments

BIGREDPAUL’s picture

Title: Can I just copy the exmaple module to make another heartbeat stream. » Can I just copy the example module to make another heartbeat stream.
Stalski’s picture

Status: Active » Fixed

Yes you could. Well, you don't copy the module, only the streams.

The only things you need to do to add a new stream, is :
- Register the class through yourmodule_heartbeat_register_access_types
- Create (or copy ) the class , overriding the methods you want to extend.

In your case, i would create several streams, all with specific queries. I would not use views since it does not follow the exact path.

See Documentation at http://heartbeat.menhireffect.be

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

b8x’s picture

how can i

Register the class

without module creation? i tried to copy useractivity.inc file in modules\heartbeat-7.x-1.0\heartbeat\modules\heartbeat_defaults\streams and rename it, and i create stream in UI admin/structure/heartbeat/streams with import
$heartbeatstream = new HeartbeatStreamConfig;
$heartbeatstream->disabled = FALSE; /* Edit this to true to make a default heartbeatstream disabled initially */
$heartbeatstream->api_version = 1;
$heartbeatstream->class = 'usercontentactivity';
$heartbeatstream->real_class = '';
$heartbeatstream->name = 'User content activity';
$heartbeatstream->module = 'heartbeat_defaults';
$heartbeatstream->title = 'User content activity';
$heartbeatstream->path = 'streams/content.inc';
$heartbeatstream->settings = array(
'messages_denied' => array(),
'show_message_times' => 1,
'show_message_times_grouped' => 1,
'poll_messages' => '0',
'num_load_max' => '100',
'grouping_seconds' => '7200',
'has_block' => 1,
'block_items_max' => '25',
'block_show_pager' => '0',
'page_disabled' => 0,
'profilePage' => 1,
'page_items_max' => '50',
'page_show_pager' => 0,
'page_pager_ajax' => 0,
);
$heartbeatstream->variables = array();.
and i get error Stream class usercontentactivity does not exist in streams/usercont.inc or it's not auto-included in yourmodule.info. why?