How do I check if the user is watching the front page or the user is logged in? I like to have the same result in a template if the user is logged-in or is on the front page.

So if the user is not logged-in nor on the front page, it should be the same result as if the user is logged in and not on the front page.

I got 

&lt;?php if ($logged_in): ?&gt;

Do something

  &lt;?php else: ?&gt;

Do Something Other

&lt;?php endif; ?&gt;


How to extend this to force drupal to do the same on front as for the logged in user if the user is not logged in but viewing the front page 

In other words how to get if drupal_is_ _on_front OR  $logged_in 

elseif

I am a php newbee 

thank you for an explanation
I think you will want the following:

&lt;?php if ($logged_in || $is_front_page): ?&gt;
    Do something
&lt;?php endif;?&gt;