| 1 |
<?php |
<?php |
| 2 |
// $Id: nmoderation.module,v 1.27 2006/05/02 04:44:23 eaton Exp $ |
// $Id: nmoderation.module,v 1.28 2006/05/30 13:20:38 eaton Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 750 |
} |
} |
| 751 |
} |
} |
| 752 |
|
|
| 753 |
function nmoderation_votingapi(&$cache, $op, $arg3, $arg4, $arg5) { |
function nmoderation_votingapi_calculate(&$cache, $votes, $content_type, $content_id) { |
| 754 |
if ($op == 'calculate' && $arg4 == 'node' && nmoderation_is_votable(node_load($arg5))) { |
if ($content_type == 'node' && nmoderation_is_votable(node_load($content_id))) { |
| 755 |
//loop through the $votes collection and calculate the weighted value. |
//loop through the $votes collection and calculate the weighted value. |
| 756 |
foreach($arg3 as $vote) { |
foreach($votes as $vote) { |
| 757 |
if ($vote->value_type == NMODERATION_VOTE_TYPE && $vote->tag == NMODERATION_TAG) { |
if ($vote->value_type == NMODERATION_VOTE_TYPE && $vote->tag == NMODERATION_TAG) { |
| 758 |
unset($cache[NMODERATION_TAG][NMODERATION_VOTE_TYPE][$vote->value]); |
unset($cache[NMODERATION_TAG][NMODERATION_VOTE_TYPE][$vote->value]); |
| 759 |
|
|