테스트 사이트 - 개발 중인 베타 버전입니다

갤러리 게시판 list(목록)에서 이미지 클릭시 새창으로 원본이미지 띄우기

츠나미츠나미 2년 전 조회 3,673

보통 view에서 리사이징, 썸네일파일이 아닌 원본 이미지 넣기는 많은데...

그걸 list에 적용 했을 때 뜨지 않아서... 

자료를 찾다찾다 ...결국 질문을 드리러 왔습니다. ㅠㅠ

 

이렇게 게시판 list의 이미지를 클릭했을 때

해당 게시물 이동이 아닌 원본 이미지를 새창에 띄우고 싶은데

간단하게 a href="" 에 원본이미지 주소만 가져오면 되겠구나해서

별걸 다 적용해 봤는데요

 

 

 

http://smartly01.zc.bz/bbs/view_image.php?bo_table=sm3_list02&fn=" target="_blank" class="view_image">

 

http://도메인/bbs/view_image.php?bo_table=sm3_list02&fn

http://도메인/bbs/view_image.php?bo_table=sm3_list02

http://도메인/file/sm3_list02/

까지 밖에 못 찾고...세부 jpg의 파일을 못 찾더라구요...

(사실 위에 경로가 맞는지도 모르겠지만;;;)

 

list.skin.php 의 

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

2년 전

<==이렇게 해서 이미지명이 안나온다는 것은 첨부 이미지가 없는 것 같군요

에디터로 삽입한 이미지는 저렇게해서 나오지않습니다

 $thumb = get_list_thumbnail(~~~~<==이 부분을 

"> <== 위쪽에 코드를 옮기고

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

츠나미츠나미
2년 전
<div class="gall_img">
<!--
<a href="<?php echo $list[$i]['href'] ?>">원본
<a href="<?= G5_BBS_URL ?>/view_image.php?bo_table=<?= $bo_table ?>&amp;fn=<?= $list[$i]['file'][$j]['file'] ?>" target="_blank" class="view_image">
-->
<a href="<?= G5_DATA_URL."/file/$bo_table/".$list[$i]['file'][0]['file'] ?>">

<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<span class="is_notice" style="<?php echo $line_height_style; ?>">공지</span>
<?php } else {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);

if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
} else {
$img_content = '<span class="no_image" style="'.$line_height_style.'">no image</span>';
}

echo run_replace('thumb_image_tag', $img_content, $thumb);
}
?>
</a>
</div>

php호출하는걸 a로 감싸고 있는 형태인데 a태그 위로 ... 옮겨지나요?;;;
$thumb = get_list_thumbnail(~~~ 올렸더니 에러 뜨더라구요
<a href="<?php echo $thumb['org'];?>"는 빈공백으로 아무것도 나타나지 않았어요 ㅠㅠ
균이
2년 전
<div class="gall_img">
<?php
$target='';
if ($list[$i]['is_notice']) $href= $list[$i]['href']; // 공지사항
else{
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);

if($thumb['src']){
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
$href = $thumb['org']; $target="target='_blank'";
}else{
$img_content = '<span class="no_image" style="'.$line_height_style.'">no image</span>';
$href = "javascript:void(0);";
}

}
?>

<a href="<?php echo $href;?>" <?php echo $target;?>>
<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<span class="is_notice" style="<?php echo $line_height_style; ?>">공지</span>
<?php } else {
echo run_replace('thumb_image_tag', $img_content, $thumb);
}
?>
</a>
</div>
s
2년 전

여기서

echo G5_BBS_URL."/file/$bo_table/".$list[$i][file][0][file]; 

했을때 출력되는 URL을 접속했을시 실지 이미지데이터가 존재하는지 확인이 필요할 듯 합니다.

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 3개

츠나미츠나미
2년 전
잘은 모르겠지만
<?php echo G5_BBS_URL."/file/$bo_table/".$list[$i][file][0][file]; ?>
이렇게 쓰고 출력을 보니(이케 쓰는게 맞을는지...ㅠㅠ)
출력: http://도메인/bbs/file/sm3_list02/
게시판 네임까지만 뜨고 파일 주소와 이름이 뜨지 않아요...
s
swallow
2년 전
PHP 버전을 알수 있을까요?
$list[$i][file][0][file] 와 같이 인덱스명을 따옴표없이 되어 있는데 표준대로 하면
$list[$i]['file'][0]['file'] 이어야 합니다.
츠나미츠나미
2년 전
PHP Version 5.3.3 이라고 되어있구요
PHP를 아예 몰라서 사실상 위에 것도 어디서 보고 긁어온거라ㅠㅠ

<div class="gall_img">
<!--
<a href="<?php echo $list[$i]['href'] ?>">원본
<a href="<?= G5_BBS_URL ?>/view_image.php?bo_table=<?= $bo_table ?>&amp;fn=<?= $list[$i]['file'][$j]['file'] ?>" target="_blank" class="view_image">
-->
<a href="<?= G5_DATA_URL."/file/$bo_table/".$list[$i]['file'][0]['file'] ?>">

<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<span class="is_notice" style="<?php echo $line_height_style; ?>">공지</span>
<?php } else {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);

if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
} else {
$img_content = '<span class="no_image" style="'.$line_height_style.'">no image</span>';
}

echo run_replace('thumb_image_tag', $img_content, $thumb);
}
?>
</a>
</div>

점으로 처리해봐도 세부 정보는 안나오네요...기본 list.skin.php 파일입니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인