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

$cmmtqry		= "bo_table=$bo_table&wr_id=$wr_id&cmmtview=$zm_board[comment_fold]&cwin=1&cpage=$cpage";
?>
<link rel="stylesheet" type="text/css" href="<?=$board_skin_path?>/style.css">
<style>
.good_button	{ display:inline-block; width:72px; height:55px; background:url(<?=$board_skin_path?>/img/good_bg.gif) no-repeat; text-align:center; }
</style>
<? /* -- 게시글 보기 스킨 시작 -- */ ?>
<div style="height:12px; line-height:1px; font-size:1px;">&nbsp;</div>
<!-- 게시글 보기 시작 -->

<div id="zmb_board_view_box"> <!-- 내용 보기 테두리 -->
<div id="zmb_board_view_title_box">
	<div id="zmb_board_view_title">
		<? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?>
	    <?=cut_hangul_last(get_text($view[wr_subject]))?>
	</div>
	<div id="zmb_board_view_writer">
		<div>
			<span><?=$view[name]?></span><span class="view_etc_info_en"><?=$view[id]?></span>
			<span class="view_etc_info_en"><? if ($is_ip_view) { echo "$ip"; } ?></span>
		</div>
		<div>
			<span class="view_etc_info_en">조회 <?=number_format($view[wr_hit])?></span>
			<span class="view_etc_info_en"><?=date("m.d H:i", strtotime($view[wr_datetime]))?></span>
		</div>
	</div>
	<div style="clear:both; text-align:right; padding:5px 0 5px 0;">
    <!-- 링크 버튼 -->
<?	ob_start(); ?>
<?	if ($copy_href) { echo "<a href=\"$copy_href\" class='bttn2'>복사</a> "; } ?>
<?	if ($move_href) { echo "<a href=\"$move_href\" class='bttn2'>이동</a> "; } ?>

<?	if ($search_href) { echo "<a href=\"$search_href\" class='bttn1'>검색목록</a> "; } ?>
<?	echo "<a href=\"$list_href\" class='bttn1'>목록</a> "; ?>
<?	if ($update_href) { echo "<a href=\"$update_href\" class='bttn1'>수정</a> "; } ?>
<?	if ($delete_href) { echo "<a href=\"$delete_href\" class='bttn1'>삭제</a> "; } ?>
<?	if ($reply_href) { echo "<a href=\"$reply_href\" class='bttn1'>답글</a> "; } ?>&nbsp;&nbsp;&nbsp;
<?	if ($write_href) { echo "<a href=\"$write_href\" class='bttn2'>글쓰기</a> "; } ?>
<?
    $link_buttons = ob_get_contents();
    ob_end_flush();
?>
	</div>
</div>




<!-- 본문 -->
<div style="clear:both; text-align:left; padding:2px 10px 2px 10px;">
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++) {
    if ($view[file][$i][source] && !$view[file][$i][view]) {
        $cnt++;
        echo "<div style='margin:2px;'>";
        echo "&nbsp;&nbsp;<img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle border='0'>";
        echo "<a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'>";
        echo "&nbsp;<span style=\"color:#888;\">{$view[file][$i][source]} ({$view[file][$i][size]})</span>";
        echo "&nbsp;<span style=\"color:#ff6600; font-size:11px;\">[{$view[file][$i][download]}]</span>";
        echo "&nbsp;<span style=\"color:#d3d3d3; font-size:11px;\">DATE : {$view[file][$i][datetime]}</span>";
        echo "</a></div>";
    }
}

// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++) {
    if ($view[link][$i]) {
        $cnt++;
        $link = cut_str($view[link][$i], 70);
        echo "<div style='margin:2px;'>";
        echo "&nbsp;&nbsp;<img src='{$board_skin_path}/img/icon_link.gif' align=absmiddle border='0'>";
        echo "<a href='{$view[link_href][$i]}' target=_blank>";
        echo "&nbsp;<span style=\"color:#888;\">{$link}</span>";
        echo "&nbsp;<span style=\"color:#ff6600; font-size:11px;\">[{$view[link_hit][$i]}]</span>";
        echo "</a></div>";
    }
}
?>
<?      //-- 이미지 출력
		for ($i = 0; $i <= count($view[file]); $i++) {
            if ($view[file][$i][view]) {
				$image_path	= $view[file][$i][path] . "/" . $view[file][$i][file];
				resize_check("$image_path");							//-- 이미지 리사이징 체크
                echo "<div>" . $view[file][$i][view] . "</div>";	//-- 그누보드 기본 이미지 뷰
			}
        }
