갤러리 리스트에서 내용에 이미지가 포함되어 있을 경우 썸네일 생성되지 않던 오류 수정
This commit is contained in:
@ -2000,14 +2000,16 @@ function delete_board_thumbnail($bo_table, $file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 에디터 이미지 얻기
|
// 에디터 이미지 얻기
|
||||||
function get_editor_image($contents)
|
function get_editor_image($contents, $view=true)
|
||||||
{
|
{
|
||||||
if(!$contents)
|
if(!$contents)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// $contents 중 img 태그 추출
|
// $contents 중 img 태그 추출
|
||||||
//$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
|
if ($view)
|
||||||
$pattern = "/<img([^>]*)>/iS";
|
$pattern = "/<img([^>]*)>/iS";
|
||||||
|
else
|
||||||
|
$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
|
||||||
preg_match_all($pattern, $contents, $matchs);
|
preg_match_all($pattern, $contents, $matchs);
|
||||||
|
|
||||||
return $matchs;
|
return $matchs;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
|
|||||||
$write_table = $g5['write_prefix'].$bo_table;
|
$write_table = $g5['write_prefix'].$bo_table;
|
||||||
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
|
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
|
||||||
$write = sql_fetch($sql);
|
$write = sql_fetch($sql);
|
||||||
$matches = get_editor_image($write['wr_content']);
|
$matches = get_editor_image($write['wr_content'], false);
|
||||||
$edt = true;
|
$edt = true;
|
||||||
|
|
||||||
for($i=0; $i<count($matches[1]); $i++)
|
for($i=0; $i<count($matches[1]); $i++)
|
||||||
@ -84,7 +84,7 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
|||||||
$thumb_width = $board['bo_image_width'];
|
$thumb_width = $board['bo_image_width'];
|
||||||
|
|
||||||
// $contents 중 img 태그 추출
|
// $contents 중 img 태그 추출
|
||||||
$matches = get_editor_image($contents);
|
$matches = get_editor_image($contents, true);
|
||||||
|
|
||||||
if(empty($matches))
|
if(empty($matches))
|
||||||
return $contents;
|
return $contents;
|
||||||
|
|||||||
Reference in New Issue
Block a user