리스트에서 이미지 클릭시 원본 새창으로 뜨게 하는법 어떻게 하나요? ㅠ
본문
view 스킨에서는 이미지를 클릭시 원본 사진이 확대되어 새창으로 열리는데요..
list 페이지에서 이미지를 클릭시 나오게 하고 싶어서요 ㅠㅠ 도와주십시오.
현재 list페이지의 이미지를 불러오는 소스가 이거인것 같습니다.
어떻게 바꿔야 할까요..?
<li>
<div class="gall_chk">
<?php if ($is_checkbox) { ?>
<label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
<?php } ?>
<span class="sound_only">
<?php
if ($wr_id == $list[$i]['wr_id'])
echo "<span class=\"bo_current\">열람중</span>";
else
echo $list[$i]['num'];
?>
</span>
</div>
<!-- <a href="<?php echo $list[$i]['href'] ?>"> -->
<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<span class="is_notice">공지</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">no image</span>';
}
echo $img_content;
}
?>
<!-- </a> -->
</li>
답변 1
아래 소스를 참고해보세요.
<?php
$sql = " select * from {$g5['board_file_table']} where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
$down_link = "view_image.php?bo_table={$bo_table}&fn={$row['bf_file']}";
}
?>
<a href="<?php echo $down_link; ?>" target="_blank">
<?php
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}
echo $img_content;
?>
</a>
답변을 작성하시기 전에 로그인 해주세요.