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

if(G5_IS_MOBILE) {
	$view_tr = '</tr><tr>';
	$view_align = 'left';
	$view_css_head = 'm-';
	$daum_view = daum_view($wr_post['daum_view'],'m');
	$view['date'] = amina_date($view['wr_datetime']);
} else{
	$view_tr = '';
	$view_align = 'right';
	$view_css_head = '';
	$daum_view = daum_view($wr_post['daum_view'],'l');
	$view['date'] = '<span class="cnt">'.$view['date'].'</span>';
}

//링크 & 첨부
$attach_list = '';
if(!$is_admin && $view['blind']) {
	;
} else	{

	//링크
	for ($i=1; $i <= G5_LINK_COUNT; $i++) {
		if ($view['link'][$i]) {
			$link = cut_str($view['link'][$i], 70);
			$attach_list .= '<li>관련링크 - <a href="'.$view['link_href'][$i].'" target="_blank">'.$link.' <span class="cnt">['.$view['link_hit'][$i].']</span></a></li>'."\n";
		}
	}			

	//첨부
	for ($i=0; $i < count($view['attach']['file']); $i++) {
		$attach_list .= "<li>첨부파일 - <a href=\"javascript:file_download('{$view['attach']['file'][$i]['href']}&js=on', '{$view['attach']['file'][$i]['source']}');\" title=\"{$view['attach']['file'][$i]['content']}\">{$view['attach']['file'][$i]['source']} ({$view['attach']['file'][$i]['size']}) <span class=\"cnt\">[{$view['attach']['file'][$i]['download']}]</span></a></li>\n";
	}

	//다운제한
	if($i > 0 && $v_icon['po_wr_type']) {
		switch($v_icon['po_wr_type']) {
			case 'both' : $po_wr_msg = '연동글에 열람/다운 MP를 사용한 회원만 다운로드할 수 있습니다.'; break;
			case 'view' : $po_wr_msg = '연동글에 열람 MP를 사용한 회원만 다운로드할 수 있습니다.'; break;
			case 'down' : $po_wr_msg = '연동글에 다운 MP를 사용한 회원만 다운로드할 수 있습니다.'; break;
			default		: $po_wr_msg = ''; break;
		}
		if($po_wr_msg) $attach_list .= '<li class="msg-po-down">이용안내 - '.$po_wr_msg.'</li>'."\n";	
	}

	//다운
	if($view['use_po_down']) $attach_list .= '<li class="msg-po-down">다운안내 - '.$view['msg_po_down'].'</li>'."\n";

	//열람
	if($view['use_po_view'] == "free" || $view['use_po_view'] == "ing") $attach_list .= '<li class="msg-po-view">열람안내 - '.$view['msg_po_view'].'</li>'."\n";

	//채택
	if($view['choice'] == "none") $attach_list .= '<li class="msg-choice">'.$amina['cmt_choice_txt'].'안내 - '.$amina['cmt_choice_txt'].'된 댓글은 <b>'.number_format($v_icon['choice_point']).'포인트</b> 드립니다.</li>'."\n";
}

//헤드스킨
if(!$set['view_head']) {
	include($head_skin_path.'/head.skin.php');
}

//헤드여백
if(!$set['view_head_line'] || $frame) echo '<div class="view-head-line"> </div>';

?>
<div class="view-head-wrap">
	<?php if($view['mb_photo']) { ?>
		<div class="<?php echo $view_css_head;?>emo"><?php echo $view['mb_photo']; ?></div>
	<?php } ?>
	<div class="view-head">
		<header>
		<h1 id="bo_v_title" class="<?php echo $view_css_head; ?>view-subject">
			<?php if(!$set['hide_view_icon']) echo $view['fa_icon']; ?><?php echo $view['subject']; ?> <?php if($view['icon_mobile']) { ?> <span class="view-mobile-icon"><?php echo $view['icon_mobile']; ?></span><?php } ?>
		</h1>
		</header>
	    <section id="bo_v_info">
		<ul class="<?php echo $view_css_head; ?>view-info">
			<?php if(!$set['hide_view_name']) { ?>
				<li class="name"><?php echo $view['icon_level'].' '.$view['name'];?></li>
			<?php } ?>
			<?php if($board['bo_use_nogood'] && !$set['hide_view_nogood']) { ?>
				<li><span class="sound_only">비추천 </span><span class="nogood-icon"><?php echo $view['wr_nogood'];?></span></li>
			<?php } ?>
			<?php if($board['bo_use_good'] && !$set['hide_view_good']) { ?>
				<li><span class="sound_only">추천 </span><span class="good-icon"><?php echo $view['wr_good'];?></span></li>
			<?php } ?>
			<li>조회 <span class="cnt"><?php echo $view['wr_hit']; ?></span></li>
			<?php if(!$set['hide_view_star'] && $amina['star']) { ?>
				<li><?php echo amina_star_mark($amina['star_color'],$view['wr_7'],'s');?></li>
			<?php } ?>
			<?php if(!$set['hide_view_cate'] && $view['ca_name']) { ?>
				<li><?php echo $view['ca_name']; ?></li>
			<?php } ?>
			<li class="last"><?php echo $view['date']; ?></li>
		</ul>
		</section>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
