에디터 사용시 최신글에 html 소스 나오는 문재
본문
게시판을 dhtml 으로 작성을 했을때
html 소스인 p 테그와 br 테그가 나오내요...
게시판 이랑 뷰페이지에서는 html 소스가 안나오는대요 최신글인 latest 부분 만 소스가 나오고있는대
이부분 어떻게 잡아주시는지 아시는분 제발 도와주세요 ㅠ
밑에는 latest.php 스킨 소스입니다 고수님들 잘부탁드려요 ^^;
<div class="board_list_bef">
</div>
<?
if (!defined("_GNUBOARD_")) exit; //-- 개별 페이지 접근 불가
//-- 2011. 05. 04 최근 썸네일 목록. 바보천사
if(!function_exists("getimgsrc")) {
function getimgsrc($content) {
$s_content = str_replace("\"", "", stripslashes(str_replace("<IMG", "<img", $content)));
$src = strchr(strchr($s_content, "<img"), "http://");
$s_src = "";
for($i = 0; $i < strlen($src); $i++) {
$tmp_str = substr($src, $i, 1);
if(($tmp_str == " ") or (substr($src, $i, 1) == ">"))
return $s_src;
else
$s_src .= $tmp_str;
}
return FALSE;
}
}
$imgW = "121"; //-- 이미지 폭
$imgH = "90"; //-- 이미지 높이 (줄인 이미지 높이가 $imgH보다 큰 경우 절삭(?))
$imgQ = "100"; //-- 이미지 퀄리티
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$imgPath = $g4[path] . "/data/file/".$bo_table; //-- 게시판(갤러리)의 첨부파일(이미지)이 들어 있는 경로
$thumbPath = $imgPath . '/thumb'; //-- 썸네일을 생성할 위치. thumb 디렉토리가 없으면 만들고 chmod를 707로 한다.
for($i = 0; $i < $rows; $i++) {
//-- 내용 중에 현재 사이트(도메인 기준)에 존재하는 이미지가 있으면 경로를 추출하여 썸네일로 만든다. 경로에 내 도메인이 있으면 내 서버에 있는 이미지 OK
$s_imgsrc = getimgsrc($list[$i][wr_content]);
//-- 같은 서버에 있는 이미지가 맞음. 이미지의 상대 경로를 구함
$s_imgsrc = $g4[path] . strchr($s_imgsrc, "/data/");
//-- 썸네일 생성
$thumfile = "";
$thumb_name = $list[$i][wr_id];
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if(!$list[$i][file][0][file]) {
$thumb_name = $list[$i][wr_id] . "_";
$file = $s_imgsrc;
}
$thumb = $thumbPath . '/' . $thumb_name;
@unlink($thumb); //-- 썸네일 이름을 wr_id로 쓰기 때문에 그누에서 이미지가 수정되도 알 수 없으므로 일단 삭제
//-- 이미지 파일을 걸러낸다.
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file); //-- 이미지의 크기
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $imgW / $size[0]; //-- 축소시킬 이미지 비율을 가로폭을 기준으로 계산한다.
$height = (int)($size[1] * $rate);
//-- 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작을 때
if ($height < $imgH)
//-- 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($imgW, $height);
else
//-- 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($imgW, $imgH);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $imgW, $height, $size[0], $size[1]);
imagejpeg($dst, $thumbPath . '/' . $thumb_name, $imgQ);
chmod($thumbPath . '/' . $thumb_name, 0606);
}
//-- 생성한 썸네일이 정상적으로 존재 한다면
if (file_exists($thumb))
$thumfile = "<img src='$thumb'>";
else
$thumfile = "<div><img src='images/noimg.gif'></div>";
$aProj = explode("|", $list[$i]['wr_1']);
$content = cut_str(get_text(strip_tags($list[$i][wr_content])),480,"…");
if($list[$i]) : ?>
<ul>
<li><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>' class="con_img"><?=$thumfile?></a></li>
<li><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>' class="con_cate">[<?=$list[$i][ca_name]?>]</a></li>
<li><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>' class="con"><?=cut_str( get_text($list[$i]['wr_content'],5), 66, "..")?></a></li>
</ul>
<? endif;
}
?>
</div>
답변 1
<li><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>' class="con"><?=cut_str( get_text($list[$i]['wr_content'],5), 66, "..")?></a></li>
을
<li><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>' class="con"><?=$content?></a></li>
이렇게 수정해보세요.