갤러리 리스트에서 내용에 이미지가 포함되어 있을 경우 썸네일 생성되지 않던 오류 수정

This commit is contained in:
gnuboard
2013-12-16 13:34:28 +09:00
parent 6a344d1438
commit 85840f77ec
2 changed files with 7 additions and 5 deletions

View File

@ -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)
return false;
// $contents 중 img 태그 추출
//$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
$pattern = "/<img([^>]*)>/iS";
if ($view)
$pattern = "/<img([^>]*)>/iS";
else
$pattern = "/<img[^>]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
preg_match_all($pattern, $contents, $matchs);
return $matchs;

View File

@ -22,7 +22,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$write_table = $g5['write_prefix'].$bo_table;
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
$write = sql_fetch($sql);
$matches = get_editor_image($write['wr_content']);
$matches = get_editor_image($write['wr_content'], false);
$edt = true;
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'];
// $contents 중 img 태그 추출
$matches = get_editor_image($contents);
$matches = get_editor_image($contents, true);
if(empty($matches))
return $contents;