Negative amount and integration with Drigg

cedricfontaine - August 27, 2008 - 20:11
Project:Radioactivity
Version:5.x-1.2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello,

I'm adding radioactivity support in Drigg, in order to offer a way to promote scoops using votes and radioactivity.

I have two questions :

* Could I add a plugin to have energy depending on the vote value (+ or -) ? And is there any documentation about plugins ?
* Could I set a negative energy for negative vote ?

#1

skiminki - August 28, 2008 - 18:22

1) You can add a plugin depending on vote value. Use e.g. sources "vote_up", "vote_down". Unfortunately, there is currently no documentation on plugins, but you could use radioactivity_votingapi-plugin as a basis (~40 lines of code). The important function there is <module>_radioactivity_info(). You'd probably want something like

  return array('sources' => array('node' =>
                                  array('vote_up' => array('title_placeholder' => 'vote up'), 'vote_down' => array('title_placeholder' => 'vote down')),
                                  'comment' =>
                                  array('vote_up' => array('title_placeholder' => 'vote up'), 'vote_down' => array('title_placeholder' => 'vote down'))));

This declares sources vote_up and vote_down for both nodes and comments. In effect, you can set energy values for those in radioactivity admin.

2) You can set negative energy for negative vote. However, currently the energy for a node will not go below 0. This is something we might need to change in a future revision of radioactivity.

#2

cedricfontaine - August 28, 2008 - 19:07

Could you add this to the votingapi plugin then ?

AttachmentSize
radioactivity_300767_2.patch 1.49 KB

#3

skiminki - August 28, 2008 - 20:02
Status:active» needs review

I'm going to look into this shortly. Currently, radioactivity_votingapi provides most voted metrics, but what you're suggesting is radioactive voting. I wonder if these two should be different modules?

#4

skiminki - August 28, 2008 - 21:01

Committed: http://drupal.org/cvs?commit=136722

Implemented new radioactivity_up_down_voting module based on cedricfontaine's patch. This module differs from radioactivity_votingapi by that you can set different values for vote up and vote down.

cedricfontaine: Could you please test this and mark this issue as 'fixed' if it works for you?

#5

cedricfontaine - August 31, 2008 - 20:44

This does not work for me at all. It seems that it doesn't trigger when voting ? Did I miss something ?

#6

skiminki - September 7, 2008 - 15:10
Version:5.x-1.2-rc1» 5.x-1.2-rc2

Ok, renaming the module broke the votingapi insert because radioactivity_votingapi used actually wrong callback for votingapi, which just happened to work by accident. Fixed radioactivity_votingapi and radioactivity_up_down_voting in http://drupal.org/cvs?commit=138546 and this time I actually made the effort to test it myself before committing. Never skip testing even the most obvious change... my bad.

So, let's try this again, ok? You can download the fixed radioactivity_up_down_voting module directly from CVS via this link:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/radioactivi...

If this doesn't work for some reason, please tell the following:

  • your votingapi version
  • which voting module (+ version) do you use?

#7

skiminki - October 25, 2008 - 08:09
Status:needs review» fixed

#8

Anonymous (not verified) - November 8, 2008 - 08:11
Status:fixed» closed

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

#9

bflora - January 18, 2009 - 22:08
Status:closed» active

What's the story with this?

What I mean is that I'm using this module with Drigg. And my Drigg is set up to let people vote a node up or down.

Ok.

So when they vote up, I want it to add 5 energy points to the node. When they vote down, I want it to subtract 5 points.

1. I created a decay profile.
2. In the decay profile, I've got a place to enter in energy settings for the Drigg type node.
3. I've got 6 slots: Energy from node view - Energy from submitted comment - Energy from published comment - Energy from vote up - Energy from vote down - Energy from vote

What do I put in the last three slots to get this to work? Does a negative number in vote down subtract energy from a node? A positive number? Do I leave the last slot empty?

Thanks. I just want to understand how this works.

#10

skiminki - January 19, 2009 - 10:02

Energy from vote adds energy per any vote. This is used for most voted rankings and the use case there is a bit different. For Drigg-style voting (as described above), you'd use only energy from vote up and vote down, and ignore the last (Energy from vote).

I think I need to start compiling FAQ for this module ;)

#11

bflora - January 19, 2009 - 21:01

skiminki. Thanks for clearing up the Vote field mystery.

What goes in the vote down field? -5? 5? Something else?

#12

skiminki - January 20, 2009 - 06:39
Version:5.x-1.2-rc2» 5.x-1.2

That's something you may need to experiment with. Vote up = +5 and vote down = -5 could be a good starting point. See how it goes and whether that produces the results you like. Probably it does. I think that was the initial idea behind this feature, anyway. BTW, it shouldn't really matter if you use +5/-5 or +1/-1 or something like that, it's only about proportions, as long as the values are a somewhat higher than the cut-off energy.

You could also try:

  • Non-balanced +/- vote energies. Could be used to put some bias into one way or another.
  • Separate energy profiles for + and - votes. This could be interesting for some use cases, because then the + and - votes don't cancel each other out.

This said, I should probably confess that I don't use up/down voting and before cedricfontaine's initial issue report, I hadn't ever even considered about negative energies. ;)

#13

skiminki - March 28, 2009 - 20:25
Status:active» fixed

#14

System Message - April 11, 2009 - 20:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.