<?php

global  $theme_version,
        $js_status;


get_header();

echo "\n" . '<div id="content" class="narrowcolumn">' . "\n";

if (have_posts())
{
	$post = $posts[0]; // Hack. Set $post so that the_date() works.

 	/* If this is a category archive */
	if ( is_category() )
	{
		echo '  <h2 class="pagetitle">';
		printf(__('Archive for the &#8216;%s&#8217; Category', 'german_newspaper'), single_cat_title('', false));
		echo '</h2>' . "\n";
	}
	/* If this is a tag archive */
	elseif( is_tag() )
	{
		echo '<h2 class="pagetitle">';
		printf(__('Posts Tagged &#8216;%s&#8217;', 'german_newspaper'), single_tag_title('', false) );
		echo '</h2>' . "\n";
	}
	/* If this is a daily archive */
	elseif ( is_day() )
	{
		echo '<h2 class="pagetitle">';
		printf(_c('Archive for %s|Daily archive page', 'german_newspaper'), get_the_time(__('F jS, Y', 'german_newspaper')));
		echo '</h2>' . "\n";
	}
	/* If this is a monthly archive */
	elseif ( is_month() )
	{
		echo '<h2 class="pagetitle">';
		printf(_c('Archive for %s|Monthly archive page', 'german_newspaper'), get_the_time(__('F, Y', 'german_newspaper')));
		echo '</h2>' . "\n";
	}
	/* If this is a yearly archive */
	elseif ( is_year() )
	{
		echo '<h2 class="pagetitle">';
		printf(_c('Archive for %s|Yearly archive page', 'german_newspaper'), get_the_time(__('Y', 'german_newspaper')));
		echo '</h2>' . "\n";
	}
	/* If this is an author archive */
	elseif ( is_author() )
	{
	  echo '<h2 class="pagetitle">' . __('Author Archive', 'german_newspaper') . '</h2>' . "\n";
	}
	/* If this is a paged archive */
	elseif ( isset($_GET['paged']) && !empty($_GET['paged']) )
	{
	  echo '<h2 class="pagetitle">' - __('Blog Archives', 'german_newspaper') . '</h2>' . "\n";
	}

	echo '		<div class="navigation">' . "\n";
	echo '			<div class="alignleft">' . "\n";

	next_posts_link(__('&laquo; Older Entries', 'german_newspaper'));

	echo '      </div>' . "\n";
	echo '			<div class="alignright">' . "\n";

	previous_posts_link(__('Newer Entries &raquo;', 'german_newspaper'));

	echo '      </div>' . "\n";
	echo '		</div>' . "\n\n";

	while (have_posts())
	{
		the_post();
		
		echo '<div class="post">' . "\n";
		echo '  <h3 id="arch-post-' . get_the_ID() . '"><a href="' . apply_filters('the_permalink', get_permalink()) . '" rel="bookmark" title="';

		printf(__('Permanent Link to %s', 'german_newspaper'), the_title_attribute('echo=0'));

		echo '">' . the_title( '', '', false ) . '</a></h3>' . "\n";
		echo '  <small>';

		the_time(__('l, F jS, Y', 'german_newspaper'));

		echo '</small>' . "\n\n";
		echo '  <div class="entry">' . "\n";

		the_content();
		
		echo '  </div>' . "\n\n";
		echo '<p class="postmetadata">';

		the_tags(__('Tags: ', 'german_newspaper'), ', ', '<br />');
		printf(__('Posted in %s', 'german_newspaper'), get_the_category_list(', '));
		echo ' | ';
		edit_post_link(__('Edit', 'german_newspaper'), '', ' | ');
		echo '  ';
		comments_popup_link(__('No Comments &#187;', 'german_newspaper'), __('1 Comment &#187;', 'german_newspaper'), __('% Comments &#187;', 'german_newspaper'));
		echo '</p>' . "\n";
		echo '</div>' . "\n\n";
	}

	echo '<div class="navigation">' . "\n";
	echo '  <div class="alignleft">' . "\n";

	next_posts_link(__('&laquo; Older Entries'), 'german_newspaper');

	echo '  </div>' . "\n";
	echo '	<div class="alignright">' . "\n";

	previous_posts_link(__('Newer Entries &raquo;', 'german_newspaper'));

	echo '	</div>' . "\n";
	echo '</div>' . "\n\n";
}
else
{
	echo '<h2 class="center">' . __('Not Found', 'german_newspaper') . '</h2>' . "\n";

	include (TEMPLATEPATH . '/searchform.php');
}

echo "\n" . '</div>' . "\n\n";



get_footer();

?>