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

뷰페이지에서 외부이미지 리사이즈 오류, 클릭시 원본이 안나옵니다

· 12년 전 · 1492 · 2
기본스킨을 수정해서 사용하고 있습니다. 용량이 부족해서 외부에서 이미지 주소를 받아오는데
이미지가 잘리네요. 리사이징이 안되는건 아닌데 이상하게 게시판크기보다 좀 크게 리사이징이 되서 오른쪽부분이 잘립니다. 게시판 설정은 가로크기 95%로 해둬서 <?=$width?>는 95%로 적용되는 것 같더라구요. 그래서 더 복잡하게 느껴지네요ㅠㅠ..
아래 view 파일 소스입니다. 어디서 잘못된건지 좀 알려주시면 감사하겠습니다.


그리고 이미지를 클릭하면 외부이미지도 해당 주소로 연결되는게 아니고 그누보드 자체적으로 이미지창을 띄워서 보여주더군요. 그런데 이게 평소에는 원본이 잘 뜨는데 이미지에 크기를 정해주면 클릭해도 원본이 안뜨고 정해준 크기로만 뜨네요. 보기 좋으라고 <img src="이미지주소" width="크기지정"> 이런식으로 사용하는 게시판이 있거든요. 그랬더니 이미지를 클릭해도 "크기지정" 크기로 떠서 애를 먹고 있습니다. 크기를 지정해도 클릭시에는 원본크기로 뜨게 할 수 있을까요? 안된다면 그누보드 자체적인 이미지창이 아니라 그냥 외부주소로 연결되게 하는 방법이라도 부탁드립니다.


[code]
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0" style="table-layout:fixed;"><tr><td>

<!-- 링크 버튼 -->
<div style="float:left;">
<?
ob_start();
?>
<? if ($search_href) { echo "&nbsp;<a href=\"$search_href\">search list</a> "; } ?>
<? echo "&nbsp;<a href=\"$list_href\">list</a> "; ?>
<? if ($update_href) { echo "&nbsp;<a href=\"$update_href\">modify</a> "; } ?>
<? if ($delete_href) { echo "&nbsp;<a href=\"$delete_href\">delete</a> "; } ?>
<? if ($reply_href) { echo "&nbsp;<a href=\"$reply_href\">reply</a> "; } ?>
<? if ($write_href) { echo "&nbsp;<a href=\"$write_href\">write</a> "; } ?>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div>

<table border=0 cellpadding=0 cellspacing=0 width="100%" style="table-layout:fixed; margin:0;">
<tr>
<td align=center style='word-break:break-all;' height=70 class=textarea>
<i>
<?=cut_hangul_last(get_text($view[wr_subject]))?>
</i><br /><font class=comment>DATE <?=date("y.m.d", strtotime($view[wr_datetime]))?>&nbsp;&nbsp;/&nbsp;&nbsp;TIME <?=date("H:i", strtotime($view[wr_datetime]))?></font>
</td>
</tr>


<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++) {
if ($view[file][$i][source] && !$view[file][$i][view]) {
$cnt++;
echo "<tr><td height=30>";
echo "<a href=\"javascript:file_download('{$view[file][$i][href]}', '".urlencode($view[file][$i][source])."');\" title='{$view[file][$i][content]}'>";
echo "&nbsp;<span style=\"color:#888;\">{$view[file][$i][source]} ({$view[file][$i][size]})</span>";
echo "&nbsp;<span style=\"color:#ff6600; font-size:11px;\">[{$view[file][$i][download]}]</span>";
echo "&nbsp;<span style=\"color:#d3d3d3; font-size:11px;\">DATE : {$view[file][$i][datetime]}</span>";
echo "</a></td></tr>";
}
}

// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++) {
if ($view[link][$i]) {
$cnt++;
$link = cut_str($view[link][$i], 70);
echo "";
}
}
?>
<tr>
<td align="center" style="word-break:break-all; padding:60 10 60 10;">
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";
}
?>

<!-- 내용 출력 -->
<span id="writeContents"><?=$view[content];?></span>

<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>

<div style='padding-top:140;padding-bottom:50;'><font color=#000000>Copyright ⓒ&nbsp;<b><?=$view[name]?></b> All Rights Reserved.</font></div>

<? if ($nogood_href) {?>
<div style="float:right;"><a href="<?=$nogood_href?>" target="hiddenframe"><img src="<?=$board_skin_path?>/img/icon_nogood.gif" border='0' align="absmiddle"> 싫어요</a> <?=number_format($view[wr_nogood])?></div>
<? } ?>

<? if ($good_href) {?>
<div style="float:right;"><a href="<?=$good_href?>" target="hiddenframe"><img src="<?=$board_skin_path?>/img/icon_new.gif" border='0' align="absmiddle"> 좋아요</a> <?=number_format($view[wr_good])?></div>
<? } ?>

</td>
</tr>
<? if ($is_signature) { echo "<tr><td align='center' style='border-bottom:1px solid #E7E7E7; padding:5px 0;'>$signature</td></tr>"; } // 서명 출력 ?>
</table>
<br>

<?
// 코멘트 입출력
include_once("./view_comment.php");
?>

<div style="clear:both; height:43px;">
<div style="float:left; margin-top:10px;">
<? if ($prev_href) { echo "&nbsp;<a href=\"$prev_href\" title=\"$prev_wr_subject\">prev</a>&nbsp;"; } ?>
<? if ($next_href) { echo "&nbsp;<a href=\"$next_href\" title=\"$next_wr_subject\">next</a>&nbsp;"; } ?>
</div>

<!-- 링크 버튼 -->
<div style="float:left; margin-top:10px;">
<?=$link_buttons?>
</div>
</div>

</td></tr></table><br>

<script type="text/javascript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+decodeURIComponent(file)+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>

<script type="text/javascript" src="<?="$g4[path]/js/board.js"?>"></script>
<script type="text/javascript">
window.onload=function() {
resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
}
</script>
<!-- 게시글 보기 끝 -->
[/code]

댓글 작성

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

로그인하기

댓글 2개

이미지에 크기를 정해주면 클릭해도 원본이 안뜨고 정해준 크기로만 <-- 직접 크기를 정해주는 코드는 어디있나요?
어쨌던 width 값을 지정해버리면 원본 크기로 나오지않게 되어있습니다
아래 링크를 참고하세요
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=129898
답글 감사합니다~ 늦게 채택드려서 죄송해요. 아직 잘은 모르겠지만 걸어주신 링크보고 공부하겠습니다. 직접 크기를 정해준 건 그냥 글쓰기에서 img 태그를 사용할 때 속성으로 width값을 붙였더니 그 크기대로 새창이 뜨네요..ㅠㅠ

게시글 목록

번호 제목
284113
284104
284099
284097
284096
284092
284090
284085
284084
284080
284077
284073
284070
284061
284058
284056
284050
284048
284047
284046