첨부파일의 이미지사이즈 문의드립니다.
본문
관리자에서 게시판폭, 첨부이미지파일폭 모두 630으로 지정했는데요.
첨부한 이미지파일이 실제크기로 나오네요 ㅠㅠ (가로가 1000이 훨씬넘습니다. 630으로 고정하고싶은데요)
어느 부분을 수정해야할까요?
밑에 소스를 남겨봅니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$ViewRows = 7; // 출력 개수
$rewidth = 90; // 썸네일 이미지 가로크기
$reheight = 60; // 썸네일 이미지 세로크기
$settime = 5; // 타임아웃 시간 (초)
$td_width = $rewidth + 14;
$td_height = $reheight + 30;
$file = array();
for ( $i = 0; $i < $view[file][count]; $i++ )
{
if ( $view[file][$i][file] )
$file[] = $view[file][$i];
}
$mb = get_member($view[mb_id]);
?>
<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<!-- table width="100%" height="28" align="center" cellpadding="0" cellspacing="0" border="0" style="margin-bottom:10px;">
<tr>
<td width="15" valign="top"><img src="<?=$board_skin_path?>/img/ddi_left.png" class="png24"></td>
<td class="top_title" style="background-image: url(<?=$board_skin_path?>/img/ddi_beda.jpg); background-repeat: repeat-x; ">
<? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?> <?=cut_hangul_last(get_text($view[wr_subject]))?>
</td>
<td align="right" class="top_title" style="background-image: url(<?=$board_skin_path?>/img/ddi_beda.jpg); background-repeat: repeat-x; ">
hit : <?=number_format($view[wr_hit])?>
</td>
<td width="15" valign="top"><img src="<?=$board_skin_path?>/img/ddi_right.png"></td>
</tr>
</table -->
<table border=0 cellpadding=0 cellspacing=0 width=<?=$width?>>
<?
// 가변 파일
$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 background=\"$board_skin_path/img/view_dot.gif\">";
echo " <img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle border='0'>";
echo "<a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'>";
echo " <span style=\"color:#888;\">{$view[file][$i][source]} ({$view[file][$i][size]})</span>";
echo " <span style=\"color:#ff6600; font-size:11px;\">[{$view[file][$i][download]}]</span>";
echo " <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 class=pL15 style=color:#888; height=30 background=\"$board_skin_path/img/view_dot.gif\">";
echo "홈페이지 : ";
echo "<a href='{$view[link_href][$i]}' target=_blank>";
echo " <span style=\"color:#888;\">{$link}</span>";
echo " <span style=\"color:#ff6600; font-size:11px;\">[{$view[link_hit][$i]}]</span>";
echo "</a></td></tr>";
}
}
*/
?>
<tr>
<td>
<table width=100% border=0 cellpadding=0 cellspacing=0 align=center>
<tr>
<td width="300" height="180" class="pL35 pT25" valign="top" style="background:url(<?=$board_skin_path?>/img/map_beda.jpg); background-repeat: repeat-x;">
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td class="pB10 small_map">지 점 이 름 : <span style="color:#fff17c; font-weight:bold;"><?=cut_hangul_last(get_text($view[wr_subject]))?></span> </td>
</tr>
<tr>
<td class="pB10 small_map">전 화 번 호 : <span style="font-weight:bold; color:#fff17c;"><?=$view[wr_1]?></span> </td>
</tr>
<tr>
<td class="pB10 small_map">팩 스 번 호 : <?=$view[wr_2]?> </td>
</tr>
<tr>
<td class="pB10 small_map">이 메 일 : <?=$view[wr_6]?> </td>
</tr>
<tr>
<td class="pB10 small_map">매 장 위 치 : <?=$view[wr_3]?> </td>
</tr>
</table>
</td>
<td valign="top">
<input type="hidden" style="width:200px;" name="wr_9" id="wr_9" value="<?=$write[wr_9]?>">
<input type="hidden" style="width:200px;" name="wr_10" id="wr_10" value="<?=$write[wr_10]?>">
<div id="map-canvas" style="clear:both;width:315px;height:230px;"></div>
<div id="roadview" style="clear:both;width:0px;height:0px;"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="50" style="word-break:break-all; padding-top:10px;">
<?
// 파일 출력
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]; // view_image($view, '0', '') 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
<? if ($nogood_href) {?>
<div style="width:72px; height:55px; background:url(<?=$board_skin_path?>/img/good_bg.gif) no-repeat; text-align:center; float:right;">
<div style="color:#888; margin:7px 0 5px 0;">비추천 : <?=number_format($view[wr_nogood])?></div>
<div><a href="<?=$nogood_href?>" target="hiddenframe"><img src="<?=$board_skin_path?>/img/icon_nogood.gif" border='0' align="absmiddle"></a></div>
</div>
<? } ?>
<? if ($good_href) {?>
<div style="width:72px; height:55px; background:url(<?=$board_skin_path?>/img/good_bg.gif) no-repeat; text-align:center; float:right;">
<div style="color:#888; margin:7px 0 5px 0;"><span style='color:crimson;'>추천 : <?=number_format($view[wr_good])?></span></div>
<div><a href="<?=$good_href?>" target="hiddenframe"><img src="<?=$board_skin_path?>/img/icon_good.gif" border='0' align="absmiddle"></a></div>
</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="height:1px; line-height:1px; font-size:1px; background-color:#ddd; clear:both;"> </div -->
<!-- div style="clear:both; height:43px;">
<div style="float:left; margin-top:10px;">
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</div>
<div style="float:right; margin-top:10px;">
<?=$link_buttons?>
</div>
</div -->
<div style="height:30px; line-height:1px; font-size:1px; clear:both;"> </div>
</td></tr></table><br>
<div style="height:1px; line-height:1px; font-size:1px; background-color:#ddd; clear:both;"> </div>
<br>
<div style="clear:both; height:30px;">
<!-- div style="float:left; margin-top:6px;">
<img src="<?=$board_skin_path?>/img/icon_date.gif" align=absmiddle border='0'>
<span style="color:#888888;">작성일 : <?=date("y-m-d H:i", strtotime($view[wr_datetime]))?></span>
</div -->
<!-- 링크 버튼 -->
<? if ($no_ht != '0') { ?>
<div style="float:right;">
<?
ob_start();
?>
<!--
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
-->
<? if($sca) { ?>
<? // if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_list_search.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? } else { ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_modify.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div>
<? } ?>
</div>
<script type="text/javascript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+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 -->
<?//=$_SERVER['HTTP_HOST']?>
<? if ($_SERVER['HTTP_HOST'] == 'www.hwaggusam.com' || $_SERVER['HTTP_HOST'] == 'hwaggusam.com') { ?>
<script type="text/javascript" src="http://apis.daum.net/maps/maps3.js?apikey=<?=$config[cf_10]?>" charset="utf-8"></script>
<? } else if ($_SERVER['HTTP_HOST'] == 'www.hwaggusam.co.kr' || $_SERVER['HTTP_HOST'] == 'hwaggusam.co.kr') { ?>
<script type="text/javascript" src="http://apis.daum.net/maps/maps3.js?apikey=<?=$config[cf_8]?>" charset="utf-8"></script>
<? } ?>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready(function () {
//$('<div id="map-canvas" style="clear:both;float:left;margin-top:5px;margin-bottom:20px;"></div>')
//.appendTo($('#block-content'))
//.width('100%')
//.height('400px');
var level = $('#form-map-level').val();
var lat = $('#wr_9').val();
var lng = $('#wr_10').val();
var map;
var latLng = new daum.maps.LatLng(lat, lng);
map = new daum.maps.Map(document.getElementById('map-canvas'), {
center: latLng,
level : level,
//mapTypeId: daum.maps.MapTypeId.HYBRID,
//mapTypeId: daum.maps.MapTypeId.ROADMAP,
logo: true
});
var zoomControl = new daum.maps.ZoomControl();
map.addControl(zoomControl, daum.maps.ControlPosition.RIGHT);
var mapTypeControl = new daum.maps.MapTypeControl();
map.addControl(mapTypeControl, daum.maps.ControlPosition.TOPRIGHT);
var icon = new daum.maps.MarkerImage(
'http://localimg.daum-img.net/localimages/07/2009/map/icon/blog_icon01_on.png',
new daum.maps.Size(31, 34),
new daum.maps.Point(16,34),
"poly",
"1,20,1,9,5,2,10,0,21,0,27,3,30,9,30,20,17,33,14,33"
);
var marker = new daum.maps.Marker({
position: latLng,
//image: icon, 아이콘 사용시 사용
draggable: false
});
var infowindow = new daum.maps.InfoWindow({
content:'<p style="margin:5px 0 5px 12px; font-size:12px"><?=$view[wr_subject]?></p>'
});
infowindow.open(map, marker);
marker.setMap(map);
//로드뷰 출력
var p = new daum.maps.LatLng(lat, lng);
var rc = new daum.maps.RoadviewClient();
var rv = new daum.maps.Roadview(document.getElementById("roadview"));
rc.getNearestPanoId(p, 50, function(panoid) {
if(panoid !== null){ // 로드뷰 정보 없으면 출력 안함
rv.setPanoId(panoid, p);
rv.setViewpoint({
pan:1,
tilt: 1,
zoom: 0 });
}else{
$("#roadview").hide();
}
});
});
</script>
<!-- 게시글 보기 끝 -->
답변 2
resizeBoardImage() 가 이미지 사이즈를 줄여주는 역할인데 저걸 주석처리해서 실행 안되게 해놓았으니
원본 크기로 나오는 것이 당연합니다
출력되는 이미지에 class='resize_image' 로 클래스를 지정해주고..
스타일시트에서
<style>
.resize_image {max-width:630px;}
</style>
형태로 하시면 될거같습니다. 단 xhtml 기준입니다.