최근게시물에 출력되는 HTML태그 없애는법좀 알려주세요~! 정보
최근게시물에 출력되는 HTML태그 없애는법좀 알려주세요~!본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : www.soj.co.nz
게시물을 html써서 작성하면 최근게시물 뽑아질때 HTML태그도 같이 나오는데 없애는 법을 알려주시면 감사하겠습니다 ^_^
사용하는 최근게시물 스킨 코드는 다음과 같습니다:
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<?
for ($i=0; $i<count($list); $i++)
{
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 210, "");
// 태그 웹표준으로 변경
$content = str_replace("<P>", "", $content);
$content = str_replace("</P>", "", $content);
$content = str_replace("<BR>", "", $content);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
$upday = cut_str($list[$i][wr_datetime], 10, "");
$tmp = explode("-", $upday);
$upday = $tmp[0]."년 ".$tmp[1]."월 ".$tmp[2]."일";
echo " <table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><a href='$href' class='headlink'>{$list[$i][subject]}</a></td>
</tr>
<tr>
<td class='headtext'>$content... <span class='date'>(<a href='$href' class='link'>자세히 보기</a>)</span></td>
</tr>
<tr>
<td height=20></td>
</tr>
</table>
";
}
?>
<? if (count($list) == 0) { ?>
<div>게시물이 없습니다.</div>
<? } ?>
감사합니다~! ^-^
오류 주소 : www.soj.co.nz
게시물을 html써서 작성하면 최근게시물 뽑아질때 HTML태그도 같이 나오는데 없애는 법을 알려주시면 감사하겠습니다 ^_^
사용하는 최근게시물 스킨 코드는 다음과 같습니다:
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<?
for ($i=0; $i<count($list); $i++)
{
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 210, "");
// 태그 웹표준으로 변경
$content = str_replace("<P>", "", $content);
$content = str_replace("</P>", "", $content);
$content = str_replace("<BR>", "", $content);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
$upday = cut_str($list[$i][wr_datetime], 10, "");
$tmp = explode("-", $upday);
$upday = $tmp[0]."년 ".$tmp[1]."월 ".$tmp[2]."일";
echo " <table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><a href='$href' class='headlink'>{$list[$i][subject]}</a></td>
</tr>
<tr>
<td class='headtext'>$content... <span class='date'>(<a href='$href' class='link'>자세히 보기</a>)</span></td>
</tr>
<tr>
<td height=20></td>
</tr>
</table>
";
}
?>
<? if (count($list) == 0) { ?>
<div>게시물이 없습니다.</div>
<? } ?>
감사합니다~! ^-^
댓글 전체

$content = cut_str(get_text($list[$i][wr_content]), 210, "");
아래에 넣어주세요..
$content = strip_tags($content);
아래에 넣어주세요..
$content = strip_tags($content);
죄송합니다.. 해봣는데 안되네요.. >.<
다른 방법은 없나요?
다른 방법은 없나요?

순서를 바까보셔요
$content = strip_tags($list[$i][wr_content]);
$content = cut_str($content, 90, "...");
$content = strip_tags($list[$i][wr_content]);
$content = cut_str($content, 90, "...");