<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
?>
<link rel="stylesheet" href="<?=$board_skin_path?>/board.css" type="text/css">
<!-- 게시글 보기 시작 -->
<div class="board_list_title" style=" border-bottom:1px solid #dedede;padding:10px 0;font-size:14pt; word-break:break-all;">
<div style="margin-left:5px;"><? if ($is_category) {?>
            <? if ($is_category) { echo ($category_name ? "$view[ca_name] " : ""); } ?><span style="font:7pt tahoma;color:#dedede;padding:0 5px;">|</span><? } ?>
            <?=cut_hangul_last(get_text($view[wr_subject]))?>
</div>
</div>
<table border=0 cellpadding=0 cellspacing=0 width=<?=$width?>>
<tr>
    <td height=30 style="border-bottom:1px solid #eee;">
        <div style="float:left;margin-left:5px;"  class="board_list_title">
        &nbsp;글쓴이 : 
        <?=$view[name]?><? if ($is_ip_view) { echo "&nbsp;($ip)"; } ?> <span style="font:7pt tahoma;color:#dedede;padding:0 5px;">|</span> 작성일 : <?=date("y-m-d H:i", strtotime($view[wr_datetime]))?>
        </div>
        <div style="float:right;"  class="board_list_title">
         조회 : <?=number_format($view[wr_hit])?>
        <? if ($is_good) { ?>&nbsp;<img src="<?=$board_skin_path?>/img/icon_good.gif" border='0' align=absmiddle> 추천 : <?=number_format($view[wr_good])?><? } ?>
        <? if ($is_nogood) { ?>&nbsp;<img src="<?=$board_skin_path?>/img/icon_nogood.gif" border='0' align=absmiddle> 비추천 : <?=number_format($view[wr_nogood])?><? } ?>
        &nbsp;
        </div>
    </td>
</tr>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++) {
    if ($view[file][$i][source] && !$view[file][$i][view]) {
        $cnt++;
        echo "<tr><td height=30 style=\"border-bottom:1px solid #dedede;background-color:#f6f6f6;\">";
        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]}', '".urlencode($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></td></tr>";
    }
}
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++) {
    if ($view[link][$i]) {
        $cnt++;
        $link = cut_str($view[link][$i], 70);
        echo "<tr><td height=30 style=\"border-bottom:1px solid #dedede;background-color:#f6f6f6;\">";
        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></td></tr>";
    }
}
?>
<tr> 
    <td height="150" style="word-break:break-all; padding:5px;line-height:1.6;" class="board_list_title">
        <? 
        // 파일 출력
        for ($i=0; $i<=count($view[file]); $i++) {
            if ($view[file][$i][view]) 
                echo "<div style=\"margin-bottom:10px;width:".$board['bo_image_width']."px;overflow:hidden;\">".$view[file][$i][view] . "</div>";
        }
        ?>
        <!-- 내용 출력 -->
        <span id="writeContents"><?=$view[content];?></span>
        
        <?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
        <!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
        <? if ($nogood_href) {?>
        <div style="width:72px; height:55px; background:url(<?=$board_skin_path?>/img/good_bg.gif) no-repeat; text-align:center; float:right;">
        <div style="color:#888; margin:7px 0 5px 0;">비추천 : <?=number_format($view[wr_nogood])?></div>
        <div><a href="<?=$nogood_href?>" target="hiddenframe"><img src="<?=$board_skin_path?>/img/icon_nogood.gif" border='0' align="absmiddle"></a></div>
        </div>
        <? } ?>
        <? if ($good_href) {?>
        <div style="width:72px; height:55px; background:url(<?=$board_skin_path?>/img/good_bg.gif) no-repeat; text-align:center; float:right;">
        <div style="color:#888; margin:7px 0 5px 0;"><span style='color:crimson;'>추천 : <?=number_format($view[wr_good])?></span></div>
        <div><a href="<?=$good_href?>" target="hiddenframe"><img src="<?=$board_skin_path?>/img/icon_good.gif" border='0' align="absmiddle"></a></div>
        </div>
        <? } ?>
</td>
</tr>
<? if ($is_signature) { echo "<tr><td align='center' style='border-bottom:1px solid #E7E7E7; padding:5px 0;'>$signature</td></tr>"; } // 서명 출력 ?>
</table>
<br>
<?
// 코멘트 입출력
include_once("./view_comment.php");
?>

<div style="clear:both; height:43px;">
    <div style="float:left; margin-top:10px;">
    <? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\" class=\"btn_big\"><span>이전글</span></a>"; } ?>
    <? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\" class=\"btn_big\"><span>다음글</span></a>"; } ?>
    </div>
    <!-- 링크 버튼 -->
    <div style="float:right; margin-top:10px;">
    <?//=$link_buttons?>
    <? 
    ob_start(); 
    ?>
    <? if ($copy_href) { echo "<a href=\"$copy_href\" class=\"btn_big\"><span>복사</span></a>"; } ?>
    <? if ($move_href) { echo "<a href=\"$move_href\" class=\"btn_big\"><span>이동</span></a>"; } ?>
    <? if ($search_href) { echo "<a href=\"$search_href\" class=\"btn_big\"><span>검색목록</span></a>"; } ?>
    <? echo "<a href=\"$list_href\" class=\"btn_big\"><span>목록</span></a>"; ?>
    <? if ($update_href) { echo "<a href=\"$update_href\" class=\"btn_big\"><span>수정</span></a>"; } ?>
    <? if ($delete_href) { echo "<a href=\"$delete_href\" class=\"btn_big\"><span>삭제</span></a>"; } ?>
    <? if ($reply_href) { echo "<a href=\"$reply_href\" class=\"btn_big\"><span>답변</span></a>"; } ?>
    <? if ($write_href) { echo "<a href=\"$write_href\" class=\"btn_big\"><strong>글쓰기</strong></a>"; } ?>
    <?
    $link_buttons = ob_get_contents();
    ob_end_flush();
    ?>
    </div>
</div>
<script type="text/javascript">
function file_download(link, file) {
    <? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+decodeURIComponent(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>
<!-- 게시글 보기 끝 -->