condition inside template.php (if logged_in/logged_out and else)
This should help you out. Drupal user login - How to tell if a Drupal user is logged in (authenticated)

You can also use the utility variable $logged_in: Returns TRUE if the user is registered and signed in.

Updated answer.

In template.php, you can use global $user; to check and see if someone is logged in.

global $user;    
if (isset($user-&gt;roles[1])) {
  //Put code here.
}


Checking against Devel, you can see that $user-&gt;roles[1] means it's an anonymous user.