?>

        <!-- 내용 출력 -->
        <div id="zm_writeContents"><?=nl2br($view[content])?></div>

        <?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
        <!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
</div>
<!-- 본문 끝 -->

<!-- 네임카드 영역 -->
<? if ($is_signature) include_once("$board_skin_path/namecard.skin.php");?>

<!-- 페북 좋아요 버튼 -->
<? if($zm_board[facebooklike]) :
	$fb_url	 = $g4[url] . "/bbs/board.php?bo_table=$bo_table&wr_id=$wr_id&page=$page"; ?>
	<div id="fb-root"></div><script>(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/ko_KR/all.js#xfbml=1&appId=508784715834901"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script><div style="text-align:center; padding:2px;"><div class="fb-like" data-send="false" data-layout="box_count" data-width="450" data-show-faces="false"></div></div>
<?	endif; ?>
	<div style="text-align:center;">
<?		if ($zm_good_href) : ?>
			<!-- 추천 -->
			<div class="good_button">
			<div style="color:#EF4680; font-size:14px; margin:7px 0 5px 0;"><span style='color:crimson;'><span id="zm_good"><?=number_format($view[wr_good])?></span></span></div>
			<div><a href="<?=$zm_good_href?>" onClick="this.blur()"><img src="<?=$board_skin_path?>/img/icon_good.gif" border='0' align="absmiddle"><span class="good_txt"><?=$zm_board[good_word]?></span></a></div>
			</div>
<?		endif; ?>
<?		if ($zm_nogood_href) : ?>
			<!-- 반대 -->
			<div class="good_button">
			<div style="color:#6783FB; font-size:14px; margin:7px 0 5px 0;"><span id="zm_nogood"><?=number_format($view[wr_nogood])?></span></div>
			<div><a href="<?=$zm_nogood_href?>" onClick="this.blur()"><img src="<?=$board_skin_path?>/img/icon_nogood.gif" border='0' align="absmiddle"><span class="good_txt"><?=$zm_board[nogood_word]?></span></a></div>
			</div>
<?		endif; ?>
	</div>

<div style="position:relative; clear:both; text-align:right;"><?=zm_police($bo_table, $wr_id)?></div>

<!-- 코멘트 불러오기 -->
<iframe id="ifrmcmmt" frameborder=0 scrolling=no marginwidth=0 marginheight=0 src="<?=$g4[bbs_path]?>/board.php?<?=$cmmtqry?>"></iframe>

<div id="page_move">
	<div>
    <? if ($prev_href) { echo "<img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'><span class='other_colon'>:</span><a href=\"$prev_href\" title=\"$prev_wr_subject\" style='color:#4D4D4D; font-size:13px;'>$prev_wr_subject</a><span class='other_datetime'>$prev_wr_datetime</span>"; } ?>
	</div>
	<div>
    <? if ($next_href) { echo "<img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'><span class='other_colon'>:</span><a href=\"$next_href\" title=\"$next_wr_subject\" style='color:#4D4D4D; font-size:13px;'>$next_wr_subject</a><span class='other_datetime'>$next_wr_datetime</span>"; } ?>
	</div>
</div>
</div><!-- 내용보기 테두리 끝 -->

<div style="clear:both; text-align:right; padding:10px 0 10px 0; border-top:1px solid #E7E7E7;">
    <!-- 링크 버튼 -->
    <?=$link_buttons?>
</div>

<? /* Not edit */ ?>
<script type="text/javascript">
function file_download(link, file) {
    <? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
    document.location.href=link;
}
</script>

<script type="text/javascript" src="<?="$g4[path]/js/board.js"?>"></script>
<script type="text/javascript">
window.onload=function() {
    resizeBoardImage(<?=(int)$board[bo_image_width]?>);
    drawFont();
}
</script>