Hi,

I have an enquiry about potential functionality to be grabbed out of FBSS. Let me preface this: I've employed several different activity logging modules out there to combine the greatness of nodes and (FBS) statuses into one user (friend/follow) stream but I still feel like there could be a more integrated solution. Now that FBSS 3.x sports statuses that can be attached to nodes I have the following question:

Could FBSS 3.x be extended to support node activity logging?

Here's just one way I could imagine implementing such functionality: submodule that allows for the setting of some default status ("Joe posted ...") that then gets submitted during the node creation process. For user stream (activity log) display we then could use one of two options: FBSMP's new themed link option (http://drupal.org/node/883334#bookmarklet) to grab any extra node display data (like image or body text) or simply use a Views relationship to add node fields.

I'm just throwing this out there to see a) if anyone thinks this might not be too difficult to create, and b) if anyone might use this kind of functionality. I might be able to get some programmer help on this one.

CommentFileSizeAuthor
#14 Screen shot 2011-05-22 at 3.38.26 PM.png104.88 KBpribeh

Comments

icecreamyou’s picture

Category: feature » support
Status: Active » Fixed

All you'd have to do is use Rules to record the message you wanted as a status when a node creation event occurs.

pribeh’s picture

Hi Ice, I will do some more extensive testing with FBSS 3.x and report back my progress. Do you mind leaving the issue open until I've implemented exactly what I described? There may be a few more loops to jump through before I could say FBSS 3.x is potentially a complete activity logging solution. It might be nice so that, say, I even create a submodule to handle the rules configuration for this type of activity logging, I could then post it here for review and feedback from the community(?).

icecreamyou’s picture

Status: Fixed » Active

Do you mind leaving the issue open until I've implemented exactly what I described?

Usually I'd recommend keeping it "fixed" unless something else comes up, mostly because otherwise this kind of issue tends to stay open for months with no updates. However, I know that you're around and will follow up, so feel free to do whatever works best for you and let me know if you need any help.

pribeh’s picture

Thanks Ice.

pribeh’s picture

Ok, so I've tried the following ultra simple rule setup:

- an "Add a status" action upon "Saving New Node"
- The action simply contains the following:

RECIPIENT ID:
[author:uid]

RECIPIENT TYPE:
[status:recipient-type-name]

STATUS MESSAGE:
posted the [node:type-name]

But now nodes do not save - hence something is up. Is this perhaps because the [status:recipient-type-name] token is unavailable to rules based upon node events? Might I have to create a rules set, use php or something else perhaps?

pribeh’s picture

K, so now I've tried ...

- using "node" under "RECIPIENT TYPE:"

And now the node saves and a new status is added. New issues are:

- the username is recorded as "Anonymous" (no matter what [...:user] token I use).

So once I resolve this issue I'm going to check to see if this is the proper way to do this. Then, looks like some sort of node relationship needs to be added to FBSS to allow the display of any node related data. Either that or I'll see if I can get FBSMP to load that data.

icecreamyou’s picture

Presumably the recipient type you want is "user"? You're trying to create a message on a user's stream, right?

pribeh’s picture

Hmmm. I am trying to create a user stream but I need to make sure that the status can pull data from the node and/or a group. Is this not the use of the recipient type? Isn't this what allows the status to know it's connected in some fashion to a node?

I want the status to show up in various streams (user for one) but it's to function just like an Activity (module) template.

icecreamyou’s picture

The recipient type is the type of the recipient of a status update. If you want to post a status message to a node, then the recipient type is "node," and the status message will appear in the node stream. FBSS has no concept of a status being "about" a node.

pribeh’s picture

Bear with me, I'm just trying to understand the new structure of FBSS, how it uses context and what this recipient type means.

So, say I setup the status form to allow statuses to be posted on nodes (via the node stream recipient type). If a status is posted on a node (via the status form) isn't there some info being stored (in some table) that tells the status which node it relates too? I was under the impression that's how we get statuses to show up in specific OGs and other nodes.

icecreamyou’s picture

Yes. When you post a status message to a node stream it stores which node is the recipient of that message. (In the database, the "type" column would have the value "node" and the "recipient" column would store the NID.) However each record in an activity log presumably needs a user as the recipient because otherwise it won't show up on that user's stream.

What you can do is the following:

  1. A user "Joe" creates a new node with title "My new node."
  2. The Rules event for node creation is triggered.
  3. You set up a rule that responds to the node creation event by creating a new status update. This status update is your activity log record.
  4. The new status update that your rule creates has the user who should see that activity log record as the recipient. The message could be something like [node:author] created the new node '[node:title]'. These tokens are available because the Rule is responding to a Node event.
  5. On Joe's status stream, he now sees the message "Joe created the new node 'My new node.'"

You can do this with any event, not just node creation -- the idea being that the event itself provides all the information you need about the source of the activity. FBSS can only store the text though, and won't have any idea what node the status is about after the status is saved.

pribeh’s picture

Thanks for the help Ice. But is it really necessary to employ the user recipient type to show a user their own statuses? The status/activity log simply needs to have been created by the same user that created the node in order for views to know to display it via a filter/argument - correct?

I ask this because other than using the node as recipient type I'm not sure how to tell views which node/nid a status belongs too.

icecreamyou’s picture

But is it really necessary to employ the user recipient type to show a user their own statuses? The status/activity log simply needs to have been created by the same user that created the node in order for views to know to display it via a filter/argument - correct?

You could create a view that showed all statuses created by a given user, yes.

I ask this because other than using the node as recipient type I'm not sure how to tell views which node/nid a status belongs too.

Views won't know which node a status is referencing anyway. It's not possible to create a relationship from the facebook_status table to the node table because the value in the "recipient" column is not exclusively NIDs (it's also UIDs, TIDs, etc.). You could write custom Views fields that run an extra (sub)query per instance of the field, but that's suboptimal and a lot of work if you have a bunch of fields you want.

I guess I'm not seeing why you would even need that though when you could just save exactly the message you wanted to see in the status itself.

pribeh’s picture

StatusFileSize
new104.88 KB

I guess I'm not seeing why you would even need that though when you could just save exactly the message you wanted to see in the status itself.

Ah, that's because I want to create statuses that resemble the attached image. I would love to be able to pull in node fields for display somehow. Currently, I use the Activity module and then a node relationship in an activity view that allows for me to display in those fields.

icecreamyou’s picture

Sure, but is there a reason you need to do that dynamically in Views instead of using tokens in Rules to save those fields in the status text?

pribeh’s picture

The main reason I guess is that the content is dynamic and thus could change. Users often edit content, add new images or replace text. I can imagine users beginning to ask questions as soon as the content displayed in the feed does not change to reflect their alterations. I already get enough users asking questions (complaining) about changes not reflected quickly enough as a result of caching.

icecreamyou’s picture

Well, it's not possible to do fields dynamically as explained in #13. So if that is a requirement for you then it looks like you can't build the kind of activity system you want on top of FBSS.

icecreamyou’s picture

Are you still working on this, or is this issue resolved?

pribeh’s picture

This issue is resolved for sure. I will have to look at other ways of providing a proper Activity Log.

icecreamyou’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

nyleve101’s picture

Version: 6.x-3.x-dev » 6.x-3.0

Hi,

I was using the solution outlined in this thread to post events as statuses and it worked perfectly. I've upgraded to 3.0 and the recipient type shows 'user profiles' which causes an issue when i save a rule as the recipient id i.e. [requester:uid] causes the error below when I try to save the rule. I believe the recipient id i was using before was just 'user' http://drupal.org/node/1159664#comment-4496508

'The Recipient ID must be a nonnegative integer.'

Is there a way to get around this?

Thanks,

Evelyn

nyleve101’s picture

Status: Closed (fixed) » Active
icecreamyou’s picture

Status: Active » Closed (fixed)

Don't reopen old support requests unless you're the original poster. If you need help, open a new support request and explain what other research you've done / how you've tried to fix your problem.