"I like this" module based on plus1

mariano.barcia - September 10, 2009 - 08:01
Project:Plus 1
Version:6.x-2.6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

We've built this simple "I like this" module for one of our projects, and I'd like the maintainers of Plus1 to evaluate if this code could be added/integrated to Plus1 as an option in order to provide the "I like this" feature (as seen on Facebook).

I personally consider this "I like this" would be a nice addition to Plus1, and I don't think it should be _another_ module on d.o.

Attached you'll find the module, for you to review and for anyone who may be needing such a feature quick ;-)

Thanks in advance, I'll be looking forward to your comments.

AttachmentSize
i_like_this.zip9.81 KB

#1

voxpelli - September 10, 2009 - 09:45

What is it that this add to Plus 1 that isn't already in Plus 1? Is it only the text that has changed or is it more? Can you provide screenshots or other more detailed description?

#2

mariano.barcia - September 10, 2009 - 10:18

Well, there is the text, and the text placed in the links area, with the proper links structure. See attached sshot.

PS: The previous zip was not working. Please try with this one, should fix the problem. Thanks.

AttachmentSize
i_like_this.zip 9.77 KB
FireShot Pro capture #073 - 'Travel Pulse I The travel network' - www_playgroundsoftheworld_travel_pulse_page=1.png 154.41 KB

#3

mariano.barcia - September 10, 2009 - 10:20

bad sshot filename, renaming...

AttachmentSize
i_like_this.png 154.41 KB

#4

voxpelli - September 10, 2009 - 10:56

What has been changed in the link structure?

I feel that what this feature request is ultimately about is to be able to specify custom texts for the different states of the Plus 1 link - preferably token-enabled texts. I don't remember if and how we currently do that in Plus1 though.

Perhaps we could take some inspiration from how the Flag module does this?

#5

mariano.barcia - September 11, 2009 - 08:19

The "I like this" module makes use of the hook_link to position the link (that's the "links structure" I was referring to). It resembles the same functionality in Facebook. Fivestar does something similar, just that it places the 5-star widget there.

IMHO, is more natural to most people to express "I like it" than to express "vote" or "subscribe". Both ways end up casting a vote in the voting API, but they are 2 different ways of approaching the end user.

I didn't provide a patch to Plus1 because it was quicker to assemble a separate module.

Based upon this module, I can suggest guidelines for a patch to Plus1 that would add value to the module:
In the settings, add
- Choose the style
1. Plus1
2. I like this

Then,
- test in hook_nodeapi for the style selection, only show Plus1
- test in hook_link for the style selection, only show "I like this"
- modify the JS file to accomodate both cases, with a big IF or modifying the find() to work with both markup structures.

What do you think?
HTH, cheers

#6

madjr - October 28, 2009 - 14:50

well i will be using both styles

i really like +1 for comments (specially useful in forums where users "+1" other users)

for pictures and similar nodes i'll be using "i like this"

so if they're ever integrated then selecting the style for each content-type/comments would be a huge plus :)

anyway am not really sure if using both at the same time would conflict with drupal or the database..

#7

youkho - November 24, 2009 - 19:58

Thanks for this little module could you please add reverse as when "i like this" i can also click "i don't like this anymore"

 
 

Drupal is a registered trademark of Dries Buytaert.