</div>
<div class="clear"></div>
<?php if($attach_list) { //첨부 ?>
    <section id="bo_v_file">
		<ul class="view-attach">
			<?php echo $attach_list; ?>
		</ul>
	</section>
<?php } ?>
<article id="bo_v_atc">
	<?php echo $view['attach_skin']; ?>
	<?php echo $view['related_skin']; ?>
	<?php echo $view['poll_up']; ?>
	<div class="view-content">
		<?php echo $view['content']; ?>
		<div class="clear"></div>
	</div>
	<?php echo $view['poll_down']; ?>
	<?php echo $view['star_skin']; ?>
	<?php echo $daum_view; ?>
	<?php echo $view['good_skin']; ?>
	<?php echo $view['sign_skin']; ?>
	<?php if($view['ccl']) { ?>
		<div class="view-ccl">
			<img src="<?php echo AMINA_URL;?>/img/<?php echo $view['ccl_icon']; ?>" alt="" />
			본 게시물은 <a href="<?php echo $view['ccl_deed']; ?>" target="_blank">크리에이티브 커먼즈 <?php echo $view['ccl']; ?> 2.0 대한민국 라이선스</a>에 따라 이용할 수 있습니다.
		</div>
	<?php } ?>
	<?php if($view['tag']) { ?>
		<div class="view-tag">
			<img src="<?php echo AMINA_URL; ?>/img/icon_tag.gif" alt="" /> <?php echo $view['tag']; ?>
		</div>
	<?php } ?>	
	<?php echo $view['tag_skin'];?>

	<table border=0 class="view-opt-tbl">
	<tr>
	<td valign="bottom">
		<ul class="view-opt">
			<li><a href="<?php echo $print_href; ?>" class="popup_print"><img src="<?php echo AMINA_URL; ?>/img/view_print.png" border=0 alt="" /><span>인쇄</span></a></li>
			<?php if($scrap_href) { ?>
				<li><a href="javascript:win_scrap('<?php echo $scrap_href; ?>');"><img src="<?php echo AMINA_URL; ?>/img/view_scrap.png" border=0 alt="" /><span>스크랩</span></a></li>
			<?php } ?>
			<li><a href="javascript:clipboard_address('<?php echo $address_url; ?>');"><img src="<?php echo AMINA_URL; ?>/img/view_url.png" border=0 alt="" /><span>주소</span></a></li>
			<?php if($trackback_url) { ?>
				<li><a href="javascript:trackback_send_server('<?php echo $trackback_url; ?>');"><img src="<?php echo AMINA_URL; ?>/img/view_tb.png" border=0 alt="" /><span>트랙백</span></a></li>
			<?php } ?>
			<?php if($shingo_href) { ?>
				<li><a href="<?php echo $shingo_href; ?>"><img src="<?php echo AMINA_URL; ?>/img/view_shingo.png" border=0 alt="" /><span>신고</span></a></li>
			<?php } ?>
		</ul>
	</td>
	<?php echo $view_tr; ?>
	<td valign="bottom" align="<?php echo $view_align; ?>">
		<?php if($view['icon_sns']) { ?>
			<div class="view-sns"><?php echo $view['icon_sns']; ?></div>
		<?php } ?>
	</td>
	</tr>
	</table>

	<?php if($view['like_skin']) { ?>
		<div class="view-like"><?php echo $view['like_skin']; ?></div>
	<?php } ?>
</article>