Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://drupal.org/project/fivestar" rel="nofollow noreferrer">Fivestar</a>, and <a href="http://drupal.org/project/userpoints" rel="nofollow noreferrer">User Points</a> could be used for the purpose, but you only get something similar to Stack Overflow.<br> The first module (which requires <a href="http://drupal.org/project/votingapi" rel="nofollow noreferrer">Voting API</a>) can be used to allow the users to vote, and the second module can be used to transform the votes in points for the users who voted (among other things — the module is not limited to this). To integrate the two modules, there is another module, but I am not sure it's part of "User Points", or <a href="http://drupal.org/project/userpoints_contrib" rel="nofollow noreferrer">User Points Contributed modules</a>.</p> <p>The problem with Fivestar is that users are allowed to give a vote from 1 to X (I think the maximum vote can be changed), which is different from the voting system used by Stack Overflow, where users can simply report "I like it", or "I don't like it". With Fivestar there would be only positive votes, and nobody would be able to down vote a comment, or a node; it would be possible to lower the average by giving the minimum vote.</p> <p>Between the modules I listed, there isn't a module that allows to give points to the author of the node / comment; using "Voting API", and "User Points" it would possible to do that, but no module I looked allows to do it (this means that you could probably write a custom module).</p> <p>If you look at the <a href="http://drupal.org/node/656992" rel="nofollow noreferrer">list of the modules</a> included in the installation profile <a href="http://drupal.org/project/arrayshift" rel="nofollow noreferrer">ArrayShift</a>, you can get an idea of the modules you can use to reach the same purpose.<br> The list of modules includes</p> <ul> <li><a href="http://drupal.org/project/nodecomment" rel="nofollow noreferrer">Node comments</a>, which transforms comments in full nodes; with this module, in example, is possible to use a voting module that works only for nodes with comments too.</li> <li><a href="http://drupal.org/project/votingapi" rel="nofollow noreferrer">Voting API</a>.</li> <li><a href="http://drupal.org/project/vote_up_down" rel="nofollow noreferrer">Vote UP/Down</a> that allows users to up vote, or down vote.</li> <li><a href="http://drupal.org/project/userpoints" rel="nofollow noreferrer">User Points</a>.</li> <li><a href="http://drupal.org/project/as_support_modules" rel="nofollow noreferrer">ArrayShift Support Modules</a>; it is probable that this module contains code that allows node authors to get points every time a node they created is voted.</li> </ul> <p>In particular, a module that is part of <a href="http://drupal.org/project/as_support_modules" rel="nofollow noreferrer">ArrayShift Support Modules</a> (as_tweaks) contains the following code:</p> <pre><code>/** * Below, a bunch of simple hook implementations that award userpoints based * on various events that happen. In theory, Rules module and various other tools * could be used to do these things, but most of those modules don't have easy * to export/import configuration data. */ // VotingAPI hook. When a user casts a vote on a node, the author should // get/lose points.. function as_tweaks_votingapi_insert($votes) { foreach ($votes as $vote) { if ($vote['content_type'] == 'node' &amp;&amp; ($node = node_load($vote['content_id']))) { // Award the points userpoints_userpointsapi(array( 'uid' =&gt; $node-&gt;uid, 'points' =&gt; $vote['value'] * 10, 'operation' =&gt; 'vote up', 'entity_id' =&gt; $node-&gt;nid, 'entity_type' =&gt; 'node', )); } } } // VotingAPI hook. When a user casts a vote on a node, the author should // get/lose points.. function as_tweaks_votingapi_delete($votes) { foreach ($votes as $vote) { if ($vote['content_type'] == 'node' &amp;&amp; ($node = node_load($vote['content_id']))) { // Award the points userpoints_userpointsapi(array( 'uid' =&gt; $node-&gt;uid, 'points' =&gt; $vote['value'] * -10, 'operation' =&gt; 'vote up', 'entity_id' =&gt; $node-&gt;nid, 'entity_type' =&gt; 'node', )); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload