Created
December 18, 2012 14:12
-
-
Save hanamizuki/4328288 to your computer and use it in GitHub Desktop.
Getting the number of times an item is flagged
Whenever an item is flagged, or unflagged, a counter field is updated. To read this counter, use the get_count() method:
This file contains 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
<?php | |
$flag = flag_get_flag('votes') or die('no "votes" flag'); | |
print "The number of people who voted for this proposal:"; | |
print $flag->get_count($node->nid); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment