허

[최신]이미지+내용추출시 html이나오는것막는방법을 알고싶습니다.

cj03.gif
이곳저곳 뒤져봤는데 해결책이 안나와서 질문드립니다.
우선 265보드에 냉동개구리님의 kagla_notice 최신글스킨을 사용중입니다.
문제는 스킨부분이 아니라 내용부분에 html로 작성되어진부분이네요.
내용부분에 html을 적용해서 나오게 하는 방법을 좀 알려주셨음하네요
다음은 lib.php의 소스 내용입니다 . 좀 살펴봐주세요 ^^;

// 최신글을 추출한다.
function latest($skin_dir='', $bo_table, $rows=10, $len=40)
{
   global $latest_skin, $cfg, $gnu_path;

   include($gnu_path . 'bbs/gblayer.php');

   $tmp_latest_skin = $latest_skin;

   // 스킨디렉토리값이 넘어왔다면
   if ($skin_dir) {
       $latest_skin = $gnu_path . "bbs/skin/latest/$skin_dir";
   }

   $sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
   $bo = sql_fetch_array($sql);
   $bo_subject = $bo[bo_subject];
   include "$latest_skin/latest_head.skin.php";

   $sql = " select a.*, mb_open
             from {$cfg[write_table_prefix]}{$bo_table} a
             left join $cfg[table_member] b on (b.mb_id = a.mb_id)
             where a.wr_comment = 0
             order by a.wr_num, a.wr_datetime desc limit 0, $rows ";
   $result = sql_query_error($sql);
   for ($i=0; $row = mysql_fetch_array($result); $i++) {
       $wr_subject = conv_subject($row[wr_subject], $len,"…");
       $wr_content = get_text($row[wr_content]);
       $wr_name = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage], $row[mb_open]);
       $wr_date = substr($row[wr_datetime],2,8);

       // new 이미지
       $icon_new = "";
       if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
           $icon_new = "<img src='$latest_skin/icon_new.gif' align=absmiddle>";
       }

       // 코멘트 카운트
         $commentcnt = "";
      if ($row[wr_commentcnt] > 0) {
          $commentcnt = "($row[wr_commentcnt])";
      }

       
//스킨에서내용추출부
$wr_content     = get_text(cut_str($row[wr_content], 200, '....[계속]'));{
$wr_content = strip_tags($wr_content);
    if ($row[wr_secret]) $wr_content  = "";                                          
}
       
       $file1 = $row[wr_file1];
       $file2 = $row[wr_file2];
       $file1_image = "";
       $file2_image = "";
       if (@preg_match($cfg[image_extension], $file1)) { $file1_image = $gnu_path . 'data/file/' . "$bo_table/$file1"; }
       if (@preg_match($cfg[image_extension], $file2)) { $file2_image = $gnu_path . 'data/file/' . "$bo_table/$file2"; }

       $a_list_link = $gnu_path . "bbs/gnuboard.php?bo_table=$bo_table&wr_id=$row[wr_id]";
       include "$latest_skin/latest_main.skin.php";
   }
   mysql_free_result($result);

   $show_nodata_begin = "";
   $show_nodata_end = "";
   if ($i>0) {
       $show_nodata_begin = "<!--";
       $show_nodata_end = "-->";
   }
   include "$latest_skin/latest_tail.skin.php";

   $latest_skin = $tmp_latest_skin;
}

첨부파일

cj03.gif (11.2 KB)
0회 2004-02-18 22:21
|

댓글 4개

답변감사합니다. 다른부분에서 해결책을 강구하는중입니다. ^^
언제나 신경서주셔서 감사 &^^
결국 저는 저것을 적용하지 않습니다.....
$nr_content = $row[wr_content];
$nr_content = nl2br(stripslashes($nr_content)) ; // 추출 글 내용 줄 변환을 위해
아마도 이렇게 하면 될것입니다..
html이 소스로 출력이 될때와 그것이 적용된 예를 들면 이미지로 출력 되었을때의 모습은 다르죠....
문제는 장단점이 있다는 것입니다.......
댓글을 작성하시려면 로그인이 필요합니다.

그누3질답

9,564건
+
제목 글쓴이 날짜 조회
03-08-15 조회 557
03-08-15 조회 813
03-08-15 조회 729
03-08-15 조회 740
03-08-15 조회 651
03-08-15 조회 510
03-08-15 조회 805
03-08-15 조회 632
03-08-15 조회 521
03-08-15 조회 474
03-08-15 조회 626
03-08-14 조회 717
03-08-14 조회 705
03-08-14 조회 542
03-08-14 조회 757
03-08-14 조회 565
03-08-14 조회 688
03-08-14 조회 564
03-08-14 조회 734
03-08-14 조회 499