<?php 
/*-----------------------------------------------------------------------------------*/
/*	News Tab
/*-----------------------------------------------------------------------------------*/
function lioit_news_tab($content) { ?>
<?php
		global $data;
		global $post;
		$tab_cat = stripslashes($data[$content.'_category']); 

		$category_id = get_cat_ID($tab_cat);
		
		?>
<?php query_posts(array('showposts' => 3, 'cat' => $category_id )); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="newsBoxPost">
  <div class="newsBoxPostThumb ThumbCover">
    <div class="cover" style="top: 100%;"> <a class="postype" href="<?php the_permalink(); ?>"></a> <a class="detail" href="<?php the_permalink(); ?>" title="View detail"></a> </div>
    <?php 
                          if(isset($post->ID))
                            {
                                   $img = catch_that_image($post->ID);
                            }
                          ?>
    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"> <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=120&amp;h=92&amp;zc=1" alt="<?php the_title(); ?>" /> </a> </div>
  <!--End LatestPostThumb-->
  <?php $type_badge = get_post_meta($post->ID, 'lioit_post_type', true);?>
  <h1 class="newsBoxPostTitle">
    <div class="<?php echo $type_badge; ?> articleType"></div>
    <a href="<?php the_permalink();?>">
    <?php the_title();?>
    </a></h1>
  <ul class="postMeta">
    <li class="postAuthor">
      <?php the_author_posts_link(); ?>
    </li>
    <li class="postDate">
      <?php the_time('F d, Y'); ?>
    </li>
    <li class="postComments"><a href="<?php comments_link();?>">
      <?php comments_number('0 Comments','1 Comment','% Comments');?>
      </a></li>
  </ul>
  <!--End postMeta-->
  <p>
    <?php the_excerpt_max_charlength('120'); ?>
    ...</p>
</div>
<!--End NewsBoxPost-->
<?php endwhile; ?>
<?php  else:  ?>
<!-- Else in here -->
<?php  endif; ?>
<?php wp_reset_query(); ?>
<?php
}
?>