테스트 사이트 - 개발 중인 베타 버전입니다

갤러리 게시판 리스트에서 cheditor5로 올린 이미지가 노출이 되게 하고 싶습니다. 채택완료

dethos79 10년 전 조회 4,214

갤러리 게시판 리스트 페이지에서 cheditor5로 올린 이미지들이 노출이 되게 하고 싶습니다. 

어찌어찌 해봐도 도통 해답이 나오질 않고 있습니다.ㅠㅠ;;;

아래는 list.php파일 소스입니다.

고수님들의 도움 부탁드립니다.^^

 

------------------------------------------------------------------------------

 

 

// 굿빌더 버젼 3.3

// 작성일자: 2013.07.03

// 작성자: 굿빌더, http://www.goodbuilder.co.kr">http://www.goodbuilder.co.kr

?>

/// 웹진 형태의 게시판 스킨 good_webzine2_me 버젼 1.0

 

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

 

include_once("$board_skin_path/skin.lib.php"); //썸네일 이미지 함수

 

 

 

// image width, height

if($board[bo_1] and $board[bo_2] and $board[bo_3]) {

   $image_width = $board[bo_1];

   $image_height = $board[bo_2];

   $image_quality = $board[bo_3];

} else if($g4[default_thumb_width] and $g4[default_thumb_height] and $g4[default_thumb_quality]) {

   $image_width = $g4[default_thumb_width];

   $image_height = $g4[default_thumb_height];

   $image_quality = $g4[default_thumb_quality];

} else {

   $image_width = 75;

   $image_height = 60;

   $image_quality = 100;

}

 

$image_div_width = $image_width + 7;

$image_div_height = $image_height + 5;

$image_border_style = "style='border:1px solid #dddddd' onmouseover=\"this.style.borderColor='#386eff'\" onmouseout=\"this.style.borderColor='#dddddd'\"";

 

// 썸네일 저장 디렉터리

$data_path = $g4[path]."/data/file/$bo_table";

/// $thumb_path = $data_path.'/thumbs';

$thumb_path = $data_path.'/thumb';

 

@mkdir($thumb_path, 0707);

@chmod($thumb_path, 0707);

 

// 선택옵션으로 인해 셀합치기가 가변적으로 변함

$colspan = 5;

 

//if ($is_category) $colspan++;

if ($is_checkbox) $colspan++;

if ($is_good) $colspan++;

if ($is_nogood) $colspan++;

 

 

 

$colspan_minus2 = $colspan - 2; ///***

 

$title_bg = "#F8F8F9";

$border_bg = "#E5E5E5";

$border_bottom_bg = "#E5E5E5";

 

 

 

// 내용 표시 길이

$content_len = 200;

// 이미지 출력 갯수.

$num_of_images_default = 5; 

 

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.

// 제목

?>

 

 

 

 

   

      _on.jpg' border="0" />

if($sca==$ct_arr[$a]){

$ct_img2 = $ct_img."_on.jpg";

}else{

$ct_img2 = $ct_img.".jpg";

}?>

     

   

 

 

 

    

   

     | 

   

     | 

   

   

   

 

 

   

 

 

   

 

     

for ($i=0; $i

    $img = "";

    $thumb = $thumb_path.'/'.$list[$i][wr_id];

    // 썸네일 이미지가 존재하지 않는다면

    if (!file_exists($thumb)) {

//소스추가 : 에디터로 저장된 사진의 썸네일을 만들기 위함

  if(!$list[$i][file][0][file]){

   $file = $list[$i]['img'];

   $find = strrpos($file,'data');

   $file ="../".substr($file,$find);   

  }

        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];

        // 업로드된 파일이 이미지라면

        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 = $img_width / $size[0];

            $height = (int)($size[1] * $rate);

 

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면

            if ($height < $img_height)

                // 계산된 이미지 높이로 복사본 이미지 생성

                $dst = imagecreatetruecolor($img_width, $height);

            else

                // 설정된 이미지 높이로 복사본 이미지 생성

                $dst = imagecreatetruecolor($img_width, $img_height);

            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);

            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);

            chmod($thumb_path.'/'.$list[$i][wr_id], 0707);

        }

    }

 

    if (file_exists($thumb))

        $img = "";

