섬네일 로딩이 느립니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

섬네일 로딩이 느립니다. 정보

섬네일 로딩이 느립니다.

본문

오류 주소 : http://babytime.co.kr/

게시판 섬네일 설정에서 사이즈를 맞추기는 하였으나
원본 파일을 섬네일로 변경시 문제가 되는거 같은데 어떻게 손봐야 할지 도움좀 부탁드립니다.

    <!-- 제목 -->
    <form name="fboardlist" method="post">
    <input type='hidden' name='bo_table' value='<?=$bo_table?>'>
    <input type='hidden' name='sfl'  value='<?=$sfl?>'>
    <input type='hidden' name='stx'  value='<?=$stx?>'>
    <input type='hidden' name='spt'  value='<?=$spt?>'>
    <input type='hidden' name='page' value='<?=$page?>'>
    <input type='hidden' name='sw'  value=''>

    <table cellspacing="0" cellpadding="0" class="board_list">
    <col width="45" />
    <? if ($is_checkbox) { ?><col width="40" /><? } ?>
    <col />
    <col width="140" />
    <col width="55" />
    <col width="50" />
    <? if ($is_good) { ?><col width="40" /><? } ?>
    <? if ($is_nogood) { ?><col width="40" /><? } ?>


    <tr>
        <th></th>
        <th></th>
        <th></th>
        <th></th>
        <th></th>
    </tr>
<tr><td height="10px"></td></tr>

</table>

<table width=920 cellpadding=0 cellspacing=0>
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
if ($i && $i%$mod==0)
echo "</tr><tr>";


//썸네일 생성
$thumb = $thumb_path.'/'.$list[$i]['wr_id'];
if($list[$i]['file']['0']['file']){
$file = $list[$i]['file']['0']['path'] .'/'. $list[$i]['file']['0']['file'];
$save_filename=$list[$i]['file']['0']['file'].".thm";
$save_path = $thumb_path ."/";
$thumfile="<img src='". $save_path .'/'. $save_filename ."' border = '0'>";
if(!file_exists($thumfile)){
thumnail($file, $save_filename, $save_path, $board['bo_1'], $board['bo_2']);
}
}else{
$thumfile="<div style=\"width:{$board[bo_1]}px; border:1px solid #999999; height:{$board[bo_2]}px; text-align:center; vertical-align:middle\"><br /><br />No Image</div>";
}


$style = "";
if ($list[$i][icon_new])
$style = " style='font-weight:bold;' ";
$subject = "<span $style>".cut_str($list[$i][subject],20)."</span>";

$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";

echo "<td width='{$td_width}%' valign=bottom style='word-break:break-all;'>";
echo "<table width=100%>";
echo "<tr><td height=5></td></tr>";
echo "<tr><td align=center><a href='{$list[$i][href]}'>$thumfile</a></td></tr>";
echo "<tr><td align=center><a href='{$list[$i][href]}'>$subject</a>{$comment_cnt}</td></tr>";
if ($is_category) echo "<tr><td align=center><a href='{$list[$i][ca_name_href]}'><font color=#cccccc>[{$list[$i][ca_name]}]</font></a></td></tr>";
if ($is_checkbox) echo "<tr><td align=center><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'></td></tr>";
echo "<tr><td height=5></td></tr>";
echo "</table></td>\n";
}

// 나머지 td
$cnt = $i%$mod;
if ($cnt)
for ($i=$cnt; $i<$mod; $i++)
echo "<td width='{$td_width}%'>&nbsp;</td>";
?>
</tr>
    <tr><td height="20px"></td></tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#eeeeee></td></tr>
<? if (count($list) == 0) { echo "<tr><td colspan='$mod' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table>
</form>

댓글 전체

썸네일 생성하는 부분에서 조건이 잘못주어져있네요.

$thumb = $thumb_path.'/'.$list[$i]['wr_id'];
if($list[$i]['file']['0']['file']){
$file = $list[$i]['file']['0']['path'] .'/'. $list[$i]['file']['0']['file'];
$save_filename=$list[$i]['file']['0']['file'].".thm";
$save_path = $thumb_path ."/";

$thumfile="<img src='". $save_path .'/'. $save_filename ."' border = '0'>";
이부분을 아래와 같이 수정하세요.
$thumfile = $save_path.'/'.$save_filename;

if(!file_exists($thumfile)){
thumnail($file, $save_filename, $save_path, $board['bo_1'], $board['bo_2']);
위에서 수정하기 전 구문을 여기에 삽입합니다.
$thumfile="<img src='". $save_path .'/'. $save_filename ."' border = '0'>";
}
}else{
$thumfile="<div style=\"width:{$board[bo_1]}px; border:1px solid #999999; height:{$board[bo_2]}px; text-align:center; vertical-align:middle\"><br /><br />No Image</div>";
}

임시로 답변했는데 안되면 쪽지 보내주세요.

다른 문제로 쪽지 주셨던데 연락처 보내드렸으니 연락 주시면 이 문제에 대해서도
설명 드리겠습니다.
$thumfile = $save_path.'/'.$save_filename;

if(!file_exists($thumfile)){
$thumnail($file, $save_filename, $save_path, $board['bo_1'], $board['bo_2']);


$thumb = $thumb_path.'/'.$list[$i]['wr_id'];
if($list[$i]['file']['0']['file']){
$file = $list[$i]['file']['0']['path'] .'/'. $list[$i]['file']['0']['file'];
$save_filename=$list[$i]['file']['0']['file'].".thm";
$save_path = $thumb_path ."/";
$thumfile="<img src='". $save_path .'/'. $save_filename ."' border = '0'>";


$thumfile="<img src='". $save_path .'/'. $save_filename ."' border = '0'>";
}
}else{
$thumfile="<div style=\"width:{$board[bo_1]}px; border:1px solid #999999; height:{$board[bo_2]}px; text-align:center; vertical-align:middle\"><br /><br />No Image</div>";
}

에러는 없으나 썸네일이 출력되지 않습니다.ㅠㅠ
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT