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

$cmmtqry		= "bo_table=$bo_table&wr_id=$wr_id&cmmtview=$zm_board[comment_fold]&cwin=1&cpage=$cpage";
?>
<link href="<?=$board_skin_path?>/style.css" type="text/css" rel="stylesheet">
<style>
span.icon_facebook	{ display:inline-block; width:20px; height:20px; background:url("<?=$board_skin_path?>/img/icon_sns.gif") no-repeat left -28px; margin-right:5px; vertical-align:middle; }
span.icon_twitter	{ display:inline-block; width:20px; height:20px; background:url("<?=$board_skin_path?>/img/icon_sns.gif") no-repeat left -2px; margin-right:5px; vertical-align:middle; }

span.vwline	{ display:inline-block; width:2px; height:14px; background:url("<?=$g4[path]?>/zm.extend/img/point.gif") no-repeat 0px  -671px; vertical-align:middle; }	/* 세로 막대 */
</style>

<? /* -- 게시글 보기 스킨 시작 -- */ ?>
<div style="height:12px; line-height:1px; font-size:1px;">&nbsp;</div>
<!-- 게시글 보기 시작 -->

<div class="vw_writer">		<? //-- 글 정보 ?>
	<div class="writer_left">	<? //-- 글 정보 ?>
		<div class="subject"><?=cut_hangul_last(get_text($view[wr_subject]))?></div>	<? //-- 제목 ?>

<?		if($view[wr_mobile]) : ?><img src='<?=$board_skin_path?>/img/icon_mobile.gif'> <? endif; ?>
<?		if ($is_category && $category_name) : ?><span class="catename"><?=$view[ca_name]?></span><span class="vwline"></span><?endif; ?>
		<span class="wrname"><?=$view[name]?></span><!-- <span class="wrid"><?=$view[id]?></span>--> <span class="vwline"></span>
		<span class="datetime">작성 <?=date("y.m.d H:i", strtotime($view[wr_datetime]))?></span>
<?		if($view[wr_datetime] != $view[wr_last]) : ?><span class="vwline"></span> <span class="datetime">수정 <?=date("y.m.d H:i", strtotime($view[wr_last]))?></span><? endif; ?>
		<span class="vwline"></span> <span class="datetime">조회 <?=number_format($view[wr_hit])?></span>
<?		if ($is_ip_view) : ?><span class="vwline"></span> <span class="wrid"><?=$ip?></span><? endif; ?>
<?		if ($scrap_href) : ?> <span class="vwline"></span> <span class="extfunc" onclick="win_scrap('<?=$scrap_href?>');">스크랩</span><? endif; ?>
<?		if ($trackback_url) : ?> <span class="vwline"></span> <span class="extfunc" onclick="trackback_send_server('<?=$trackback_url?>');">트랙백</span><?	 endif; ?>
	</div>
	<div class="writer_right"><img src="<?=$writer_info[profile_pic]?>"><? //-- 프로필 사진 ?></div>
</div>




<div class="vw_buttons">	<? //-- 상단 버튼 모음 ?>
	<a class="vw_btn_common" onclick="share_sns('fb')"><span class="icon_facebook"></span>페이스북</a><a class="vw_btn_common" onclick="share_sns('tw')"><span class="icon_twitter"></span>트위터</a><a class="vw_btn_common" onclick="uri_copy('<?=$zm_board_longurl?>')">주소복사</span>

	<a href="#ifrmcmmt" class="vw_btn_common">댓글 <span class="cmmt"><?=$view[wr_comment]?></span></a><?
	if ($copy_href) : ?><a href="<?=$copy_href?>" class='vw_btn_common vw_btn_blue'>복사</a><? endif;
	if ($move_href) : ?><a href="<?=$move_href?>" class='vw_btn_common vw_btn_blue'>이동</a><? endif;
	if ($search_href) : ?><a href="<?=$search_href?>" class='vw_btn_common'>검색목록</a><? endif; ?><a href="<?=$list_href?>" class='vw_btn_common'>목록</a><?	if ($update_href) : ?><a href="<?=$update_href?>" class='vw_btn_common'>수정</a><? endif;
	if ($delete_href) : ?><a href="<?=$delete_href?>" class='vw_btn_common'>삭제</a><? endif;
	if ($reply_href) : ?><a href="<?=$reply_href?>" class='vw_btn_common'>답글</a><? endif;
	if ($write_href) : ?><a href="<?=$write_href?>" class='vw_btn_common vw_btn_write'>글쓰기</a><? endif; ?>
</div>						<? //-- end vw_buttons ?>

<div class="vw_content_box">
<?
	//-- 가변 파일 ----------------------------------
	$cnt = 0;
	for ($i=0; $i<count($view[file]); $i++) :
		if ($view[file][$i][source] && !$view[file][$i][view]) :
			$cnt++; ?>
			<div class="attach">
				<img src='<?=$board_skin_path?>/img/icon_file.gif' align=middle>
				<span><a onclick="file_download('<?=$view[file][$i][href]?>', '<?=$view[file][$i][source]?>');" title='<?=$view[file][$i][content]?>'><?=$view[file][$i][source]?></a></span>
				<span class="fileinfo"><?=$view[file][$i][size]?>B</span>
				<span class="fileinfo">Hit <span class="filehit"><?=$view[file][$i][download]?></span></span>
				<span class="fileinfo">Date <?=$view[file][$i][datetime]?></span>
			</div>
