Skip to content

Instantly share code, notes, and snippets.

@kevinchampion
Created June 6, 2013 22:45
Show Gist options
  • Save kevinchampion/5725611 to your computer and use it in GitHub Desktop.
Save kevinchampion/5725611 to your computer and use it in GitHub Desktop.
Vote total for all characters
if (module_exists('content_vote')) {
$votes = content_vote_retrieve_vote_totals($node->nid);
}
if (module_exists('massrel_voting')) {
$tweets = massrel_voting_retrieve_vote_totals($node->nid);
}
foreach ($characters as $character) {
if (isset($votes[$character->nid]->total)) {
$total = $votes[$character->nid]->total;
}
else {
$total = 0;
}
if (isset($tweets[$character->nid]->count)) {
$total += $tweets[$character->nid]->count;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment