<?
$method = $this->uri->segment(3);
$controller = $this->uri->segment(2);

$ci=& get_instance();

$ci->load->library('comm');
$arr_mt_comm = $ci->comm->fn_mt_right();

$arr_recomm_life        = $arr_mt_comm['arr_recomm_life'];
$arr_ep_view_rank        = $arr_mt_comm['arr_ep_view_rank'];
$arr_mt_pop_rank        = $arr_mt_comm['arr_mt_pop_rank'];

#광고
$ci->load->model('web/m_advertisement');
$advertisement = $ci->m_advertisement->find_ad_by_page_key('Maptoon');

//$ci->config->load('filecache',TRUE);
//$filecache = $ci->config->item('file_cache_path','filecache');
//$ci->load->library('advertisement_lib',['file_cache_path'=>$filecache]);
//$advertisement = json_decode($ci->advertisement_lib->get_ad_cache());
?>

      <div class="sidebar">
        <div class="ad gap-bottom-sm"><a href="<?=$advertisement[0]['ad_lending']?>" target="_blank"><img src="<?=imgSrc($advertisement[0]['ad_file'])?>" alt="" width="300" height="250"></a></div>
        <section class="realtime-rank gap-bottom-md">
          <header class="row-header">
            <h2>실시간 조회 순위</h2>
          </header>
          <div class="rank-list two-cols">
              <?$i=0; foreach($arr_ep_view_rank as $val){
                  if($i==0||$i==5){?>
                    <ol class="col-item">
                  <?}?>
                  <li><a href="/web/maptoon/article?mtId=<?=$val['mt_list_idx']?>&no=<?=$val['ep_no']?>"><?=$val['name']?> <?=explode(".", $val['title'])[0]?></a></li>
                  <?if($i==4||$i==9){?>
                    </ol>
                  <?}$i++;?>
              <?}?>
          </div>
        </section>
  
        <section class="recommend-rank gap-bottom-xs">
          <header class="row-header row-header--compact">
            <h2>최신 업데이트 웹툰</h2>
          </header>
          <ol class="rank-list rank-list--thumbs rank-list--border">
            <?
            foreach($arr_mt_pop_rank as $val){?>
              <li>
              <div class="thumb"><a href="/web/maptoon/list?mtId=<?=$val['idx']?>">
              <img src="<?=imgSrc($val['main_img'])?>" alt="" width="40" height="43" style="height:43px !important;"></a></div>
              <div class="info"><a href="/web/maptoon/list?mtId=<?=$val['idx']?>" class="title"><?=$val['mt_name']?></a><a href="/web/maptoon/list?mtId=<?=$val['idx']?>" class="artist"><?=$val['ct_name']?></a></div>
              <div class="rank-count"><?=$val['recommend']?></div>
            </li>
            <?}?>
          </ol>
        </section>
  
        <!-- sidebar banners
        <div class="ad gap-bottom-xs"><a href=""><img src="/renew2/img/sidebar-banner1.png" alt="" width="300" height="86"></a></div>
        <div class="ad gap-bottom-xs"><a href=""><img src="/renew2/img/sidebar-banner2.png" alt="" width="300" height="86"></a></div>
        <div class="ad gap-bottom-md"><a href=""><img src="/renew2/img/sidebar-banner3.png" alt="" width="300" height="86"></a></div> -->
        
        <section class="recommend-life" style="margin-top:30px;">
        <header class="row-header row-header--compact">
          <h2>추천 콘텐츠</h2>
        </header>
        <div class="photo-news">
          <div class="thumb"><a href="/web/life/life_view/<?=$arr_recomm_life[1]['content_idx']?>"><img src="<?=imgSrc($arr_recomm_life[1]['main_img'])?>" alt="" width="666" height="461"></a></div>
          <div class="txt"><a href="/web/life/life_view/<?=$arr_recomm_life[1]['content_idx']?>">오늘의 묵상</a></div>
        </div>
        <ul class="list-card">
          <li>
            <a href="/web/life/life_view/<?=$arr_recomm_life[2]['content_idx']?>"><img src="<?=imgSrc($arr_recomm_life[2]['main_img'])?>" alt="" width="640" height="444">
              <span><?=$arr_recomm_life[2]['title']?></span>
            </a>
          </li>
          <li>
            <a href="/web/life/life_view/<?=$arr_recomm_life[3]['content_idx']?>"><img src="<?=imgSrc($arr_recomm_life[3]['main_img'])?>" alt="" width="640" height="426">
              <span><?=$arr_recomm_life[3]['title']?></span>
            </a>
          </li>
        </ul>
      </section>
      </div>
<script type="text/javascript" src="//wcs.naver.net/wcslog.js"></script>
<script type="text/javascript">
if(!wcs_add) var wcs_add = {};
wcs_add["wa"] = "2ee4bea3106352";
wcs_do();
</script>	  
<!-- Default Statcounter code for Crossmap.co.kr
http://crossmap.co.kr -->
<script type="text/javascript">
var sc_project=10767957; 
var sc_invisible=1; 
var sc_security="0cf2c0fe"; 
</script>
<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js"
async></script>
<noscript><div class="statcounter"><a title="Web Analytics"
href="https://statcounter.com/" target="_blank"><img
class="statcounter"
src="//c.statcounter.com/10767957/0/0cf2c0fe/1/" alt="Web
Analytics"></a></div></noscript>
<!-- End of Statcounter Code -->