갤러리 최신글 소스 인데요 이미지 클릭시 새창으로 뜨게 하려면?
아래는 갤러리 최신글 소스 입니다.
이미지 클릭시 새창으로 뜨게 하려면 어떤곳을 고쳐야 할까요?
========================================================
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width='100%' border='1' bordercolor="#eeeeee" cellspacing='0' cellpadding='0' style="
border-collapse:collapse; border-top:3 solid #cccccc;
">
<tr>
<td>
<table width='100%' border='0' cellspacing='0' cellpadding='3'>
<tr bgcolor="#f8f8f8">
<td width='16'></td>
<td width='100%' height="20" align="left" valign="bottom" style="padding-top:5"> <a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><b><?=$board[bo_subject]?></a></b> </a></td><td align="right">
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/icon_more.gif' border=0></a></td>
</tr>
<tr>
<td width='16'></td>
<td colspan="2" width='100%'>
<table width=98% border=0>
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
echo '<td width=20></td>';
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
echo <<<HEREDOC
<td width='250' valign='top' align='center'>
<table width='250' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='250' height='5' align='center'></td>
</tr>
<tr>
<td width='250' align='center'>
<div style='width:250px;;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='250' border='0' align='absmiddle' title='$title'></a>
</div>
</td>
</tr>
</table>
</td>
HEREDOC;
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>게시물이 없습니다.<? } ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
이미지 클릭시 새창으로 뜨게 하려면 어떤곳을 고쳐야 할까요?
========================================================
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width='100%' border='1' bordercolor="#eeeeee" cellspacing='0' cellpadding='0' style="
border-collapse:collapse; border-top:3 solid #cccccc;
">
<tr>
<td>
<table width='100%' border='0' cellspacing='0' cellpadding='3'>
<tr bgcolor="#f8f8f8">
<td width='16'></td>
<td width='100%' height="20" align="left" valign="bottom" style="padding-top:5"> <a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><b><?=$board[bo_subject]?></a></b> </a></td><td align="right">
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/icon_more.gif' border=0></a></td>
</tr>
<tr>
<td width='16'></td>
<td colspan="2" width='100%'>
<table width=98% border=0>
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
echo '<td width=20></td>';
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
echo <<<HEREDOC
<td width='250' valign='top' align='center'>
<table width='250' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='250' height='5' align='center'></td>
</tr>
<tr>
<td width='250' align='center'>
<div style='width:250px;;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='250' border='0' align='absmiddle' title='$title'></a>
</div>
</td>
</tr>
</table>
</td>
HEREDOC;
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>게시물이 없습니다.<? } ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 2개
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='250' border='0' align='absmiddle' title='$title'></a>
</div>
위 부분을
<div style='width:250px;;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href="#" onClick="window.open('{$img}', 'popup', 'scrollbars=yes,resizable=no,width=600,height=400,left=50,top=50');"><img src='{$img}' width='250' border='0' align='absmiddle' title='$title'></a>
</div>
이렇게 수정해 보세요..
아니면 걍...
<div style='width:250px;;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='{$img}' target='_blank'><img src='{$img}' width='250' border='0' align='absmiddle' title='$title'></a>
</div>
이렇게 하셔도 되구요.
답변 감사드립니다.
그런데 이미지만 뜨는게 아니고 웹브라우져가 같이 뜨네요?
이미지만 원본크기로 뜨게하려면 어떻게 해야하나요?
한번더 염치없이 부탁 드립니다.