불특정 첨부파일이 안나옵니다. 정보
불특정 첨부파일이 안나옵니다.본문
현재 배추 스킨을 쓰고있구요
첨부 파일 부분만 다른스킨꺼를 따다가, 좀 수정 해서,첨부 이미지 형태로 인크루드 시켰습니다.
이상 없는줄 알았는데.
특정 첨부 파일이 안나옵니다. ㅠㅠ
첨부 파일이 안나오는 것이 어떤떄에 안나오는것인지 감도 못잡겠습니다.ㅠㅠ
zip 파일을 첨부해서 안나오길래 다른 회원 업로드 한것 봤더니,
어떤 회원는 나오고, 어떤회원은 안나오고,
코드 한번만 봐주세요....
도움좀 꼭 부탁드립니다.. 꾸벅....
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
<!--
.v_padding1 { PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; }
.v_padding2 { PADDING-LEFT: 5px; PADDING-right: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; }
.v_padding3 { PADDING-LEFT: 0px; PADDING-right: 0px; PADDING-BOTTOM: 7px; PADDING-TOP: 10px; }
.v_padding4 { PADDING-LEFT: 5px; PADDING-right: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; }
.v_padding5 { PADDING-LEFT: 10px; PADDING-right: 20px; PADDING-BOTTOM: 7px; PADDING-TOP: 10px; }
.v_padding6 { PADDING-LEFT: 20px; PADDING-right: 20px; PADDING-BOTTOM: 20px; PADDING-TOP: 20px; }
.v_text1 { BORDER-RIGHT: #D3D3D3 1px solid; BORDER-TOP: #D3D3D3 1px solid; BORDER-LEFT: #D3D3D3 1px solid; BORDER-BOTTOM: #D3D3D3 1px solid; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff; }
.v_text2 { font-size:9pt; color:#5E5E5E;}
.v_content { COLOR:#2C8CB9; }
.skin_cmt { color:gray; font-size:8pt; text-decoration: none; }
.skin_tt { color:gray; font-size:8pt; font-weight: bold; }
.skin_tp { font-size:8pt; font-weight: bold; color:#259BAD;}
.skin_date { color:#259BAD; font-size:8pt; font-weight: bold;}
.skin_input { height:20px; border: 1px solid #E0E0E0; color=#A0A0A0; }
.w_list0 { font-family:돋움; font-size:8pt; color:#259BAD; font-weight: bold;}
.w_list1 { font-family:돋움; font-size:8pt; color:gray; }
-->
</style>
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0">
<tr>
<td >
<!-- 링크 버튼 -->
<?
$img = "$g4[path]/data/file/$bo_table/".urlencode($view[file][0][file]);
if (!file_exists($img) || !$view[file][0][file]) $img = "$board_skin_path/img_pds/no_image.gif";
?>
<table width="100%" border="0" bgcolor="E7E7E7" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
<tr>
<td width="10" rowspan="2"> </td>
<td width="15" rowspan="2"> </td>
<td width="100%" rowspan="2" valign=top>
<table width=100% border=0 cellspacing="0" cellpadding="0">
<tr>
<td width=50%><font class=w_list0>글 쓴 이</font><strong><font color=#259BAD> : </font></strong>
<span class=mw_basic_view_name><?=$view[name]?></span><span class=skin_cmt><? if ($is_ip_view) { echo " ($ip)"; } ?></span>
<? if ($is_admin) { ?>
<img src="<?=$board_skin_path?>/img/btn_ip.gif" align=absmiddle title='IP조회' style="cursor:pointer" onclick="btn_ip('<?=$view[wr_ip]?>')">
<img src="<?=$board_skin_path?>/img/btn_ip_search.gif" align=absmiddle title='IP검색' style="cursor:pointer" onclick="btn_ip_search('<?=$view[wr_ip]?>')">
<? } ?>
</td>
<td><font class="w_list0">등 록 일</font><strong><font color="#259BAD"> : </font></strong><span class="skin_cmt"><span class="mw_basic_view_datetime">
<?=substr($view[wr_datetime],0,10)." (".get_yoil($view[wr_datetime]).") ".substr($view[wr_datetime],11,5)?>
</span>
<? if ($singo_href) { ?><a href="<?=$singo_href?>"><img src="<?=$board_skin_path?>/img/btn_singo2.gif" align=absmiddle title='신고'></a><?}?>
<? if ($print_href) { ?><a href="<?=$print_href?>"><img src="<?=$board_skin_path?>/img/btn_print.gif" align=absmiddle title='인쇄'></a><?}?>
</span></td>
</tr>
<tr>
<td><font class="w_list0">조 회 수</font><strong><font color="#259BAD"> : </font></strong><span class="skin_cmt">
<?=$view[wr_hit]?>
</span></td>
<td><!-- 다운로드수및 조회수로 자료평가시 주석처리-->
<font class="w_list0">추 천 수</font><strong><font color="#259BAD"> :</font></strong><span class="skin_cmt">
<?=$view[wr_good]?>
</span></td>
</tr>
<? if ($trackback_url) { ?>
<tr h>
<td height="7"></td>
</tr>
<script language="JavaScript">
function clipboard_trackback(str) {
if (g4_is_gecko)
prompt("이 글의 고유주소입니다. Ctrl+C를 눌러 복사하세요.", str);
else if (g4_is_ie) {
window.clipboardData.setData("Text", str);
alert("트랙백 주소가 복사되었습니다.\n\n<?=$trackback_url?>");
}
}
</script>
<? } ?>
<?
// 링크
$cnt = 0;
$i=1;
if ($view[link][$i]) {
$cnt++;
$link = cut_str($view[link][$i], 70);
echo <<<HEREDOC
<tr><td colspan=2 valign=top><table width=100% border=0 cellspacing="0" cellpadding="0"><tr>
<td><span class=skin_date>홈페이지 : </span>
<img src='$board_skin_path/img/icon_link.gif' align='absmiddle'> <a href="{$view[link_href][$i]}" target="_blank"><span class=skin_cmt>{$link} ({$view[link_hit][$i]})</span></a></td></tr></table></td>
</tr>
<tr>
<td colspan=2 height="1" bgcolor='E7E7E7'></td>
</tr>
HEREDOC;
}
// 가변 파일
echo <<<HEREDOC
<tr><td colspan=2 height=20 valign=bottom><font color=FF6600><strong>첨부파일</strong></font></td></tr>
<tr><td colspan=2 height=20 bgcolor='FFFFFF'>
<table width=100% border=0 cellspacing="0" cellpadding="0"><tr>
<td width=50 align=center><span class=skin_tp>NO</span></td><td width=300 align=left><span class=skin_tp>FILE</span></td><td width=50 align=center><span class=skin_tp>SIZE</span</td><td width=50 align=center><span class=skin_tp>DOWN</span</td></tr></table></td></tr>
<tr>
<td colspan=2 height="1" bgcolor='E7E7E7'></td>
</tr>
HEREDOC;
$cnt = 0;
for ($i=1; $i<(count($view[file])-1); $i++) {
include "$board_skin_path/ext.php";
$filetype = $file_type[1];
// if ($view[file][$i][source] && !$view[file][$i][view]) {
$cnt++;
echo <<<HEREDOC
<tr><td colspan=2 bgcolor='FFFFFF' valign=top><table width=100% border=0 cellspacing="0" cellpadding="0"><tr>
<td height=18 width=50 align=center><span class=skin_tt>{$cnt}</span></td>
<td width=300 align=left>{$filetype}
<a href='{$view[file][$i][href]}' title='{$view[file][$i][content]}'>{$view[file][$i][source]}</a></td>
<td width=50 align=center><span class=skin_cmt>{$view[file][$i][size]}</span></td>
<td width=50 align=center><span class=skin_cmt>{$view[file][$i][download]}</span></td>
</tr></table></td>
</tr>
<tr>
<td colspan=2 height="1" bgcolor='E7E7E7'></td>
</tr>
HEREDOC;
//}
}
if ($cnt == 0) { echo <<<HEREDOC
<tr><td colspan=2 bgcolor='FFFFFF'><table width=100% border=0 cellspacing="0" cellpadding="0">
<tr><td colspan=4 height=45 align=center> 첨부된 파일이 없습니다.</td></tr></table></td></tr>
HEREDOC;
}
?>
</table>
</td>
<td width="10" rowspan="2"></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td colspan="5" height=10></td>
</tr>
</table>
<tr>
<td colspan="5" height=10></td>
</tr>
</td></tr></table>
첨부 파일 부분만 다른스킨꺼를 따다가, 좀 수정 해서,첨부 이미지 형태로 인크루드 시켰습니다.
이상 없는줄 알았는데.
특정 첨부 파일이 안나옵니다. ㅠㅠ
첨부 파일이 안나오는 것이 어떤떄에 안나오는것인지 감도 못잡겠습니다.ㅠㅠ
zip 파일을 첨부해서 안나오길래 다른 회원 업로드 한것 봤더니,
어떤 회원는 나오고, 어떤회원은 안나오고,
코드 한번만 봐주세요....
도움좀 꼭 부탁드립니다.. 꾸벅....
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
<!--
.v_padding1 { PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; }
.v_padding2 { PADDING-LEFT: 5px; PADDING-right: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; }
.v_padding3 { PADDING-LEFT: 0px; PADDING-right: 0px; PADDING-BOTTOM: 7px; PADDING-TOP: 10px; }
.v_padding4 { PADDING-LEFT: 5px; PADDING-right: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; }
.v_padding5 { PADDING-LEFT: 10px; PADDING-right: 20px; PADDING-BOTTOM: 7px; PADDING-TOP: 10px; }
.v_padding6 { PADDING-LEFT: 20px; PADDING-right: 20px; PADDING-BOTTOM: 20px; PADDING-TOP: 20px; }
.v_text1 { BORDER-RIGHT: #D3D3D3 1px solid; BORDER-TOP: #D3D3D3 1px solid; BORDER-LEFT: #D3D3D3 1px solid; BORDER-BOTTOM: #D3D3D3 1px solid; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff; }
.v_text2 { font-size:9pt; color:#5E5E5E;}
.v_content { COLOR:#2C8CB9; }
.skin_cmt { color:gray; font-size:8pt; text-decoration: none; }
.skin_tt { color:gray; font-size:8pt; font-weight: bold; }
.skin_tp { font-size:8pt; font-weight: bold; color:#259BAD;}
.skin_date { color:#259BAD; font-size:8pt; font-weight: bold;}
.skin_input { height:20px; border: 1px solid #E0E0E0; color=#A0A0A0; }
.w_list0 { font-family:돋움; font-size:8pt; color:#259BAD; font-weight: bold;}
.w_list1 { font-family:돋움; font-size:8pt; color:gray; }
-->
</style>
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0">
<tr>
<td >
<!-- 링크 버튼 -->
<?
$img = "$g4[path]/data/file/$bo_table/".urlencode($view[file][0][file]);
if (!file_exists($img) || !$view[file][0][file]) $img = "$board_skin_path/img_pds/no_image.gif";
?>
<table width="100%" border="0" bgcolor="E7E7E7" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
<tr>
<td width="10" rowspan="2"> </td>
<td width="15" rowspan="2"> </td>
<td width="100%" rowspan="2" valign=top>
<table width=100% border=0 cellspacing="0" cellpadding="0">
<tr>
<td width=50%><font class=w_list0>글 쓴 이</font><strong><font color=#259BAD> : </font></strong>
<span class=mw_basic_view_name><?=$view[name]?></span><span class=skin_cmt><? if ($is_ip_view) { echo " ($ip)"; } ?></span>
<? if ($is_admin) { ?>
<img src="<?=$board_skin_path?>/img/btn_ip.gif" align=absmiddle title='IP조회' style="cursor:pointer" onclick="btn_ip('<?=$view[wr_ip]?>')">
<img src="<?=$board_skin_path?>/img/btn_ip_search.gif" align=absmiddle title='IP검색' style="cursor:pointer" onclick="btn_ip_search('<?=$view[wr_ip]?>')">
<? } ?>
</td>
<td><font class="w_list0">등 록 일</font><strong><font color="#259BAD"> : </font></strong><span class="skin_cmt"><span class="mw_basic_view_datetime">
<?=substr($view[wr_datetime],0,10)." (".get_yoil($view[wr_datetime]).") ".substr($view[wr_datetime],11,5)?>
</span>
<? if ($singo_href) { ?><a href="<?=$singo_href?>"><img src="<?=$board_skin_path?>/img/btn_singo2.gif" align=absmiddle title='신고'></a><?}?>
<? if ($print_href) { ?><a href="<?=$print_href?>"><img src="<?=$board_skin_path?>/img/btn_print.gif" align=absmiddle title='인쇄'></a><?}?>
</span></td>
</tr>
<tr>
<td><font class="w_list0">조 회 수</font><strong><font color="#259BAD"> : </font></strong><span class="skin_cmt">
<?=$view[wr_hit]?>
</span></td>
<td><!-- 다운로드수및 조회수로 자료평가시 주석처리-->
<font class="w_list0">추 천 수</font><strong><font color="#259BAD"> :</font></strong><span class="skin_cmt">
<?=$view[wr_good]?>
</span></td>
</tr>
<? if ($trackback_url) { ?>
<tr h>
<td height="7"></td>
</tr>
<script language="JavaScript">
function clipboard_trackback(str) {
if (g4_is_gecko)
prompt("이 글의 고유주소입니다. Ctrl+C를 눌러 복사하세요.", str);
else if (g4_is_ie) {
window.clipboardData.setData("Text", str);
alert("트랙백 주소가 복사되었습니다.\n\n<?=$trackback_url?>");
}
}
</script>
<? } ?>
<?
// 링크
$cnt = 0;
$i=1;
if ($view[link][$i]) {
$cnt++;
$link = cut_str($view[link][$i], 70);
echo <<<HEREDOC
<tr><td colspan=2 valign=top><table width=100% border=0 cellspacing="0" cellpadding="0"><tr>
<td><span class=skin_date>홈페이지 : </span>
<img src='$board_skin_path/img/icon_link.gif' align='absmiddle'> <a href="{$view[link_href][$i]}" target="_blank"><span class=skin_cmt>{$link} ({$view[link_hit][$i]})</span></a></td></tr></table></td>
</tr>
<tr>
<td colspan=2 height="1" bgcolor='E7E7E7'></td>
</tr>
HEREDOC;
}
// 가변 파일
echo <<<HEREDOC
<tr><td colspan=2 height=20 valign=bottom><font color=FF6600><strong>첨부파일</strong></font></td></tr>
<tr><td colspan=2 height=20 bgcolor='FFFFFF'>
<table width=100% border=0 cellspacing="0" cellpadding="0"><tr>
<td width=50 align=center><span class=skin_tp>NO</span></td><td width=300 align=left><span class=skin_tp>FILE</span></td><td width=50 align=center><span class=skin_tp>SIZE</span</td><td width=50 align=center><span class=skin_tp>DOWN</span</td></tr></table></td></tr>
<tr>
<td colspan=2 height="1" bgcolor='E7E7E7'></td>
</tr>
HEREDOC;
$cnt = 0;
for ($i=1; $i<(count($view[file])-1); $i++) {
include "$board_skin_path/ext.php";
$filetype = $file_type[1];
// if ($view[file][$i][source] && !$view[file][$i][view]) {
$cnt++;
echo <<<HEREDOC
<tr><td colspan=2 bgcolor='FFFFFF' valign=top><table width=100% border=0 cellspacing="0" cellpadding="0"><tr>
<td height=18 width=50 align=center><span class=skin_tt>{$cnt}</span></td>
<td width=300 align=left>{$filetype}
<a href='{$view[file][$i][href]}' title='{$view[file][$i][content]}'>{$view[file][$i][source]}</a></td>
<td width=50 align=center><span class=skin_cmt>{$view[file][$i][size]}</span></td>
<td width=50 align=center><span class=skin_cmt>{$view[file][$i][download]}</span></td>
</tr></table></td>
</tr>
<tr>
<td colspan=2 height="1" bgcolor='E7E7E7'></td>
</tr>
HEREDOC;
//}
}
if ($cnt == 0) { echo <<<HEREDOC
<tr><td colspan=2 bgcolor='FFFFFF'><table width=100% border=0 cellspacing="0" cellpadding="0">
<tr><td colspan=4 height=45 align=center> 첨부된 파일이 없습니다.</td></tr></table></td></tr>
HEREDOC;
}
?>
</table>
</td>
<td width="10" rowspan="2"></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td colspan="5" height=10></td>
</tr>
</table>
<tr>
<td colspan="5" height=10></td>
</tr>
</td></tr></table>
댓글 전체
일단 눈에 띄는 이상한 부분..
for ($i=1; $i<(count($view[file])-1); $i++) {
include "$board_skin_path/ext.php";
에서
1. $i<count($view[file])-1 로 하면, 첨부화일의 마지막 것은 항상 보이지 않을것 같습니다.
$i<count($view[file]) 로 하시는 것이...
2. include "$board_skin_path/ext.php";
ext.php 화일이 무엇인지 모르겠지만, for 문 안에서 아래처럼 include 하면 for 문 횟수만큼 include 하게 됩니다. 때에 따라서 여러번 include 하면, 문법 오류가 발생할 수도 있습니다.
꼭 필요한 화일이라면, include_once를 하시는 것이..
for ($i=1; $i<(count($view[file])-1); $i++) {
include "$board_skin_path/ext.php";
에서
1. $i<count($view[file])-1 로 하면, 첨부화일의 마지막 것은 항상 보이지 않을것 같습니다.
$i<count($view[file]) 로 하시는 것이...
2. include "$board_skin_path/ext.php";
ext.php 화일이 무엇인지 모르겠지만, for 문 안에서 아래처럼 include 하면 for 문 횟수만큼 include 하게 됩니다. 때에 따라서 여러번 include 하면, 문법 오류가 발생할 수도 있습니다.
꼭 필요한 화일이라면, include_once를 하시는 것이..
우선 답변 감사드립니다.
말씀하신대로 해봤는데요.
1. -1 한것은 아마 코드 짜신 분이,
첨부파일 앞에 첨부파일 종류를 이미지로 보여주게 했는데요.
-1을 빼니, 첨부파일 종류 이미지가 마지막에 1개가 더 붙더라구요.
3개를 첨부하면 3개의 첨부파일 종류별로 이미지가 파일앞에 붙는데,
4번째 다른 이미지가 하나가 더 나오더라구요.
아마 이거때문에 -1로 하신것 같아요
-1 없애도 첨부파일 종류 이미지만 나오고 첨부파일은 안나오는것은 계속 안나옵니다.ㅜㅜ
그리고. 2번쨰꺼는 ext.php 파일이 첨부파일 종류를 이미지로 찾아내는거더라구요.
이거는 말씀하신대로 include_once "$board_skin_path/ext.php"; 로 바꿔줬습니다.
계속 안되는데. 어떻게 방법이 없으까요?
도움좀 부탁드립니다. 꾸벅. ㅜㅜ
말씀하신대로 해봤는데요.
1. -1 한것은 아마 코드 짜신 분이,
첨부파일 앞에 첨부파일 종류를 이미지로 보여주게 했는데요.
-1을 빼니, 첨부파일 종류 이미지가 마지막에 1개가 더 붙더라구요.
3개를 첨부하면 3개의 첨부파일 종류별로 이미지가 파일앞에 붙는데,
4번째 다른 이미지가 하나가 더 나오더라구요.
아마 이거때문에 -1로 하신것 같아요
-1 없애도 첨부파일 종류 이미지만 나오고 첨부파일은 안나오는것은 계속 안나옵니다.ㅜㅜ
그리고. 2번쨰꺼는 ext.php 파일이 첨부파일 종류를 이미지로 찾아내는거더라구요.
이거는 말씀하신대로 include_once "$board_skin_path/ext.php"; 로 바꿔줬습니다.
계속 안되는데. 어떻게 방법이 없으까요?
도움좀 부탁드립니다. 꾸벅. ㅜㅜ
네 ^^
한가지 더 발견한 것은, $i가 1부터 시작하는 점이네요.
for ($i=1; $i<(count($view[file])-1); $i++) {
제가 시험해 본 봐, $i=0 부터 count()-1 까지 loop를 돌려야 할것 같습니다.
(네, 하나가 더 들어 있네요..^^;)
혹시 그래도 안되시면, 제가 이 글을 기억하고 다시 들어올것 같지 않으니, 쪽지주세요.
한가지 더 발견한 것은, $i가 1부터 시작하는 점이네요.
for ($i=1; $i<(count($view[file])-1); $i++) {
제가 시험해 본 봐, $i=0 부터 count()-1 까지 loop를 돌려야 할것 같습니다.
(네, 하나가 더 들어 있네요..^^;)
혹시 그래도 안되시면, 제가 이 글을 기억하고 다시 들어올것 같지 않으니, 쪽지주세요.
전진님 정말 감사합니다.
말씀하신데로 , $i=0 으로 바꾸니 잘 됩니다..
다시한번 감사드립니다..
좋은하루 되세요^^
말씀하신데로 , $i=0 으로 바꾸니 잘 됩니다..
다시한번 감사드립니다..
좋은하루 되세요^^