I have an idea for a type of voting system where I would create basically a YES flag and a NO flag. What I would like to show on the page is the mathematical sum of (YES count) - (NO count) so if a node had 9 yes clicks and 4 no clicks, the number 5 would show on the page. Is that possible?

Comments

quicksketch’s picture

While technically possible, it's not a build-in feature of Flag. You can use the flag_get_counts() function to accomplish what you're attempting.

In your node.tpl.php (or preferably tempate.php, if you preprocess the variable) you can do something like this:

$counts = flag_get_counts('node', $node->nid);
print $counts['flag_a'] - $counts['flag_b'];
esllou’s picture

Status: Active » Closed (fixed)

yes, it's too complicated an idea to be fair. Wouldn't be able to make Views with the counts anyway. Thanks.