갤러리 게시판 리스트 깨지는 문제 > 그누4 질문답변

그누4 질문답변

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

갤러리 게시판 리스트 깨지는 문제 정보

갤러리 게시판 리스트 깨지는 문제

첨부파일

list.skin.php (17.7K) 0회 다운로드 2012-12-28 19:02:50

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://bobhair.co.kr/bbs/board.php?bo_table=event

event게시판 입니다.
게시판 설정은 한줄에 3개씩 9개가 한페이지로 설정했습니다.

총 겟시물이 9개가 되면 위처럼 틀어지네요.
10,11개 게시물은 3개씩 정상적으로 보입니다. 그러다가 12번째 게시물을 올려면 또 틀어짐
그다음 부터 계속 올려봤는데 이상은 없는 것 같습니다.
3번째 다음줄로 돌려야 하는데 그 부분이 이상이 있는 것 같습니다.
하루종일 허덕이는데 짧은 식견으로 알수가 없네요...

해당 게시판의 list 소소는 의심이 가는 부분만 발췌해서 아래와 같습니다.
전체 소스는 첨부해 놓을께요.

------------------------------------

<div class="highslide-gallery">

<?
$mod = $board[bo_gallery_cols];
$td_width = (int)(100 / $mod);
?>

<table cellspacing="0" cellpadding="0" class="board_list" border="1" bordercolor=red>
<tr>
<?
for ($i=0; $i<count($list); $i++) {
$bg = $i%2 ? 0 : 1;
?>

<?
for($j=0; $j<$list[$i][file]["count"]; $j++){
if ($i && $i%$mod==0)
echo "</tr><tr>";

$img = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($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
break;

$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]);
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' width='$img_width' height='$img_height' style='border:3px solid #eee;' alt='하이슬라이드' title='클릭하세요' />";
}

if($list[$i][file][$j][image_type] >= 1 && $list[$i][file][$j][image_type] <= 3) {
$list[$i][thumbnail][path] = $list[$i][file][$j][path];
$list[$i][thumbnail][name] = $list[$i][file][$j][file];
$list[$i][thumbnail][content] = $list[$i][file][$j][bf_content];
$list[$i][thumbnail][href] = $list[$i][thumbnail][path]."/".$list[$i][thumbnail][name];
$list[$i][thumbnail][src] = $list[$i][thumbnail][path]."/thumbnail/".$list[$i][thumbnail][name];
if(!is_file($list[$i][thumbnail][src])){
$list[$i][thumbnail][src] = $list[$i][thumbnail][path]."/".$list[$i][thumbnail][name];
// 이미지 비률 수정및 이미지 포멧방식 체크
list($r_width[$i]) = getimagesize($list[$i][thumbnail][src]);
}
break;
}
}
?>

<td align="center" class="image" valign="top">
<table border="0" cellpadding="5" cellspacing="1">
<tr>
<td align="center"><!--a href="<?=$list[$i][thumbnail][href]?>" class="highslide" onclick="return hs.expand(this)"--><a href="<?=$list[$i][href]?>"><?=$img?></a></td>
</tr>
<tr>
<td align="center" class="subject" valign="top">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? } ?>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
/*카테고리 비노출*/
if ($is_category && $list[$i][ca_name]) {
echo "<font color=gray>[<span style='font-family:dotum;font-size:11px;letter-spacing:-1;'><a href='{$list[$i][ca_name_href]}'>{$list[$i][ca_name]}</span></a>]</font><br>";
}
/**/

// 제목 옵션 추가 부분           
$subject = "<span style='font-family:arial;color:A301E7;font-size:12px;letter-spacing:-1pt;'><b>{$list[$i][subject]}</span></b><!--br><font color=gray>디자이너:</font>--> {$list[$i][wr_1]}";
$comment_cnt = "<span style='font-family:dotum;color:#AAA;font-size:10px;'>{$list[$i][comment_cnt]}</span>";
// 여기까지 제목 옵션 추가 부분

if ($list[$i][is_notice]) {
echo "<a href='{$list[$i][href]}'><span class='notice' style='letter-spacing:-1pt;'>$subject</span></a>";
}

else {
echo "<a href='{$list[$i][href]}'>$subject</a> <a href='{$list[$i][comment_href]}'><?if ($list[$i][comment_cnt]) ";
echo "<span class='comment'>$comment_cnt</span></a>";
}

echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo $nobr_end;
?>
</td>
</tr>
<tr>
<td height="22"><font style='font-family:dotum;color:#cccccc;font-size:11px;letter-spacing:-1;'><?=$list[$i][name]?> <font color=silver>|</font> <span style='color:#555;font-size:8pt;font-family:arial;letter-spacing:1pt;'>Hit :</span> <span style='color:#555;font-size:8pt;font-family:arial;letter-spacing:0pt;'><?=$list[$i][wr_hit]?></span> <font color=silver>|</font> <font style="color:cccccc;font-family:arial;letter-spacing:0;font-size:8pt;font-family:arial;"><?=$list[$i][datetime]?></span></td>
</tr>
<tr><td height="10"></td></tr>
</table>
</td>
</tr>
</table>
</td>
<? } // end for ?>

</tr>
<? if (count($list) == 0) { echo "<tr><td colspan='$mod' height=300 align=center>검색된 게시물이 없습니다.</td></tr>"; } ?>
<tr><td height="5" colspan='<?=$mod?>'></td></tr>
</table>
</div>
</form>
<!-- 페이지 -->

댓글 전체

저도 여기에 메달리면서 이것저것 해보다가 검색 카테고리에서는 9번째 12번째 구분없이 다  잘 보이는데 전체리스트에서만 깨진다는 것 알았습니다. 근데 그걸 어디서, 어떻게 수정? 해야(만져야) 하는지 모르겠습니다. sca값 체크하는부분이 어딨는지 어떻게 하는지 좀더 자세히 알려주셨으면 좋겠습니다.
작성자에 의해 채택됐습니다.
<?
for ($i=0; $i<count($list); $i++) {
$bg = $i%2 ? 0 : 1;
?>

<?
for($j=0; $j<$list[$i][file]["count"]; $j++){
if ($i && $i%$mod==0)
echo "</tr><tr>";

여기서 if ($i && $i%$mod==0) 를 위쪽 for문쪽으로 옮겨보세요
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

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