Getting og membership type in template.tpl.php
Found the anwser:
This goes in node.tpl.php (tested on Drupal 7, Organic groups 7.x-2.3)

&lt;?php if (og_context()) {
  $group = og_context();
  $userid = user_load($node-&gt;uid);
  $roles = og_get_user_roles('node', $group[gid], $uid = $userid-&gt;uid, $include = FALSE);
  }
?&gt;


Then use it with something like: 

&lt;?php if(in_array('test member', $roles)): print '&lt;span&gt;Testuser&lt;/span&gt;'; endif; ?&gt;


For comments it's a little different:

&lt;?php if (og_context()) {
  $group = og_context();
  $roles = og_get_user_roles('node', $group[gid], $uid = $comment-&gt;uid, $include = FALSE);
  }
?&gt;


Works only on pages where groupcontext is available!