Count flags on user's content
The right way is using template_preprocess_node().

Place the following code in template.php of your front end theme:

function YOUR_THEME_preprocess_node(&amp;$vars) {
  // I suppose you don't want to do this for every content type on the site.
  switch ($vars['node']-&gt;type) {
    case 'YOUR_CONTENT_TYPE':
      $vars['count'] = flag_get_counts('node', $vars['node']-&gt;nid);
      break;
  }
}


This will make the $count variable available in .tpl.php files that are used for displaying nodes of your content type.