<?php if ($this->uri->segment(2) != 'search') {    
$cmtvContents = $this->db->where_in('category_idx', array_values($this->config->item('categories')['crossmaptv']))
->order_by('hit_count', 'desc')->limit(2)->offset(rand(0, 5))->get('life')->result();    
?>
<div class="popular">
    <h4>인기영상</h4>
    <?php     foreach ($cmtvContents as $c) {    ?>
    <div class="p_list" style="cursor: pointer" onclick="location.href='/cmtv/<?php echo cleanUrl($c->title)?>/<?php echo $c->idx?>'">
        <div class="play"><img src="/img/web/img_play.png"></div>
        <div class="photo" style="width:130px; height:130px; background:url('<?php echo $c->main_img ?>') no-repeat center; background-size:cover;"></div>
        <span class="tit"><?php echo mb_strimwidth($c->title, '0', '38', '..', 'utf-8') ?></span>
    </div>
    <?php }?>
</div>
<?php }?>