I have been looking all over for some sort of information that allows me to tie them all together. I have a pretty decent understanding of FB Style status / micropublisher so far and have the following set up.

*Panels 3.0 - as a page/url called stream
* A view in the center block of panels
** facebook_status_recent (Latest Status)
** Latest status is the default of this view
* Block in content type with Facebook-style Statuses , limited to page stream

all that works as you can see here, http://grab.by/89iL (tinygrab) url

what I dont get and or understand fully is how to use HeartBeat and Activity.

What im aming for is to allow status updates, which I have for the most part working..

What I would like is also that when a user posts a new node , lets call it foo that it shows up in this stream as well.

Something like

User submitted foo (teaser text) [comment box]

can someone shed a bit of light on how this process works and are both Heart Beat and Activity required?

Happy New Years!!

Comments

icecreamyou’s picture

Status: Active » Fixed

You need to use a Heartbeat or Activity view rather than a FBSS view. Both modules store records when any sort of action takes place and show those action-records in their own views. For either module you will need to set up triggers that record the messages you want when the actions in which you're interested occur.

gateway69’s picture

Hmm, so do i get the same features as the FB status bar and Micropublisher.. I guess im still trying to wrap my head around of activity's on the site can be in the same feed as the fb status w micropublisher (pics videos etc).

I was on the heart beat site reading some docs but still trying to figure out how they all work together. :)

icecreamyou’s picture

To get something like FB's old Application Bar: http://drupal.org/project/appbar

To get a micropublisher: FBSS + http://drupal.org/project/fbsmp

To get a feed of all activity on the site (nodes + statuses + ...): choose either Activity, Heartbeat, or Message. They all basically do the same thing, and if you have trouble understanding them, open an issue in their respective issue queues.

gateway69’s picture

IceCream thank you.. I like the app bar hadnt seen that. I create a bit of an extension to micropublisher, its not finished but code is on drupal, I have my FB style stream rocking, just need to insert activity..

Sorry last question, do you need heart beat and activity to work together or can I just use Activity ?

icecreamyou’s picture

The Activity module and the Heartbeat module do basically the same thing. You should choose one or the other, but not both.

demonrage’s picture

i have accomplished the same goal using Rules + FBSS / micropublisher.

you can tell rules this:

on publish a new node
do
save staus

and through views u can show all the activities users do on ur website. also i managed to use the same concept of rules to announce user friends if he write a new node or get registered to a new organic group

on publish a new node
or
user supscriped to a group
do
sace status

and with rules it have extra feature above other modules (activity + heart beat). it gives you all actions that user can do on a website and u can do statuses out of it, using tokens u can also customize the message of the status like (user1 has subscriped to group 123). and so on.

icecreamyou’s picture

#6 is another good solution, as long as you're okay with allowing users to edit the automatically saved status updates. (In the 3.x branch, permissions will be more granular so this won't be an issue.)

demonrage’s picture

is there a release date for the 3.x version, or when will we expect it to have a dev version ??

icecreamyou’s picture

The 3.x branch will have a dev version as soon as I confirm that the basic functionality works. I don't know when I'll have time to work on it though, and I don't know how long it will be before a full release.

gateway69’s picture

Thanks, any chance to write w tuturial on this or export your rules and views so others can look at what you did?

Cheers

demonrage’s picture

hello gateway69,

i'm intending to make a video tutorial of the whole fbss + its related modules (micropublisher, tags, etc...) along with views+user relationshiips + panels, so anyone can follow to achieve a successful facebook-like wall. it can take time but i'm on it.

terbs’s picture

Hello! I just tied FBSS + Heartbeat together. Here's how I did it. You'll need to know how to log events to the heartbeat stream. Then, you just need to override the theme_facebook_status_form_display() to accept parameters for a heartbeat instead of a view.

You can do it like this, the name of my theme is garden, so change that to your own theme name. I changed the $view argument to $heartbeat, which accepts the name of the stream, and use module invoke to bring in the heartbeat block associated with that stream.

