최신글과 각 게시물 리스트 이미지 출력 태그에 hook 적용

This commit is contained in:
thisgun
2020-09-24 15:20:24 +09:00
parent 69c839ef0f
commit 2f9bb48342
23 changed files with 27 additions and 24 deletions

View File

@ -1403,7 +1403,8 @@ function view_file_link($file, $width, $height, $content='')
$attr = '';
if (preg_match("/\.({$config['cf_image_extension']})$/i", $file)) {
$img = '<a href="'.G5_BBS_URL.'/view_image.php?bo_table='.$board['bo_table'].'&amp;fn='.urlencode($file).'" target="_blank" class="view_image">';
$attr_href = run_replace('thumb_view_image_href', G5_BBS_URL.'/view_image.php?bo_table='.$board['bo_table'].'&amp;fn='.urlencode($file), $file, $board['bo_table'], $width, $height, $content);
$img = '<a href="'.$attr_href.'" target="_blank" class="view_image">';
$img .= '<img src="'.G5_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file).'" alt="'.$content.'" '.$attr.'>';
$img .= '</a>';

View File

@ -198,11 +198,12 @@ function get_view_thumbnail($contents, $thumb_width=0)
} else {
$thumb_tag = '<img src="'.G5_URL.str_replace($filename, $thumb_file, $data_path).'" alt="'.$alt.'"/>';
}
// $img_tag에 editor 경로가 있으면 원본보기 링크 추가
if(strpos($img_tag, G5_DATA_DIR.'/'.G5_EDITOR_DIR) && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) {
$imgurl = str_replace(G5_URL, "", $src);
$thumb_tag = '<a href="'.G5_BBS_URL.'/view_image.php?fn='.urlencode($imgurl).'" target="_blank" class="view_image">'.$thumb_tag.'</a>';
$attr_href = run_replace('thumb_view_image_href', G5_BBS_URL.'/view_image.php?fn='.urlencode($imgurl), $filename, '', $width, $height, $alt);
$thumb_tag = '<a href="'.$attr_href.'" target="_blank" class="view_image">'.$thumb_tag.'</a>';
}
$contents = str_replace($img_tag, $thumb_tag, $contents);