<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
//add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$thumb_width = 1920;
$thumb_height = 884;
?>
<div id="carousel-example" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner main-slider">

<?php
    for ($i=0; $i<count($list); $i++) {

      $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);

      if($thumb['src']) {
          $img = $thumb['src'];
      } else {
          $img = 'http://fakeimg.pl/1920x884/?text=MainSlide'.$i;
          $thumb['alt'] = '메인슬라이드';
      }
      ?>
      <div class="<?php if($i==0){echo "active ";}?> item">
        <a href="#"><img src="<?php echo $img;?>" ></a>
        <div class="carousel-caption">
        <h3><?php echo $list[$i]['subject'];?></h3>
          <p><?php echo $list[$i]['wr_content'];?></p>
        </div>
      </div>

    <?php }  ?>

  </div>
  <a class="left carousel-control" href="#carousel-example" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left"></span>
  </a>
  <a class="right carousel-control" href="#carousel-example" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right"></span>
  </a>
</div>
