게시판에 글을 작성하면 본문에 <p> </p> 태그가 기능 없이 텍스트로 노출됩니다.
본문
제목 그대로.. 본문이 이렇게 뜹니다 ㅠㅠ;; 이유가 무엇일까요?
해당 게시글 참조해보았으나 잘 해결되지가 않습니다.
스마트에디터까지 직접 건드리진 않았고, 답변에 쓰여 있는 방법 중 비타주리 님의 방법을 3가지 모두 사용해보았으나 해결이 되지 않아요.
아래는 view.skin.php 코드입니다.
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
$p_url="";
if ($view['wr_protect']!=''){
if( get_session("ss_secret_{$bo_table}_{$view['wr_num']}") || $view['mb_id'] && $view['mb_id']==$member['mb_id'] || $is_admin )
$is_viewer = true;
else {
$is_viewer = false;
$p_url="./password.php?w=p&bo_table=".$bo_table."&wr_id=".$view['wr_id'].$qstr;
}
}else if($view['wr_secret'] == '1') {
if($board['bo_read_level'] < $member['mb_level'] && $is_member)
$is_viewer = true;
else {
$is_viewer = false;
$p_url="./login.php";
}
}
if(!$is_viewer && $p_url!=''){
if($p_url=="./login.php") alert("멤버공개 글입니다. 로그인 후 이용해주세요.",$p_url);
else goto_url($p_url);
}
?>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<article id="bo_v">
<? if($board['bo_content_head']) { ?>
<div class="board-notice-box">
<?=stripslashes($board['bo_content_head']);?>
</div>
<? } ?>
<div class="board-title">
<?php
if ($category_name) echo "<em>{$view['ca_name']}</em>"; // 분류 출력 끝
echo "<strong>".cut_str(get_text($view['wr_subject']), 70)."</strong>"; // 글제목 출력
?>
</div>
<div class="board-info">
<strong><?php echo $view['name'] ?></strong>
<strong><?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></strong>
</div>
<?php
if ($view['file']['count']) {
$cnt = 0;
for ($i=0; $i<count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view'])
$cnt++;
}
}
?>
<?php if($cnt) { ?>
<!-- 첨부파일 시작 { -->
<div class="board-file">
<ul>
<?php
// 가변 파일
for ($i=0; $i<count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) {
?>
<li>
<a href="<?php echo $view['file'][$i]['href']; ?>" class="view_file_download">
<img src="<?php echo $board_skin_url ?>/img/icon_file.gif" alt="첨부">
<strong><?php echo $view['file'][$i]['source'] ?></strong>
<?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>)
</a>
</li>
<?php
}
}
?>
</ul>
</div>
<!-- } 첨부파일 끝 -->
<?php } ?>
<!-- 유투브 시작 { -->
<div class="gall_you">
<?php if ($view['wr_10']) { ?>
<div class="video-container">
<iframe width="100%" src="https://www.youtube.com/embed/<?php echo $view['wr_10']; ?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br>
<?php } ?>
</div>
<!-- } 유투브 끝 -->
<div class="board-content">
<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<=count($view['file']); $i++) {
if ($view['file'][$i]['view']) {
//echo $view['file'][$i]['view'];
echo get_view_thumbnail($view['file'][$i]['view']);
}
}
echo "</div>\n";
}
?>
<!-- 본문 내용 -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
</div>
<?php
// 코멘트 입출력
include_once(G5_BBS_PATH.'/view_comment.php');
?>
<!-- 링크 버튼 시작 { -->
<div id="bo_v_bot">
<div class="bo_v_com" style="text-align: right;">
<?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="ui-btn etc"><i class="material-icons">edit</i> 수정</a><?php } ?>
<?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" class="ui-btn etc" onclick="del(this.href); return false;"><i class="material-icons">delete</i> 삭제</a><?php } ?>
<a href="<?php echo $list_href ?>" class="ui-btn etc"><i class="material-icons">list</i> 목록</a>
<?php if ($reply_href) { ?><a href="<?php echo $reply_href ?>" class="ui-btn"><i class="material-icons">list</i> 답변</a><?php } ?>
<?php if ($write_href) { ?><a href="<?php echo $write_href ?>" class="ui-btn point"><i class="material-icons">edit</i> 글쓰기</a><?php } ?>
</div>
</div>
<!-- } 링크 버튼 끝 -->
</article>
<!-- } 게시판 읽기 끝 -->
<script>
<?php if ($board['bo_download_point'] < 0) { ?>
$(function() {
$("a.view_file_download").click(function() {
if (!g5_is_member) {
alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오.");
return false;
}
var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?";
if (confirm(msg)) {
var href = $(this).attr("href") + "&js=on";
$(this).attr("href", href);
return true;
} else {
return false;
}
});
});
<?php } ?>
function board_move(href) {
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
}
</script>
<script>
$(function() {
$("a.view_image").click(function() {
window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
return false;
});
// 추천, 비추천
$("#good_button, #nogood_button").click(function() {
var $tx;
if (this.id == "good_button")
$tx = $("#bo_v_act_good");
else
$tx = $("#bo_v_act_nogood");
excute_good(this.href, $(this), $tx);
return false;
});
// 이미지 리사이즈
$("#bo_v_atc").viewimageresize();
});
function excute_good(href, $el, $tx) {
$.post(
href, {
js: "on"
},
function(data) {
if (data.error) {
alert(data.error);
return false;
}
if (data.count) {
$el.find("strong").text(number_format(String(data.count)));
if ($tx.attr("id").search("nogood") > -1) {
$tx.text("이 글을 비추천하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
} else {
$tx.text("이 글을 추천하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
}
}
}, "json"
);
}
</script>
<!-- } 게시글 읽기 끝 -->
답변 1
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
이 부분을, 아래와 같이 한번 바꿔보세요.
<div id="bo_v_con"><?php echo htmlspecialchars_decode($view['content']); ?></div>
답변을 작성하시기 전에 로그인 해주세요.