Created
December 18, 2012 14:13
-
-
Save hanamizuki/4328301 to your computer and use it in GitHub Desktop.
A different method, get_user_count(), is used for counting the items a user has flagged. This method is less efficient than get_count() because an SQL COUNT query is issued.
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
$flag = flag_get_flag('votes') or die('no "votes" flag'); | |
// We assume an $account variable exists in this template. | |
print format_plural($flag->get_user_count($account->uid), | |
'This user has participated in 1 voting.', | |
'This user has participated in @count votings.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment