게시판 내용 사진 업로드를 했을 경우 ... 채택완료
다시 한 번 질문 드려봅니다.
몇 일 찾아보았는데 방법이 없나요?
>> 게시판 내용 사진 업로드를 했을 경우
=> 사진에 특정 url를 걸으면 그 특정 url로 이동하고
=> 사진에 url를 링크하지 않으면 기존 대로 그 사진이 큰 사진으로 열리는
문법을
if (?????????) {
???????
} else {
if(strpos($img_tag, G5_DATA_DIR.'/'.G5_EDITOR_DIR) && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) {
$imgurl = str_replace(G5_URL, "", $src);
$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>';
}
}
답변 3개
간단한 합니다
view_image.php를 수정할 수 있으면 기존 이미지 팝업처럼도 만들 수 있긴하지만 어려울테니
다음 처럼 해보세요
게시판 관리에서 화일설명사용에 체크 하고 여기에 링크 주소를 입력하게 합니다
그런 다음 질문의 if 물음표 자리에
if($file[$i]['bf_content']){ ?>
window.open("<?php echo $file[$i]['bf_content']?>", 'imgpop');
<?php } else{
~~
답변에 대한 댓글 3개
아래와 같이 했는데 에러가 발생합니다.
제가 타이핑을 잘못 했나요?
/lib/common.lib.php
// 변경 시작
if ($file[$i]['bf_content']) {
window.open("<?php echo $file[$i]['bf_content']?>", 'imgpop');
} else {
if (preg_match("/\.({$config['cf_image_extension']})$/i", $file) && isset($board['bo_table'])) {
$attr_href = run_replace('thumb_view_image_href', G5_BBS_URL.'/view_image.php?bo_table='.$board['bo_table'].'&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>';
return $img;
}
}
// 변경 끝
<< 에러 메시지 >>
Warning: Illegal string offset 'bf_content' in /hosting/ad/html/lib/common.lib.php on line 1579
Warning: Use of undefined constant window - assumed 'window' (this will throw an Error in a future version of PHP) in /hosting/ad/html/lib/common.lib.php on line 1581
Fatal error: Uncaught Error: Call to undefined function open() in /hosting/ad/html/lib/common.lib.php:1581 Stack trace: #0 /hosting/ad/html/lib/common.lib.php(372): view_file_link() #1 /hosting/ad/html/lib/common.lib.php(514): get_file() #2 /hosting/ad/html/lib/common.lib.php(528): get_list() #3 /hosting/ad/html/bbs/view.php(112): get_view() #4 /hosting/ad/html/nariya/bbs/board.php(225): include_once('/hosting/adname...') #5 /hosting/ad/html/extend/_nariya.php(152): include_once('/hosting/adname...') #6 /hosting/ad/html/common.php(852): include_once('/hosting/adname...') #7 /hosting/ad/html/bbs/_common.php(2): include_once('/hosting/adname...') #8 /hosting/ad/html/bbs/board.php(2): include_once('/hosting/adname...') #9 {main} thrown in /hosting/ad/html/lib/common.lib.php on line 1581
if ($file[$i]['bf_content']) { ==>
if ($view['file'][$i]['bf_content']) {
게시판 설정에서 <파일 설명 사용>에 체크 후 사용하면 됩니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인