<?php 
function lioit_big_box($cat) { ?>
<?php
		global $smof_data;
		global $post;
		$big_cat = stripslashes($smof_data['bigbox_'.$cat]);
		$big_color = $smof_data[$cat.'_color']; 
		$category_id = get_cat_ID($big_cat);
		


		
		?>
<div class="newsBox<?php if($smof_data[$cat.'_layout'] == 'bigboxs2'){ echo' newsBoxRight';}else{ echo'';}?>">

<div class="homeTitle" <?php if(!empty($smof_data[$cat.'_color'])) { ?> style="border-color:<?php echo $big_color;  ?>;"<?php } ?>><h2 <?php if(!empty($smof_data[$cat.'_color'])) { ?>style="background-color:<?php echo $big_color;  ?>;"<?php } ?>><a href="<?php echo get_category_link($category_id); ?>" ><?php echo get_cat_name($category_id); ?></a></h2></div>
  <div class="contentBox">
    <?php query_posts(array('showposts' => 1, '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('columnsimg', array('title' => strip_tags(get_the_title()))); ?>
        <div class="carouselPostsMask"> <span class="page-link"></span> </div>
        </a> </div>
      <!--End LatestPostThumb-->
      
      <h4 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></h4>
      <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 } ?>
                                            <span class="MetapostDate"><?php the_time('M d, Y'); ?></span>
                                            <li class="postViews"><?php echo getPostViews($post->ID); ?> </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 echo excerpt(20); ?></p>
      <a href="<?php the_permalink();?>" class="postMore btn" <?php if(!empty($smof_data[$cat.'_color'])) { ?>style="background-color:<?php echo $big_color;  ?>;"<?php } ?>><?php _e('Read More' , 'lioit' ) ?></a>
        
    </div>
    <!--End NewsBoxPost-->
    <?php endwhile; ?>
    <?php  else:  ?>
    <!-- Else in here -->
    <?php  endif; ?>
    <?php wp_reset_query(); ?>
    <div class="newsBoxList">
      <?php query_posts(array('showposts' => 4,'offset' => 1, 'cat' => $category_id )); ?>
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      <div class="newsBoxListPost">
        <div class="newsBoxListPostThumb ">
          
          <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('thumb-small', array('title' => strip_tags(get_the_title()))); ?></a> </div>
        <!--End newsBoxListPostThumb-->
        <div class="newsBoxListPostDetails">
          <h4 class="newsBoxListPostTitle"> 
          <a href="<?php the_permalink();?>">
         <?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 } ?>
            <?php the_title();?>
            </a></h4>
          <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('F d, Y'); ?></li>
          </ul>
          <!--End postMeta--> 
        </div>
        <!--End newsBoxListPostDetails--> 
      </div>
      <!--End newsBoxListPost-->
      <?php endwhile; ?>
      <?php  else:  ?>
      <!-- Else in here -->
      <?php  endif; ?>
      <?php wp_reset_query(); ?>
    </div>
    <!--End NewsBoxList--> 
  </div>
  <!--End ContentBox--> 
</div>
<!--End NewsBox-->
<?php
}

?>