cheditor로 올린 이미지에 설명추가... 정보
cheditor로 올린 이미지에 설명추가...본문
이미지 검색에서 검색률을 올리기위해
이미지설명을 추가하려합니다.
도와주세요 ㅠㅠ 몇시간째 해매고있내요..
배추스킨을 사용하고 있습니다.
관련있어보이는 소스 올려봅니다
// 웹에디터 첨부 이미지 워터마크 처리
if ($mw_basic[cf_watermark_use])
$view[content] = mw_create_editor_image_watermark($view[content]);
if (!$mw_basic[cf_zzal] && !strstr($view[content], "{이미지:"))// 파일 출력
$view[content] = $file_viewer . $view[content];
if ($write[wr_singo] && $write[wr_singo] >= $mw_basic[cf_singo_number] && $mw_basic[cf_singo_write_block]) {
$content = " <div class='singo_info'> 신고가 접수된 게시물입니다. (신고수 : $write[wr_singo]회)<br/>";
$content.= " <span onclick=\"btn_singo_view({$view[wr_id]})\" class='btn_singo_block'>여기</span>를 클릭하시면 내용을 볼 수 있습니다.";
if ($is_admin == "super")
$content.= " <span class='btn_singo_block' onclick=\"btn_singo_clear({$view[wr_id]})\">[신고 초기화]</span> ";
$content.= " </div>";
$content.= " <div id='singo_block_{$view[wr_id]}' class='singo_block'> {$view[content]} </div>";
$view[content] = $content;
}
......
........
.......
if ($mw_basic[cf_no_img_ext]) { // 이미지 확대 사용 안함
$view[rich_content] = preg_replace("/name='target_resize_image\[\]' onclick='image_window\(this\)'/iUs", "", $view[rich_content]);
} else {
// 웹에디터 이미지 클릭시 원본 사이즈 조정
$data = $view[rich_content];
preg_match_all("/<img\s+name='target_resize_image\[\]' onclick='image_window\(this\)'.*src=\"(.*)\"/iUs", $data, $matchs);
for ($i=0; $i<count($matchs[1]); $i++) {
$match = $matchs[1][$i];
$no_www = str_replace("www.", "", $g4[url]);
if (strstr($match, $g4[url])) {
$path = str_replace($g4[url], $g4[path], $match);
} elseif (strstr($match, $no_www)) {
$path = str_replace($no_www, $g4[path], $match);
} elseif (substr($match, 0, 1) == "/") {
$path = $_SERVER[DOCUMENT_ROOT].$match;
} else {
$path = $match;
}
$size = @getimagesize($path);
if ($size[0] && $size[1]) {
$match = str_replace("/", "\/", $match);
$match = str_replace(".", "\.", $match);
$match = str_replace("+", "\+", $match);
$pattern = "/(onclick=[\'\"]{0,1}image_window\(this\)[\'\"]{0,1}) (.*)(src=\"$match\")/iU";
$replacement = "onclick='mw_image_window(this, $size[0], $size[1])' $2$3";
if ($size[0] > $board[bo_image_width])
$replacement .= " width=\"$board[bo_image_width]\"";
$data = @preg_replace($pattern, $replacement, $data);
}
}
$view[rich_content] = $data;
}
이미지설명을 추가하려합니다.
도와주세요 ㅠㅠ 몇시간째 해매고있내요..
배추스킨을 사용하고 있습니다.
관련있어보이는 소스 올려봅니다
// 웹에디터 첨부 이미지 워터마크 처리
if ($mw_basic[cf_watermark_use])
$view[content] = mw_create_editor_image_watermark($view[content]);
if (!$mw_basic[cf_zzal] && !strstr($view[content], "{이미지:"))// 파일 출력
$view[content] = $file_viewer . $view[content];
if ($write[wr_singo] && $write[wr_singo] >= $mw_basic[cf_singo_number] && $mw_basic[cf_singo_write_block]) {
$content = " <div class='singo_info'> 신고가 접수된 게시물입니다. (신고수 : $write[wr_singo]회)<br/>";
$content.= " <span onclick=\"btn_singo_view({$view[wr_id]})\" class='btn_singo_block'>여기</span>를 클릭하시면 내용을 볼 수 있습니다.";
if ($is_admin == "super")
$content.= " <span class='btn_singo_block' onclick=\"btn_singo_clear({$view[wr_id]})\">[신고 초기화]</span> ";
$content.= " </div>";
$content.= " <div id='singo_block_{$view[wr_id]}' class='singo_block'> {$view[content]} </div>";
$view[content] = $content;
}
......
........
.......
if ($mw_basic[cf_no_img_ext]) { // 이미지 확대 사용 안함
$view[rich_content] = preg_replace("/name='target_resize_image\[\]' onclick='image_window\(this\)'/iUs", "", $view[rich_content]);
} else {
// 웹에디터 이미지 클릭시 원본 사이즈 조정
$data = $view[rich_content];
preg_match_all("/<img\s+name='target_resize_image\[\]' onclick='image_window\(this\)'.*src=\"(.*)\"/iUs", $data, $matchs);
for ($i=0; $i<count($matchs[1]); $i++) {
$match = $matchs[1][$i];
$no_www = str_replace("www.", "", $g4[url]);
if (strstr($match, $g4[url])) {
$path = str_replace($g4[url], $g4[path], $match);
} elseif (strstr($match, $no_www)) {
$path = str_replace($no_www, $g4[path], $match);
} elseif (substr($match, 0, 1) == "/") {
$path = $_SERVER[DOCUMENT_ROOT].$match;
} else {
$path = $match;
}
$size = @getimagesize($path);
if ($size[0] && $size[1]) {
$match = str_replace("/", "\/", $match);
$match = str_replace(".", "\.", $match);
$match = str_replace("+", "\+", $match);
$pattern = "/(onclick=[\'\"]{0,1}image_window\(this\)[\'\"]{0,1}) (.*)(src=\"$match\")/iU";
$replacement = "onclick='mw_image_window(this, $size[0], $size[1])' $2$3";
if ($size[0] > $board[bo_image_width])
$replacement .= " width=\"$board[bo_image_width]\"";
$data = @preg_replace($pattern, $replacement, $data);
}
}
$view[rich_content] = $data;
}
댓글 전체