갤러리 latest 수정 후 1개의 글만 출력됩니다.

갤러리 latest 수정 후 1개의 글만 출력됩니다.

QA

갤러리 latest 수정 후 1개의 글만 출력됩니다.

본문

기존 갤러리 최신글 에서 몇개의 항목과 디자인을 바꿔 출력하려고 했는데 wr_1 영역만 호출을 하면 1개의 글만 노출이 되네요. 닫기도 다 잘 한거같은데.. 문제가 되는 영역은 따로 코드에 표기해두었습니다. 그 부분을 지우고 새로고침하니 정상적으로 등록된 글이 다 나오는데 어떤 부분이 문제일까요?ㅜ

 


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
 
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$thumb_width = 210;
$thumb_height = 150;
$list_count = (is_array($list) && $list) ? count($list) : 0;
?>
 
<div class="pic_lt">
    <ul>
    <?php
    for ($i=0; $i<$list_count; $i++) {
        $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
   
        if($thumb['src']) {
            $img = $thumb['src'];
        } else {
            $img = G5_IMG_URL.'/no_img.png';
            $thumb['alt'] = '이미지가 없습니다.';
        }
        $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
        $wr_href = get_pretty_url($bo_table, $list[$i]['wr_id']);
    ?>
        <li class="gallery_li">
            <div class="img"><a href="<?php echo $list[$i]['wr_link1']; ?>" class="lt_img" target="_blank"><?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?></a></div>
           <div class="txt">
           <?php
            if ($list[$i]['icon_secret']) echo "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> ";
 
            echo "<a href=\"".$list[$i]['wr_link1']."\"> ";
            if ($list[$i]['is_notice'])
                echo "<strong>".$list[$i]['subject']."</strong>";
            else            
                echo "<p class='main_tit'>".$list[$i]['subject']."</p>";
                echo "<span class='sub_tit'>".$list[$i]['wr_2']."</span>";
                echo "<span class='content'>".$list[$i]['wr_content']."</span>";
            echo "</a>";
           
 
            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
 
            // echo $list[$i]['icon_reply']." ";
            // if ($list[$i]['icon_file']) echo " <i class=\"fa fa-download\" aria-hidden=\"true\"></i>" ;
            // if ($list[$i]['icon_link']) echo " <i class=\"fa fa-link\" aria-hidden=\"true\"></i>" ;

 
            ?>
 
<!-- 문제가 되는 영역 -->
             <?
 
if($list[$i]['wr_1']){
 
    $tags = explode(',',$list[$i]['wr_1']);
?>
    <div class="tagList view">
        <div class="tagListIpt">
            <ul>
                <?for($i=0; $i<count($tags); $i++){?>
                    <li class="tag"><span><?=$tags[$i]?></span></li>
                <?}?>
            </ul>
        </div>
    </div>
<?
}
?>
<!-- 문제가 되는 영역 끝 -->
           </div>
 
        </li>
    <?php }  ?>
    <?php if ($list_count == 0) { //게시물이 없을 때  ?>
    <li class="empty_li">게시물이 없습니다.</li>
    <?php }  ?>
    </ul>
 
</div>
 

이 질문에 댓글 쓰기 :

답변 1

$i 변수 중복선언되서그런듯?

문제부분 $i 를 $c 나 다른네이밍으로 변경해보셔요

답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색

회원로그인

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