Download & Extend

Integrate VotingApi with Activity module

Project:Voting API
Version:6.x-2.3
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Issue tags:activity2-integration

Issue Summary

Hello,

It will be cool if we could integrate VotingApi in Activity module.

I'm not a developer, so I can't help a lot... :(

Activity module provide an extensible API to allow other modules to integrate by using Activity hooks.

Here the Activity issue about integrate VotingApi to Activity #455906: Integration with Votingapi.

I attach DEVELOPER.txt file from Activity module.

I hope someone could help :)

AttachmentSize
DEVELOPER.txt8.66 KB

Comments

#1

Title:Make VotingApi work with Activity» Integrate VotingApi to Activity module

#2

Title:Integrate VotingApi to Activity module» Integrate VotingApi with Activity module

#3

Status:active» needs review

Here is a patch for it. So it provides the following features
1.) Record voting api activity to streams for node and comment content_types (users are hard, will come back to why later).
2.) After User A votes on the node 14, all Activity around that node 14 can be placed in that User's A Activity stream via Activity Access Votingapi: User voted on node.
3.) After User A votes on comment 34, all Activity around that comment can be placed in User's A stream via Activity Access Votingapi: User voted on same Comment
4.) After User A votes on comment 65 on node 17, all Activity around node 17 can be placed in User's A stream via Activity Access Votingapi: User voted on node.

User voting activity is hard, because of Token. Using token, you can only have one 'user' object for the entire string. So in this case, the 'user' object is the user who does the activity. See votingapi_activity_objects_alter(). So it becomes a little complicated.

#4

forgot the patch.

AttachmentSize
votingapi_564904-3.patch 4.97 KB

#5

Added the tag so i can find this again

#6

typo in the table name (comment != comments)

AttachmentSize
votingapi_564904-6.patch 4.67 KB

#7

Reroll, as the hook_activity_grants() arguments changed.

AttachmentSize
votingapi_564904-7.patch 5.09 KB

#8

Forgot the --no-prefix and --relative arguments to git diff for this. Here is the reroll

AttachmentSize
votingapi_564904-8.patch 4.79 KB

#9

Tested and working fine
Nice feature for Voting API
Thank you.

#10

Status:needs review» reviewed & tested by the community

Trying this out for a new site we're building and it is working very well. I think this is well worthy of inclusion.

#11

Yo, great work for community site. Thanks a lot

#12

Works well for me. What can we do to get this integrated in voting api?

#13

Hello,

Just at least try this patch but I can't really have what I would like:

How to display the value of the user vote with the activity message?

For exemple:

[user] has given [value] to [title].

Right now: I can only have: [user] has vote [title] and the activiy message is displayed only on node author profile not in the user profil who give the vote.

#14

This would be ultimately awesome.

A big SUBSCRIBE right here is a must.

#15

Please don't subscribe without trying it out. Its really easy to apply patches: http://drupal.org/patch/apply

Votingapi issues take a long time to get in.

#16

Sorry Scott, i was refering to this:

Just at least try this patch but I can't really have what I would like:
How to display the value of the user vote with the activity message?
For exemple:
[user] has given [value] to [title].
Right now: I can only have: [user] has vote [title] and the activiy message is displayed only on node author profile not in the user profil who give the vote.

I subscribed because that is what i need for my project, and for what i understand this is not possible yet.
If it is, please tell me. I will CERTAINLY try it out and give all the feedback i can.

----
...thinking about it, i believe this is possible, and is not very hard to accomplish, but some php/mysql knowledge would be needed.
I'll see what i can do, i will try to do this next week.

#17

just need to write an hook_token_info and hook_token_value for those things.

Its just token integration not activity integration that is missing from what you would need.

#18

Oh, OK.
Do you have any plans to write this functionality Scott?

Regards.

#19

Anyone available to walk me through setting this up? I don't see how it's possible right now. When someone votes for a story, I want it to generate an activity item.

#20

Hi, Scott,

I've applied the patch from #8. I can now create activity publishing templates for when someone votes for a story.

However, they're not showing up in my activity view. Do I need to add a specific relationship or something to my view to get them to appear in the feed? Thanks.

#21

Tested the patch. Works. Great work Scott! The issue I have is that I can't create separate activity feeds for comments and votes on the same node. So let's say I have two activity templates defined:

1. When User votes on Article, then activity feed should say: User A voted on Article 1.
2. When User comments on Article, then activity feed should say: User A commented on Article 1.

When the user votes, it appears as a comment (i.e., only the second template gets displayed).

Ideas?

Jim

[UPDATE] -- Never mind, it seems to be working now.

#22

subscribe thx!

#23

nice, is this in DEV version now?

#24

Ya is this in the developer version now?