<?php 
/*-----------------------------------------------------------------------------------*/
/*	News Tab
/*-----------------------------------------------------------------------------------*/
function lioit_news_tab($content) { ?>
<?php
		global $smof_data;
		global $post;
		$tab_cat = stripslashes($smof_data[$content.'_category']); 
		$tab_count = $smof_data[$content.'_count'];
		$category_id = get_cat_ID($tab_cat);
		
		?>
<?php query_posts(array("ignore_sticky_posts" => 1, 'showposts' => $tab_count, 'cat' => $category_id )); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="newsBoxPost">

  <div class="newsBoxPostThumb ">
    
    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"> <?php the_post_thumbnail('main-block', array('title' => strip_tags(get_the_title()))); ?></a> </div>
  <!--End LatestPostThumb-->
  <h3 class="newsBoxPostTitle">
    <?php 
											$badge_text = get_post_meta($post->ID, 'lioit_post_badge_text', true);
											$badge_color = get_post_meta($post->ID, 'lioit_post_badge_color', true);
										?>
                                        <?php if ($badge_text) { ?>
                                        <div class="articleType" style="background-color:<?php echo $badge_color; ?>;"><?php echo $badge_text; ?></div>
                                        <?php } ?>
    <a href="<?php the_permalink();?>">
    <?php the_title();?>
    </a></h3>
 <ul class="postMeta">
          	<?php
                                            $lioit_review_enable =  get_post_meta($post->ID, 'lioit_review_enable', true);
                                            $lioit_review_type =  get_post_meta($post->ID, 'lioit_review_type', true);
                                            $lioit_final_score =  get_post_meta($post->ID, 'lioit_final_score', true);
                                            $lioit_final_percentage = $lioit_final_score * 20 ;
                                        	?>
                                        	<?php if($lioit_review_enable == 'enable'){ ?>
                                            <li>
                                            	<span class="lioit-rating lioit-rating-<?php echo esc_html($lioit_review_type); ?>">
                                                	<span style="width:<?php echo esc_html($lioit_final_percentage); ?>%;"></span>
                                                </span>
                                            </li>
											<?php } ?>
                                            <li class="postViews"><?php echo getPostViews($post->ID); ?> </li>
                                        	<li class="MetapostDate"><?php the_time('M d, Y'); ?></li>
                                            <li class="postComments"><a href="<?php comments_link();?>"><?php comments_number(__('0 Comments', 'lioit'), __('One Comment', 'lioit'), __('% Comments', 'lioit'));?></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
}
?>