Created
June 6, 2013 22:45
-
-
Save kevinchampion/5725611 to your computer and use it in GitHub Desktop.
Vote total for all characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode 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