You are here

function radioactivity_votingapi_votingapi_insert in Radioactivity 6

File

plugins/radioactivity_votingapi.module, line 28
VotingAPI support for radioactivity

Code

function radioactivity_votingapi_votingapi_insert($votes) {
  require_once drupal_get_path('module', 'radioactivity') . '/radioactivity.inc';
  foreach ($votes as $vote) {
    $oclass = $vote['content_type'];
    $oid = $vote['content_id'];
    switch ($oclass) {
      case 'node':
      case 'comment':
        radioactivity_add_energy($oid, $oclass, 'vote');
    }
  }
}