<?php get_header(); ?>
<div class="clear"></div>
<div id="mainbg">
	<div class="center">
		<div id="main" class="lbg">
			<div id="bcrumbs">
				<a href="<?php bloginfo('home'); ?>" title="返回首页">首页</a>>>
				<?php the_category(multiple); ?>>>
				<a><?php the_title(); ?></a>
			</div>
		<!--文章循环-->
		<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
		<div class="maintitle">
				<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" target="_blank">
					<?php if ( get_post_meta($post->ID, 'show', true) ) : ?>
						<?php $image = get_post_meta($post->ID, 'show', true); ?>
						<img src="<?php echo $image; ?>"width="400" height="240" alt="<?php the_title(); ?>"/>
						<?php else: ?>
						<?php if (has_post_thumbnail()) { the_post_thumbnail('home-thumb' ,array( 'alt' => trim(strip_tags( $post->post_title )), 'title' => trim(strip_tags( $post->post_title )),'class' => 'home-thumb')); }
						else { ?>
							 <img src="<?php echo catch_first_image() ?>" alt="<?php the_title(); ?>" width="400" height="240" />
						<?php } ?>
					<?php endif; ?>
				</a>
			<div class="titlebox">
				<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" target="_blank"><?php echo cut_str($post->post_title,48); ?></a></h2>
				<span class="time">时间：<?php the_time('Y年m月d日') ?> &nbsp;&nbsp;<?php the_tags(); ?></span>
				<div class="titlep">
                     <?php if(has_excerpt()) the_excerpt();  
							else  
								 echo dm_strimwidth(strip_tags($post->post_content),0,110,"..."); ?>
                </div>
                <div class="b">
                	<span class="read"><?php echo getPostViews(get_the_ID()); ?></span>
                	<span class="love"><?php comments_popup_link('暂无评论', '<small>1</small>', '评论：<small>%</small>'); ?></span>
                </div>
                <span class="cat">
                	<?php the_category(', ') ?>
                </span>
			</div>
		</div>
	<?php endwhile; ?>
	<?php else : ?>
	<h3>什么也找不到！</h3>
	<p>抱歉,你要找的文章不在这里.</p>
	<?php endif; ?>
	<div class="page_navi"><?php par_pagenavi(2); ?></div>
		<!--文章循环结束-->
		</div>
		<?php get_sidebar(a); ?>
	</div>
</div>
<div class="clear"></div>
<?php get_footer(); ?>