<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

global $is_admin, $member;

//불당썸---------------------------------------------------------------//
$img_width = 95; //표시할 이미지의 가로사이즈
$img_height = 95; //표시할 이미지의 세로사이즈 
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$th['filter'] = array();
$th['filter']['type'] = 90; 
$th['filter']['arg1'] = 100;
$th['filter']['arg2'] = 1;
$th['filter']['arg3'] = 2;

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

$m_color_set = "1"; //최근게시물 색상 선택은 1~4 중 하나를 입력하세요
$m_round = "e1e1e1"; //최근게시물 테두리를 없애려면 "fff" 로 수정하세요
?>

<script type="text/javascript" src="<?php echo $latest_skin_path ?>/js/featureList.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $latest_skin_path ?>/css/color_set<?php echo $m_color_set ?>.css">
<style type="text/css">
.m_list_wrap {border-right:0px solid #<?php echo $m_round ?>; border-bottom:0px solid #<?php echo $m_round ?>; border-left:0px solid #<?php echo $m_round ?>; text-align:left}
.m_list a:link, .m_list a:visited, .m_list a:active {padding-left:11px; text-decoration:none; font:normal 11px dotum, tahoma; color:#797979; letter-spacing:-1px}
.m_list a:hover {padding-left:11px; text-decoration:underline; font:normal 11px dotum, tahoma; color:#000; letter-spacing:-1px}
.m_roll_left {position:static; margin-bottom:5px; width:<?php echo $thumb_width + 10 ?>px; height:<?php echo $thumb_height + 5 ?>px; overflow:hidden}
.m_roll_right {position:absolute; margin-top:-<?php echo $thumb_height + 12 ?>px; margin-left:<?php echo $thumb_width + 17 ?>px; line-height:20px}
ul#output {margin:0; padding:5px 0 5px 6px; list-style:none}
ul#tabs {margin:0; padding:5px 0 5px 0; list-style:none}
ul#tabs li a:link, ul#tabs li a:visited, ul#tabs li a:active {padding-left:11px; text-decoration:none; font:normal 11px dotum, tahoma; color:#797979; background:url(<?php echo $latest_skin_path ?>/img/icon_li.gif) no-repeat 2px 3px}
ul#tabs li a:hover {padding-left:11px; text-decoration:underline; font:normal 11px dotum, tahoma; color:#000; background:url(<?php echo $latest_skin_path ?>/img/icon_li_over.gif) no-repeat 0 3px}
ul#tabs li a.current, ul#tabs li a.current:visited, ul#tabs li a.current:active {text-decoration:underline; font:normal 11px dotum, tahoma; color:#000; background:url(<?php echo $latest_skin_path ?>/img/icon_li_over.gif) no-repeat 0 3px}
ul#tabs li a.current:hover {padding-left:11px}
.m_no_list {text-align:center; color:#767676}
</style>
<script type="text/javascript">
$(document).ready(function() {
	$.featureList(
		$("#tabs li a"),
		$("#output li"), {
			start_item:	0
		}
	);
});
</script>

<div class="m_latest_wrap">
  <div class="m_list_wrap">
    <div class="m_roll_left">
      <ul id="output">
        <?php
        for ($i=0; $i<count($list); $i++) { 
		$thumfile = "";
		$thumb = $thumb_path.'/'.$list[$i][wr_id];
		$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
		// 업로드된 파일이 이미지라면
		if (preg_match("/\.(jpg|gif|png|bmp)$/i", $file) && file_exists($file)) { 
			$thumb = thumbnail($file, $img_width, $img_height, 0, 1, 90, 0, "",  $filter, $noimg); //첨부파일 언샾마스크추가

		} else { //에디터에서 삽입한 이미지
				$edit_img = $list[$i]['wr_content'];
			if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------
				$file = $g4[path].'/' . $tmp[0]; // 파일명
				$thumb = thumbnail($file, $img_width, $img_height, 0, 1, 90, 0, "",  $filter, $noimg); //언샾마스크추가
			}
		} 
        ?>
        <li>
          <div class="s1_latest_list">
            <img src="<?php echo $thumb ?>" width="<?php echo $img_width ?>" height="<?php echo $img_height ?>" alt="" title="">
          </div>
        </li>
        <?php } ?>
      </ul>
    </div>
    <div class="m_roll_right">
      <ul id="tabs">
        <?php for ($i = 0; $i < count($list); $i++) { ?>
        <li>
        <?php
        if ($list[$i]['is_notice'])
            echo "<span class='m_list'><a href='{$list[$i]['href']}'>{$list[$i]['subject']}";
        else
            echo "<span class='m_list'><a href='{$list[$i]['href']}'>{$list[$i]['subject']}";
        echo "</a></span>";
        if ($list[$i]['icon_new'])
            echo "<span class='m_icon_new'> New</span>";
        //if ($list[$i]['icon_secret'])
            //echo "<span class='m_icon_secret'> S</span>";
        ?>
        </li>
        <?php } ?>
        <?php if (count($list) == 0) { ?>
        <div class="m_no_list">게시물이 없습니다.</div>
        <?php } ?>
      </ul>
    </div>
  </div>
</div>
