In my Drupal 7 site I want to display how many times user's content was flagged.
As option I want to set a global variable
counts and display it in different parts of
*.tpl.php files. The value can be calculated with
flag_get_counts($entity_type, $entity_id) for each user's
node_id. Function that calculates
counts should be called in
template_page_preprocess() to update value each time page is reloaded.
What is more efficient approach to implement this?