else

        if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))

       { $img = ""; }        

?>

     

       

       

     

     

       

     

     

     

"; } ?>

     

   

           

             

               

               

                

               

               

                   

             

           

                

               

     

    echo ""; 

                  } else { 

    } 

?>

     

    echo ""; 

                  } else { 

    } 

?>

 

 

    echo ""; 

                  } else { 

    } 

?>

   

                   

                     

                   

                   

                     

                   

                   

                     

                   

                    

               

                         

      $wr_content = preg_replace("/<(.*?)\>/","",$list[$i][wr_content]); 

      $wr_content = preg_replace("/ /","",$wr_content); 

      $wr_content = cut_str(get_text($wr_content),275,"..."); //숫자는 최근글에 뽑을 본문길이 

      echo $wr_content; 

      ?>

                         

                       

    if($list[$i][file][count] < $num_of_images_default)

        $num_of_images = $list[$i][file][count];

    else

        $num_of_images = $num_of_images_default;

 

    for ($j = 0; $j < $num_of_images; $j++) {

 

/// 보여질 이미지 만들기

$img = "";

$img_size_chk = @getimagesize($g4[path]."/data/file/$bo_table/".$list[$i][file][$j][file]);

 

if($list[$i][file][$j][file] and $img_size_chk[0] > 0) {

                if($j == 0) { $thumb_num = $list[$i][wr_id]; } else { $thumb_num = $list[$i][wr_id]."_".$j; }

$img = makeThumbs($g4[path]."/data/file/$bo_table", $list[$i][file][$j][file], $image_width, $image_height, $list[$i][subject], $image_border_style, $thumb_num);

} else {

$img = "";

}

 

        echo "$img\n";

    }

?>

                     

                 

                   

                 

                 

                   

                 

                 

                   

                 

               

                       

                       

                       |  

                   

                   

                    

                   

                      

                     

                 

        

         

                     

                           

       
게시물이 없습니다.
 

 

 

   

        "; } ?>

       

        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.

        //echo $write_pages;

        $write_pages = str_replace("처음", "", $write_pages);

        $write_pages = str_replace("이전", "", $write_pages);

        $write_pages = str_replace("다음", "", $write_pages);

        $write_pages = str_replace("맨끝", "", $write_pages);

        $write_pages = preg_replace("/([0-9]*)<\/span>/", "$1", $write_pages);

        $write_pages = preg_replace("/([0-9]*)<\/b>/", "$1", $write_pages);

        ?>

       

        "; } ?>

   

 

 

   

   

       

       

           

           

           

       

 

       

   

         

       

 

 

 

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

채택된 답변
+20 포인트
10년 전

에 넣으라는게 아니구요 거기 있다는거여요

리스트에 서 cheditor5 올려 으면 보통 http://ruwa64-065.fmcity.com/WebMysql/sql.php?db=cjlove_cj033&table=g5_write_free&token=18751440b46bef53a28957a9c88e9c1d&sql_query=SELECT+%2A+FROM+%60g5_write_free%60+ORDER+BY+%60g5_write_free%60.%60wr_content%60+ASC">wr_content 저장 되자나요

여기서 그걸 추출 하는 소스가 있다고 애기한건데요

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

k
10년 전

알려주신대로 적용했는데, 이번엔 리스트 페이지가 아예 나오질 않고 있어서요..^^;;

common.lib에서 정확히 어느 부분에 넣으면 되는지 알려주시면 감사드리겠습니다~!!

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

10년 전

/lib/common.lib.php

 

// 에디터 이미지 얻기 function get_editor_image($contents, $view=true) {     if(!$contents)         return false;

    // $contents 중 img 태그 추출     if ($view)         $pattern = "/]*)>/iS";     else         $pattern = "/]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";     preg_match_all($pattern, $contents, $matchs);

    return $matchs; }​

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인