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

if(G4_IS_MOBILE) {
	$view_tr = '</tr><tr>';
	$view_align = 'left';
	$view_css_head = 'm_';
	$daum_view = daum_view($wr_post['daum_view'],'m');
} else{
	$view_tr = '';
	$view_align = 'right';
	$view_css_head = '';
	$daum_view = daum_view($wr_post['daum_view'],'l');
}

//링크 & 첨부
$attach_list = '';
if(!$is_admin && $view['blind']) {
	;
} else	{
	//링크
	for ($i=1; $i <= G4_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['file']); $i++) {
		if ($view['file'][$i]['source'] && !$view['file'][$i]['view']) {
			$attach_list .= "<li>첨부파일 - <a href=\"javascript:file_download('{$view['file'][$i]['href']}', '{$view['file'][$i]['source']}');\" title=\"{$view['file'][$i]['content']}\">{$view['file'][$i]['source']} ({$view['file'][$i]['size']}) <span class=\"cnt\">[{$view['file'][$i]['download']}]</span></a></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']) echo '<div class="head-view-back"><div class="head-view-front"><div class="head-view"></div></div></div>'."\n";

//헤드여백
if(!$set['view_head_line']) echo '<div class="hd_line"> </div>';

?>
<div class="view_head">
	<h2>본문</h2>
	<?php if($view['mb_photo']) echo '<div class="'.$view_css_head.'emo">'.$view['mb_photo'].'</div>'; ?>
	<div class="subject">
		<header>
			<h1 class="<?php echo $view_css_head; ?>v_subject"><?php echo $view['subject']; ?> <?php echo $view['icon_mobile']; ?></h1>
		</header>
		<section id="bo_v_info">
		<ul>
		<?php
			if(G4_IS_MOBILE) {
				if(!$set['hide_view_name']) echo '<li class="name">'.$view['icon_level'].' '.$view['name'].'</li>'."\n";
				echo '<li>조회 <span class="cnt">'.$view['wr_hit'].'</span></li>'."\n";
				echo '<li class="last">'.amina_date($view['wr_datetime']).'</li>'."\n";
			} else {
				if(!$set['hide_view_name']) echo '<li class="name">'.$view['icon_level'].' '.$view['name'].'</li>'."\n";
				if($board['bo_use_nogood']) echo '<li><span class="none">비추천 </span><span class="icon_nogood">'.$view['wr_nogood'].'</span></li>'."\n";
				if($board['bo_use_good']) echo '<li><span class="none">추천 </span><span class="icon_good">'.$view['wr_good'].'</span></li>'."\n";
				echo '<li>조회 <span class="cnt">'.$view['wr_hit'].'</span></li>'."\n";
				if(!$set['hide_view_star'] && $amina['star']) echo '<li>'.amina_star_mark($amina['star_color'],$view['wr_7'],'s').'</li>'."\n";
				if(!$set['hide_view_cate'] && $view['ca_name']) echo '<li>'.$view['ca_name'].'</li>'."\n";
				echo '<li class="last"><span class="cnt">'.date("Y.m.d H:i", strtotime($view['wr_datetime'])).'</span></li>'."\n";
			}
		?>
		</ul>
		<div class="clear"></div>
		</section>
	</div>
	<div class="clear"></div>
</div>
<div class="clear"></div>
<?php if($attach_list) { //첨부 ?>
	<section id="bo_v_file">
		<ul class="attach">
			<?php echo $attach_list; ?>
		</ul>
	</section>
<?php } ?>
<article id="bo_v_atc">
	<?php 
		echo $view['attach_skin'];
		echo $view['related_skin'];
		echo $view['poll_up'];

		echo '<div class="viewContents">'."\n";
			echo $view['blind']; //Blind Message
			echo $view['content'];
			echo '<div class="clear"></div>'."\n";
		echo '</div>'."\n";

		echo $view['poll_down'];

		echo $view['star_skin'];

		echo $daum_view;

		echo $view['good_skin'];

		echo $view['sign_skin'];

		if($view['tag']) echo '<div class="view_tag"><img src="'.AMINA_URL.'/img/icon_tag.gif" alt="" /> '.$view['tag'].'</div>';

		echo $view['tag_skin'];
	?>
	<table border=0 class="view_opt_tbl">
	<tr>
	<td valign="bottom">
		<ul class="view_opt">
			<?php
				echo '<li><a href="'.$print_href.'" class="popup_print" title="이 글을 인쇄합니다."><img src="'.AMINA_URL.'/img/view_print.png" border=0 alt="" /><span>인쇄</span></a></li>'."\n";

				if($scrap_href) echo '<li><a href="javascript:win_scrap(\''.$scrap_href.'\');" title="이 글을 스크랩합니다."><img src="'.AMINA_URL.'/img/view_scrap.png" border=0 alt="" /><span>스크랩</span></a></li>'."\n";

				echo '<li><a href="javascript:clipboard_address(\''.urlencode($wr_address).'\');" title="이 글의 고유주소를 복사합니다."><img src="'.AMINA_URL.'/img/view_url.png" border=0 alt="" /><span>주소</span></a></li>'."\n";

				if($trackback_url) echo '<li><a href="javascript:trackback_send_server(\''.$trackback_url.'\');" title="이 글의 트랙백 주소를 복사합니다."><img src="'.AMINA_URL.'/img/view_tb.png" border=0 alt="" /><span>트랙백</span></a></li>'."\n";

				if($shingo_href) echo '<li><a href="'.$shingo_href.'" title="이 글을 신고합니다."><img src="'.AMINA_URL.'/img/view_shingo.png" border=0 alt="" /><span>신고</span></a></li>'."\n";
			?>
		</ul>
	</td>
	<?php echo $view_tr; ?>
	<td valign="bottom" align="<?php echo $view_align; ?>">
		<?php if($view['icon_sns']) echo '<div class="view_sns">'.$view['icon_sns'].'</div>'; ?>
	</td>
	</tr>
	</table>

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

</article>