<?		endif;
	endfor;

	//-- 링크 -------------------------------------
	$cnt = 0;
	for ($i=1; $i<=$g4[link_count]; $i++) :
	    if ($view[link][$i]) :
		    $cnt++;
			$link = cut_str($view[link][$i], 70); ?>
			<div class="link">
				<img src='<?=$board_skin_path?>/img/icon_link.gif' align=middle>
				<a href='<?=$view[link_href][$i]?>' target=_blank><span><?=$link?></span></a>
				<span class="linkinfo">Hit <span class="linkhit"><?=$view[link_hit][$i]?></span></span>
			</div>
<?		endif;
	endfor;

	//-- 이미지 출력 ---------------------------------
	for ($i = 0; $i <= count($view[file]); $i++) :
		if ($view[file][$i][view]) : ?>
			<div class="attach_img"><?=$view[file][$i][view]?></div> <? //-- 그누보드 기본 이미지 뷰 ?>
<?		endif;
	endfor;

	//-- 내용 출력 ---------------------------------- ?>
	<div id="content_box"><?=$view[content]?></div>

<?	//-- 추천, 반대 --------------------------------- ?>
	<div id="evaluation_box">
<?		if ($zm_good_href) : ?>
			<!-- 추천 -->
			<div class="good_button btn_good" onclick="<?=$zm_good_href?>">
				<span class="good_img"><img src="<?=$board_skin_path?>/img/icon_good.gif"></span><span class="good_txt"><?=$zm_board[good_word]?></span><span id="zm_good"><?=number_format($view[wr_good])?></span>
			</div>
<?		endif; ?>
<?		if ($zm_nogood_href) : ?>
			<!-- 반대 -->
			<div class="good_button btn_nogood" onclick="<?=$zm_nogood_href?>">
				<span class="good_img"><img src="<?=$board_skin_path?>/img/icon_nogood.gif"></span><span class="good_txt"><?=$zm_board[nogood_word]?></span><span id="zm_nogood"><?=number_format($view[wr_nogood])?></span>
			</div>
<?		endif; ?>

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

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

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

<? /*
	//-- 페북 좋아요 버튼
	$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"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script>
	<div style="text-align:center;"><div class="fb-like" data-href="<?=$fb_url?>" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div></center>
<?	endif; */ ?>

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

<!-- 링크 버튼 -->
<div class="bottom_btns">
<?	if ($search_href) { echo "<a href=\"$search_href\" class='btn_common_txt'>검색목록</a><span class='vwline'></span>"; } ?>
<?	echo "<a href=\"$list_href\" class='btn_common_txt'>목록</a>"; ?>
<?	if ($update_href) { echo "<span class='vwline'></span><a href=\"$update_href\" class='btn_common_txt'>수정</a><span class='vwline'></span>"; } ?>
<?	if ($delete_href) { echo "<a href=\"$delete_href\" class='btn_common_txt'>삭제</a><span class='vwline'></span>"; } ?>
<?	if ($reply_href) { echo "<a href=\"$reply_href\" class='btn_common_txt'>답글</a><span class='vwline'></span>"; } ?>
<?	if ($write_href) { echo "<a href=\"$write_href\" class='btn_common_txt'>글쓰기</a><span class='vwline'></span>"; } ?>
<?	if ($write_href) { echo "<a href=\"#\" class='btn_common_txt'>↑맨위로</a>"; } ?>
</div>

<div class="list_adjoin">
<?	if ($prev_href) : ?><div>▲ <a href="<?=$prev_href?>" title="<?=$prev_wr_subject?>"><?=$prev_wr_subject?></a>
		<span class='other_datetime'><?=$prev_wr_datetime?></span>
	</div>
<?	endif; ?>
<?	if ($next_href) : ?><div>▼ <a href="<?=$next_href?>" title="<?=$next_wr_subject?>"><?=$next_wr_subject?></a>
		<span class='other_datetime'><?=$next_wr_datetime?></span>
	</div>
<?	endif; ?>
</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">
function share_sns(sns){
	var snsurl		= "<?=$board_skin_path?>/img/ani_loading.gif";
	var long_url	= "<?=$board_skin_path?>/sns_share.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>";

	if(sns == "fb")	snsurl	= long_url + "&sns=fb";
	if(sns == "tw")	snsurl	= long_url + "&sns=tw";
	var newwin	= window.open(snsurl, "sns", "width=600, height=400, toolbar=0");
}

window.onload=function() {
    resizeBoardImage(<?=(int)$board[bo_image_width]?>);
    drawFont();

	//-- 이미지 리사이즈
    $.post("<?=$board_skin_path?>/ajax.resize.php", { bo_table: "<?=$bo_table?>", wr_id: "<?=$wr_id?>" }, function(data){ });
}
</script>