채택완료

홈페이지 메인화면에 최근게시판이 무한으로 출력되는거를 수정하고싶습니다.

2023-02-15 (수) 12:41:38 2,268
Copy
<?php

define('_INDEX_', true);

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

 

if (G5_IS_MOBILE) {

    include_once(G5_THEME_MOBILE_PATH.'/index.php');

    return;

}

 

include_once(G5_THEME_PATH.'/head.php');

?>

 

<h2 class="sound_only"><?php echo _t('최신글'); ?></h2>

 

<div class="latest_wr">

<!-- 최신글 시작 { -->

 

    <?php

    //  최신글

    $sql = " select bo_table

                from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)

                where a.bo_device <> 'mobile' ";

    if(!$is_admin)

        $sql .= " and a.bo_use_cert = '' ";

    $sql .= " and a.bo_table not in ('notice', 'gallery') ";     //공지사항과 갤러리 게시판은 제외

    $sql .= " and (bo_10 = '' or bo_10 = '{$g5['tmpl']}') ";

    $sql .= " order by b.gr_order, a.bo_order ";

    $result = sql_query($sql);

    for ($i=0; $row=sql_fetch_array($result); $i++) {

        if ($i%2==1) $lt_style = "margin-left:2%";

        else $lt_style = "";

    ?>

    <div style="float:left;<?php echo $lt_style ?>" class="lt_wr">

        <?php

        // 이 함수가 바로 최신글을 추출하는 역할을 합니다.

        // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);

        // 테마의 스킨을 사용하려면 theme/basic 과 같이 지정

        echo latest('theme_basic_new', $row['bo_table'], 6, 24);

        ?>

    </div>

    <?php

    }

    ?>

    <!-- } 최신글 끝 -->

 

</div>

 

<div class="latest_wr">

    <!--  사진 최신글2 { -->

    <?php

    // 이 함수가 바로 최신글을 추출하는 역할을 합니다.

    // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);

    // 테마의 스킨을 사용하려면 theme/basic 과 같이 지정

    echo latest('pic_basic', 'gallery', 5, 23);

    ?>

    <!-- } 사진 최신글2 끝 -->

</div>

 

<?php

include_once(G5_THEME_PATH.'/tail.php');

?>

현재 굿빌더 사용중입니다. 헌데, 홈페이지 (제일 첫화면 index.php)에 게시판들이 무한으로 출력되는데, 혹시 특정게시판만 출력되게할수있나요? 예) buysell 보드 

부탁드립니다 ㅠㅠ

|

답변 1개

채택된 답변
+20 포인트
2023-02-15 (수) 12:59:59
 where a.bo_device <> 'mobile' "; 부분을
 where a.bo_device <> 'mobile' and a.bo_table in ('buysell') "; 로 변경해보세요.

답변을 작성하려면 로그인이 필요합니다.