2 Answers
2

I assume you need to hide the Authored by part basing on some conditions you check at run-time. If you need to hide that only for a content type, for example for the Article content type, then you can change settings in admin/structure/types/manage/article.

If you want to hide that information basing on the user ID of the user who created the node, then you could use the following code.

The template files used by Drupal core check $display_submitted before rendering $submitted and $user_picture. Probably Drupal core sets also $variables['submitted'] and $variables['user_picture'] for those template files that render them without checking first $display_submitted.