How to print a block in node.tpl.php only for admin? What is the simplest code that checks if user is admin and then prints a block to that user in node.tpl.php? I have seen different examples, but they are all either complicated and deal with other problems at the same time or they include editing template.php, which I want to avoid. I have tried with this, but it doesn't work:

&lt;?php if ($is_admin-&gt;true): ?&gt;
&lt;?php print views_embed_view('myview','block'); ?&gt;
&lt;?php endif; ?&gt;


Is there such a simple way to achieve this?
You can do something like this:

global $user;
if (in_array('admin', $user-&gt;roles)) {  //if not "admin", maybe "administrator"?

}


Or you can use the built-in block access control, under your block's configuration you'll see "Visibility Settings" and in there is a way to restrict by user role. 

Edit: what the hell, it's friday and I'm bored.   

Take this in small steps before you conclude it's "not working".

Step 1) 

global $user;
if (in_array('admin', $user-&gt;roles)) {  //if not "admin", maybe "administrator"?
    echo "&lt;hr&gt;admin user!&lt;hr&gt;";
}


If that works, then start making it more complex.  This is the best way to learn how to do new things, especially with PHP since you get to see your stuff immediately!