게시판 리스트페이지에서 삭제된 자료부분이 공백으로 처리될때

ㅁㅁㅁㅁ
ㅁㅁㅁㅁ
ㅁㅁㅁㅁ
ㅁㅁㅁㅁ
 
이런식으로 사진이 뜨는데
중간에 지운 자리는
ㅁㅁㅁ
ㅁㅁㅁㅁ
ㅁㅁㅁㅁ
ㅁㅁㅁ
ㅁㅁㅁㅁ
 
저런식으로 비워서 내려가는데요;
 
이 문제좀 해결해주세요!
 
 
소스 리스트 페이지 소스
list.php
 
for ($i=0; $i<count($list); $i++)
{
 
  if ($i && $i%$mod==0) // 이곳이 끊어주는 부분

        echo "</tr><tr>";
  
 
    $img = "<img src='$board_skin_path/img/noimage.gif' style='border:#F0F0F0 1px double;border-width:5px;margin:0px 2px 0px 2px;' border=0 width='$img_width' height='$img_height' title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
 
 if (!file_exists($thumb)) // thumb 이미지 여부
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = @getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;
 
            $rate = $img_width / $size[0];
            $height = (int)($size[1] * $rate);
 
 
            if ($height < $img_height)
                $dst = imagecreatetruecolor($img_width, $height);
            else
                $dst = imagecreatetruecolor($img_width, $img_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
   //imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
   imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }
    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0 style='border:#F0F0F0 1px double;border-width:5px;margin:0px 2px 0px 2px;'>";
 
    $style = "";
    if ($list[$i][icon_new])
        $style = " style='font-weight:bold;letter-spacing:-1' ";
    $subject = "<span $style>". $list[$i][subject] ."</span>";
    $age=2008-substr($list[$i][wr_1],0,4)
;
 echo "<td width='{$td_width}%' valign=bottom style='word-break:break-all;'>";
    echo "<table width=100% style='border-bottom:1px solid #F0F0F0;'>";
    echo "<tr><td height=5></td></tr>"; 
 
 
    echo "<tr><td align=center><a href='{$list[$i][href]}'>$img</a></td></tr>";
    echo "<tr><td height='12' style='padding-left:33px; padding-top:3px;' class='data'><a href='{$list[$i][href]}'><font color=#545454>{$subject}</font></a>&nbsp;".$list[$i][icon_new]."&nbsp;".$list[$i][icon_hot]."<br/></td></tr>";
 echo "<tr><td height='12' style='padding-left:33px; padding-top:3px;' class='data'>나이 : {$age} 세";
 echo "<tr><td height='12' style='padding-left:33px; padding-top:3px;' class='data'>신장 : {$list[$i][wr_10]} cm";
 echo "<tr><td height='12' style='padding-left:33px; padding-top:3px;' class='data'>체중 : {$list[$i][wr_4]} kg";
  echo "{$list[$i][wr_id]}";
     echo "///$i";
 if ($is_checkbox) echo "<tr><td align=center><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'></td></tr>";
    echo "</table></td>\n";
 
 

 
 
 
}
|

댓글 1개

게시글이 아닌 게시글 안에 있는 이미지 삭제를 말씀하시는건가요...?
만약 그런거라면 스킨 작업이 아닌 내부 쿼리 작업을 해야 합니다.
리스트 정보를 가져온 후 그 안에 있는 Key를 가지고 File Table에서 데이터를 뽑아오는 방식을
List Table 과 File Table를 조인해서 가져와야 하기 때문에 대대적인 작업이 들어갈겁니다.
쿼리 작업이 가능하시다며 두 테이블을 Left Join 으로 처리하시면 될 듯 합니다.

댓글 작성

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

로그인하기
🐛 버그신고