다운로드와 이미지 리사이징이 안됩니다.. 정보
그누보드 다운로드와 이미지 리사이징이 안됩니다..본문
안녕하세요?
뭔가 잘못된 모양입니다^^;
1. 첨부파일 다운로드가 안됩니다.
"Not Found
The requested URL /php/bbs/download.php was not found on this server."
2. 게시판 첨부파일 이미지 리사이징이 안되어, 이미지만큼 늘어나 보드가 깨어집니다.
basic기본 보드 쓰고 있는데 무엇이 문제인지 도움 주시면 감사하겠습니다.
보드 basic스킨 -- gbview.php
..............................................................
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// HTML 이면
if ($write[wr_html])
$content = preg_replace("/(\<img)([^\>]*)(\>)/i", "\\1 name=target_resize_image[] onclick=image_window2(this) style='cursor:hand;' tmp_width=0 tmp_height=0 \\2 \\3", $content);
?>
<script language="JavaScript">
<!--
function image_window2(src)
{
var img = src.src;
var tmp_w = w = src.tmp_width;
var tmp_h = h = src.tmp_height;
winl = (screen.width-w)/2;
wint = (screen.height-h)/3;
if (w >= screen.width) {
winl = 0;
w = screen.width - 10;
h = (parseInt)(w * (h / w));
}
if (h >= screen.height) {
wint = 0;
h = screen.height - 80;
w = (parseInt)(h * (w / h));
}
var settings ='width='+w+',';
settings +='height='+h+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=no,';
settings +='status=no';
win=window.open("","newWindow",settings);
win.document.open();
win.document.write ("<html><head><meta http-equiv='content-type' content='text/html; charset=euc-kr'>");
win.document.write ("<title>이미지 보기</title></head>");
win.document.write ("<body leftmargin=0 topmargin=0>");
win.document.write ("<img src='"+img+"' width='"+w+"' height='"+h+"'border=0 onclick='window.close();' style='cursor:hand'>");
win.document.write ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
//-->
</script>
<style type=text/css>
.tt {font-size:9pt;COLOR: #575757;}
</style>
<!-- 원글 내용 -->
<table width=<?=$width?> border=0 align=center cellpadding=4 cellspacing=0>
<tr>
<td>
<img name=main_table width=<?=$width?> height=0 border=0>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td rowspan=6 width=3><img src='<?=$board_skin?>/viewbar_01.gif' width=3 height=54></td>
<td colspan=2 bgcolor=#C9759F></td>
<td rowspan=6 width=3><img src='<?=$board_skin?>/viewbar_02.gif' width=3 height=54></td>
</tr>
<tr height=25>
<td> <span class=tt><b><? if ($is_category) echo "[$category_name] "; ?><?=$subject?></b></span></td>
<td align=right><img src='<?=$board_skin?>/icon_watch.gif' width=10 height=13> <font color=#DC7899><?=$datetime?></font> </td>
</tr>
<tr><td colspan=2 background='<?=$board_skin?>/bg_linein.gif'></td></tr>
<tr><td colspan=2 height=23> 이름 : <?=$name?> (<?=$ip?>) 조회: <?=$hit?> <? if ($is_good) echo "<font color='#cf4900'>추천</font> : " . $good; ?> <? if ($is_nogood) echo "<font color='#cf4900'>비추천</font> : " . $nogood; ?></td></tr>
<tr><td colspan=2 style='background-color:#AFAFAF; height:1px'></td></tr>
<tr><td colspan=2 style='background-color:#EDEDED; height:3px'></td></tr>
</table>
</td>
</tr>
<tr>
<td colspan=2>
<table width=100% cellpadding=5>
<?
// 링크 설정한 값만큼 출력
for ($i=1; $i<=$cfg[link_count]; $i++) {
if ($link[$i][link]) { echo "<tr><td class=tt> <img src='$board_skin/icon_link.gif' align='absmiddle'> <a href='{$link[$i][href]}' target='$default[de_link_target]'><span class=tt>{$link[$i][link]}</span></a>, Hit:{$link[$i][hit]}</td></tr>"; }
}
?>
<?
// 파일 업로드 설정한 값만큼 출력
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($file[$i][source]) { echo "<tr><td class=tt> <img src='$board_skin/icon_file.gif' align='absmiddle'> <a href='{$file[$i][href]}'><span class=tt>{$file[$i][source]} ({$file[$i][size]})</span></a>, Down:{$file[$i][download]}</td></tr>"; }
}
?>
<tr>
<td style='word-break:break-all;' class='lh' height=100>
<?
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($file[$i][view]) { echo $file[$i][view]; }
}
?>
<!-- 내용 출력 -->
<span class=content><?=$content?></span>
<!-- 테러 태그 방지용 -->
</xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
<? if ($is_signature) { echo "<tr><td>$signature</td></tr>"; } // 서명 출력 ?>
</table>
</td>
</tr>
</table><br>
<? if ($is_comment) { ?>
<!-- 코멘트 내용 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<a name='c<?=$list[$i][wr_id]?>'></a>
<table width=<?=$width?> border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td height=25 bgcolor=#F1F1F1> <?=$list[$i][name]?> (<?=$list[$i][ip]?>)</td>
<td align=right bgcolor=#F1F1F1><?=$list[$i][datetime]?> <? if ($list[$i][is_del]) { echo "{$list[$i][del_href]}<img src='$board_skin/com_del.gif' border=0 width=9 height=9 align=absmiddle></a> "; } ?></td>
</tr>
<tr>
<td colspan=2 valign=top>
<table width=100% cellpadding=7 cellspacing=0>
<tr>
<td style='word-break:break-all; text-align:justify;' class='lh tt'><?=$list[$i][content]?></td>
</tr>
</table>
</td>
</tr>
</table>
<? } // for ?>
<? if ($is_comment_write) { ?>
<!-- 코멘트 쓰기 -->
<table width=<?=$width?> align=center cellpadding=10 cellspacing=0 border=0 bgcolor=#F5F5F5>
<form name=fgbview method=post action='./?doc=bbs/gbupdate.php'>
<input type=hidden name=w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>' >
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=spart value='<?=$spart?>'>
<input type=hidden name=wr_id value='<?=$wr_id?>'>
<input type=hidden name=page value='<?=$page?>'>
<tr>
<td align=center>
<table width=100% cellpadding=0 cellspacing=0 bgcolor=#FFFFFF border=0>
<tr>
<td height=35> 이름 : <?=preg_replace("/class=input/", "class=ib", $c_name)?>
<? if ($is_guest) { ?>
비밀번호 : <input type=password name=wr_passwd size=10 class=ib required itemname='비밀번호'></td>
<? } ?>
<td align=right><a href='javascript:textarea_size(document.fgbview.wr_content, 5)'><img src='<?=$board_skin?>/icon_down.gif' border=0 align=absmiddle></a> <a href='javascript:textarea_size(document.fgbview.wr_content, -5)'><img src='<?=$board_skin?>/icon_up.gif' border=0 align=absmiddle></a> </td>
</tr>
<tr>
<td colspan=2 align=center>
<table width=98% cellpadding=0 cellspacing=0>
<tr><td><textarea name=wr_content style='border: 1px solid #C2C2C2; word-break:break-all; width:100%;' rows=5 required itemname='내용'></textarea></td><td width=64><input type=image src='<?="$board_skin/btncomment.gif"?>' border=0 align=absmiddle></td></tr>
<tr><td colspan=2 height=5></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</form>
</table><br>
<? } // if ?>
<? } // if ?>
<!-- 링크 -->
<table width=<?=$width?> align=center border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=75% height=35>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin/searchlist.gif' border=0 alt='검색목록' align=absmiddle></a>"; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin/list.gif' border=0 alt='목록' align=absmiddle></a>"; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin/write.gif' border=0 alt='글쓰기' align=absmiddle></a>"; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin/reply.gif' border=0 alt='답변' align=absmiddle></a>"; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin/edit.gif' border=0 alt='수정' align=absmiddle></a>"; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin/delete.gif' border=0 alt='삭제' align=absmiddle></a>"; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\"><img src='$board_skin/good.gif' border=0 alt='추천' align=absmiddle></a>"; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\"><img src='$board_skin/nogood.gif' border=0 alt='비추천' align=absmiddle></a>"; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin/copy.gif' border=0 alt='복사' align=absmiddle></a>"; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin/move.gif' border=0 alt='이동' align=absmiddle></a>"; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin/prev.gif' border=0 alt='이전글' align=absmiddle></a>"; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin/next.gif' border=0 alt='다음글' align=absmiddle></a>"; } ?>
</td>
</tr>
</table>
<script language="JavaScript">
<!--
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > document.main_table.width)
target[i].width = document.main_table.width;
}
}
window.onload = resize_image;
//-->
</script>
.............................................................................................
뭔가 잘못된 모양입니다^^;
1. 첨부파일 다운로드가 안됩니다.
"Not Found
The requested URL /php/bbs/download.php was not found on this server."
2. 게시판 첨부파일 이미지 리사이징이 안되어, 이미지만큼 늘어나 보드가 깨어집니다.
basic기본 보드 쓰고 있는데 무엇이 문제인지 도움 주시면 감사하겠습니다.
보드 basic스킨 -- gbview.php
..............................................................
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// HTML 이면
if ($write[wr_html])
$content = preg_replace("/(\<img)([^\>]*)(\>)/i", "\\1 name=target_resize_image[] onclick=image_window2(this) style='cursor:hand;' tmp_width=0 tmp_height=0 \\2 \\3", $content);
?>
<script language="JavaScript">
<!--
function image_window2(src)
{
var img = src.src;
var tmp_w = w = src.tmp_width;
var tmp_h = h = src.tmp_height;
winl = (screen.width-w)/2;
wint = (screen.height-h)/3;
if (w >= screen.width) {
winl = 0;
w = screen.width - 10;
h = (parseInt)(w * (h / w));
}
if (h >= screen.height) {
wint = 0;
h = screen.height - 80;
w = (parseInt)(h * (w / h));
}
var settings ='width='+w+',';
settings +='height='+h+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=no,';
settings +='status=no';
win=window.open("","newWindow",settings);
win.document.open();
win.document.write ("<html><head><meta http-equiv='content-type' content='text/html; charset=euc-kr'>");
win.document.write ("<title>이미지 보기</title></head>");
win.document.write ("<body leftmargin=0 topmargin=0>");
win.document.write ("<img src='"+img+"' width='"+w+"' height='"+h+"'border=0 onclick='window.close();' style='cursor:hand'>");
win.document.write ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
//-->
</script>
<style type=text/css>
.tt {font-size:9pt;COLOR: #575757;}
</style>
<!-- 원글 내용 -->
<table width=<?=$width?> border=0 align=center cellpadding=4 cellspacing=0>
<tr>
<td>
<img name=main_table width=<?=$width?> height=0 border=0>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td rowspan=6 width=3><img src='<?=$board_skin?>/viewbar_01.gif' width=3 height=54></td>
<td colspan=2 bgcolor=#C9759F></td>
<td rowspan=6 width=3><img src='<?=$board_skin?>/viewbar_02.gif' width=3 height=54></td>
</tr>
<tr height=25>
<td> <span class=tt><b><? if ($is_category) echo "[$category_name] "; ?><?=$subject?></b></span></td>
<td align=right><img src='<?=$board_skin?>/icon_watch.gif' width=10 height=13> <font color=#DC7899><?=$datetime?></font> </td>
</tr>
<tr><td colspan=2 background='<?=$board_skin?>/bg_linein.gif'></td></tr>
<tr><td colspan=2 height=23> 이름 : <?=$name?> (<?=$ip?>) 조회: <?=$hit?> <? if ($is_good) echo "<font color='#cf4900'>추천</font> : " . $good; ?> <? if ($is_nogood) echo "<font color='#cf4900'>비추천</font> : " . $nogood; ?></td></tr>
<tr><td colspan=2 style='background-color:#AFAFAF; height:1px'></td></tr>
<tr><td colspan=2 style='background-color:#EDEDED; height:3px'></td></tr>
</table>
</td>
</tr>
<tr>
<td colspan=2>
<table width=100% cellpadding=5>
<?
// 링크 설정한 값만큼 출력
for ($i=1; $i<=$cfg[link_count]; $i++) {
if ($link[$i][link]) { echo "<tr><td class=tt> <img src='$board_skin/icon_link.gif' align='absmiddle'> <a href='{$link[$i][href]}' target='$default[de_link_target]'><span class=tt>{$link[$i][link]}</span></a>, Hit:{$link[$i][hit]}</td></tr>"; }
}
?>
<?
// 파일 업로드 설정한 값만큼 출력
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($file[$i][source]) { echo "<tr><td class=tt> <img src='$board_skin/icon_file.gif' align='absmiddle'> <a href='{$file[$i][href]}'><span class=tt>{$file[$i][source]} ({$file[$i][size]})</span></a>, Down:{$file[$i][download]}</td></tr>"; }
}
?>
<tr>
<td style='word-break:break-all;' class='lh' height=100>
<?
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($file[$i][view]) { echo $file[$i][view]; }
}
?>
<!-- 내용 출력 -->
<span class=content><?=$content?></span>
<!-- 테러 태그 방지용 -->
</xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
<? if ($is_signature) { echo "<tr><td>$signature</td></tr>"; } // 서명 출력 ?>
</table>
</td>
</tr>
</table><br>
<? if ($is_comment) { ?>
<!-- 코멘트 내용 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<a name='c<?=$list[$i][wr_id]?>'></a>
<table width=<?=$width?> border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td height=25 bgcolor=#F1F1F1> <?=$list[$i][name]?> (<?=$list[$i][ip]?>)</td>
<td align=right bgcolor=#F1F1F1><?=$list[$i][datetime]?> <? if ($list[$i][is_del]) { echo "{$list[$i][del_href]}<img src='$board_skin/com_del.gif' border=0 width=9 height=9 align=absmiddle></a> "; } ?></td>
</tr>
<tr>
<td colspan=2 valign=top>
<table width=100% cellpadding=7 cellspacing=0>
<tr>
<td style='word-break:break-all; text-align:justify;' class='lh tt'><?=$list[$i][content]?></td>
</tr>
</table>
</td>
</tr>
</table>
<? } // for ?>
<? if ($is_comment_write) { ?>
<!-- 코멘트 쓰기 -->
<table width=<?=$width?> align=center cellpadding=10 cellspacing=0 border=0 bgcolor=#F5F5F5>
<form name=fgbview method=post action='./?doc=bbs/gbupdate.php'>
<input type=hidden name=w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>' >
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=spart value='<?=$spart?>'>
<input type=hidden name=wr_id value='<?=$wr_id?>'>
<input type=hidden name=page value='<?=$page?>'>
<tr>
<td align=center>
<table width=100% cellpadding=0 cellspacing=0 bgcolor=#FFFFFF border=0>
<tr>
<td height=35> 이름 : <?=preg_replace("/class=input/", "class=ib", $c_name)?>
<? if ($is_guest) { ?>
비밀번호 : <input type=password name=wr_passwd size=10 class=ib required itemname='비밀번호'></td>
<? } ?>
<td align=right><a href='javascript:textarea_size(document.fgbview.wr_content, 5)'><img src='<?=$board_skin?>/icon_down.gif' border=0 align=absmiddle></a> <a href='javascript:textarea_size(document.fgbview.wr_content, -5)'><img src='<?=$board_skin?>/icon_up.gif' border=0 align=absmiddle></a> </td>
</tr>
<tr>
<td colspan=2 align=center>
<table width=98% cellpadding=0 cellspacing=0>
<tr><td><textarea name=wr_content style='border: 1px solid #C2C2C2; word-break:break-all; width:100%;' rows=5 required itemname='내용'></textarea></td><td width=64><input type=image src='<?="$board_skin/btncomment.gif"?>' border=0 align=absmiddle></td></tr>
<tr><td colspan=2 height=5></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</form>
</table><br>
<? } // if ?>
<? } // if ?>
<!-- 링크 -->
<table width=<?=$width?> align=center border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=75% height=35>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin/searchlist.gif' border=0 alt='검색목록' align=absmiddle></a>"; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin/list.gif' border=0 alt='목록' align=absmiddle></a>"; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin/write.gif' border=0 alt='글쓰기' align=absmiddle></a>"; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin/reply.gif' border=0 alt='답변' align=absmiddle></a>"; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin/edit.gif' border=0 alt='수정' align=absmiddle></a>"; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin/delete.gif' border=0 alt='삭제' align=absmiddle></a>"; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\"><img src='$board_skin/good.gif' border=0 alt='추천' align=absmiddle></a>"; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\"><img src='$board_skin/nogood.gif' border=0 alt='비추천' align=absmiddle></a>"; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin/copy.gif' border=0 alt='복사' align=absmiddle></a>"; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin/move.gif' border=0 alt='이동' align=absmiddle></a>"; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin/prev.gif' border=0 alt='이전글' align=absmiddle></a>"; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin/next.gif' border=0 alt='다음글' align=absmiddle></a>"; } ?>
</td>
</tr>
</table>
<script language="JavaScript">
<!--
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > document.main_table.width)
target[i].width = document.main_table.width;
}
}
window.onload = resize_image;
//-->
</script>
.............................................................................................
댓글 전체
신경 써주셔셔 정말 감사합니다.
덕분에 도움 되었습니다.
그리고, 다운로드 문제는 새로 그누를 다운받아 통째로 덮어쓰기하여 해결되었습니다^^
좋은 날 되세요.
덕분에 도움 되었습니다.
그리고, 다운로드 문제는 새로 그누를 다운받아 통째로 덮어쓰기하여 해결되었습니다^^
좋은 날 되세요.
첫번째 다운로드 문제는 자세히 모르겟구요...다운로드에서 다운로드 파일을 받지 못햇다고 하는데...
두번째 이미지크기는 그누폴더의 config.php파일에서 설정할수 이씁니다.
파일을 열어보면
$cfg[large_image_size] = 500;
행에서 이미지 너비를 500으로 정해줍니다.
그러면 모든 게시판에 이미지 너비는 모두 500이상으로 넘어가지 못합니다.
좋은 밤 되세요...
두번째 이미지크기는 그누폴더의 config.php파일에서 설정할수 이씁니다.
파일을 열어보면
$cfg[large_image_size] = 500;
행에서 이미지 너비를 500으로 정해줍니다.
그러면 모든 게시판에 이미지 너비는 모두 500이상으로 넘어가지 못합니다.
좋은 밤 되세요...