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.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | Screen shot 2011-05-22 at 3.38.26 PM.png | 104.88 KB | pribeh |
Comments
Comment #1
icecreamyou commentedAll you'd have to do is use Rules to record the message you wanted as a status when a node creation event occurs.
Comment #2
pribeh commentedHi 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(?).
Comment #3
icecreamyou commentedUsually 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.
Comment #4
pribeh commentedThanks Ice.
Comment #5
pribeh commentedOk, 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?
Comment #6
pribeh commentedK, 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.
Comment #7
icecreamyou commentedPresumably the recipient type you want is "user"? You're trying to create a message on a user's stream, right?
Comment #8
pribeh commentedHmmm. 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.
Comment #9
icecreamyou commentedThe 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.
Comment #10
pribeh commentedBear 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.
Comment #11
icecreamyou commentedYes. 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:
[node:author] created the new node '[node:title]'. These tokens are available because the Rule is responding to a Node event.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.
Comment #12
pribeh commentedThanks 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.
Comment #13
icecreamyou commentedYou could create a view that showed all statuses created by a given user, yes.
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.
Comment #14
pribeh commentedAh, 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.
Comment #15
icecreamyou commentedSure, 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?
Comment #16
pribeh commentedThe 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.
Comment #17
icecreamyou commentedWell, 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.
Comment #18
icecreamyou commentedAre you still working on this, or is this issue resolved?
Comment #19
pribeh commentedThis issue is resolved for sure. I will have to look at other ways of providing a proper Activity Log.
Comment #20
icecreamyou commentedComment #22
nyleve101 commentedHi,
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
Comment #23
nyleve101 commentedComment #24
icecreamyou commentedDon'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.