/*Modify the function that returns the status update box to use a heartbeat block instead of a view*/
function garden_facebook_status_form_display($account = FALSE, $size = FALSE, $heartbeat = FALSE) {
  global $user;
  if ($account === FALSE) {
    $account = facebook_status_choose_owner(FALSE);
  }
  $selectors = module_invoke_all('facebook_status_refresh_selectors', $account);
  $output = '';
  $can_post = facebook_status_can_post($account, $user);
  if ($can_post) {
    $output .= '<div class="facebook_status_update facebook_status_update_main clear-block">'. drupal_get_form('facebook_status_box', $account, $size) .'</div>';
  }
  if ($heartbeat && module_exists('heartbeat')) {
    
    $rendered_heartbeat = module_invoke('heartbeat', 'block', 'view', $heartbeat);
    $output .= $rendered_heartbeat['content'];
    $selectors[] = '#heartbeat-stream-'. $heartbeat;
  }
  elseif (!$can_post) {
    $status = _facebook_status_get_status_fast($account->uid);
    return theme('facebook_status_item', $status);
  }
  if (!empty($selectors)) {
    drupal_alter('facebook_status_refresh_selectors', $selectors, $account);
    drupal_add_js(array('facebook_status' => array(
      'refreshIDs' => $selectors
    )), 'setting');
  }
  return $output;
}

then, wherever you want to show the status update box with the attached, auto-magically refreshing ajax heartbeat stream, you just do this

print garden_facebook_status_form_display($account, FALSE, "myheartbeatname");

hope this helps!

gateway69’s picture

excellent! thanks for the code, ill test it this weekend and see how it works.. thank you!

While I know and have been reading all though drupal forums and google searches, it seems that their is a need to display node updates into the fb stream with out having to do alot of work, granted it replicates heart/activity etc and its possible to add them in, just I guess everyone want the FB social graph which com binds all activities the users to into the stream, and of course filter them based upon friends.

anyhow, I do appreciate people posting in this thread and it has been helpfull.

icecreamyou’s picture

Re #12: Interesting. It would be cleaner and simpler to use a module instead of putting that in your theme -- in a module you'd only need 3 lines of code -- but it looks like your solution should work too. Of course you don't need any of that if you want to put the Heartbeat view immediately below the status update box; because if that's what you want to do, you can do it using the UI by changing the relevant FBSS setting.

Re #13: I'm not sure what seems so complicated about it. Heartbeat and Activity are both specifically designed to make it easy. You just need to keep in mind that you will be looking at a heartbeat or activity view, and not a status view that also has nodes.

gateway69’s picture

@IceCreamYou

I really think a lot of people struggle with figuring out how to create a nice combined feed of status updates, activity , with the nice FB status box up on the top. I wasnt saying it was hard and I think for most people who have worked with drupal , written modules etc can easly put something together, its the other 80% of the people that I think try and figure it out but get stuck.

anyhow, thanks again all for the help, im going to tackle my issue with making sure i have one nice feed of status, node updates, and the status update box in one page, of course i need to also filter it by UR.

gateway69’s picture

hmm, looking quickly at the code, does this insert heart beat updates into the FB stream.. aka

Status Update Box

Status Post
Heart Beat or Activity
Status Post with Pic
Status Post
Heart Beat

?

Status: Fixed » Closed (fixed)

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

alexmoreno’s picture

i like this solution, but, how do you put a message on the friends of the acting user?

Thanks.

alexmoreno’s picture

sorry, stupid question. Just all your friends will see the wall updates of the user, so the solution is simple putting a status in the acting user.

alexmc’s picture

Would it be possible to summarise this discussion in the wiki? http://drupal.org/node/1161064

I'd also like to know which of these options (Activity/Heartbeat/Rules) are currently possible in the D7 version of Statuses. My understanding is that Rules is not working yet - but if getting Heartbeat working maybe I don't need it?

Thanks all.

icecreamyou’s picture

Integration code is on the Heartbeat side, not the FBSS/Statuses side. I don't know if it works in D7.

marinex’s picture

Hi I have have one question to IceCreamYou:
you mentioned several times about "in a module you'd only need 3 lines of code". I would like to know what lines I need to put in a module?

Thanks M.

icecreamyou’s picture

This issue has been closed for a year and a half and is against a version of FBSS that is no longer actively supported. Anyone who has further questions should open a new issue and link to this one if it's relevant.

(@marinex: it really depends on what you want to accomplish; chances are you don't need any code at all.)

medev’s picture

Issue summary: View changes