Skip to content

Instantly share code, notes, and snippets.

@hanamizuki
Created December 18, 2012 14:12
Show Gist options
  • Save hanamizuki/4328288 to your computer and use it in GitHub Desktop.
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:
<?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