How to theme a flag for different pages?
Something like this will work for user pages. You can adapt for other pages. Put it in your theme's template.php file.

function MYTHEME_preprocess_flag(&amp;$variables) {
  if ($variables['flag']-&gt;name == "MACHINE_NAME_OF_FLAG") {
    if (arg(0) == 'user') {
        $variables['theme_hook_suggestions'][] = 'flag__user_page';
    }
  }
}


and the template file name then becomes

flag--user-page.tpl.php