3개의 게시판이 전부 출력이 되게 하려면 어떻게 해야하나요?

3개의 게시판이 전부 출력이 되게 하려면 어떻게 해야하나요?

QA

3개의 게시판이 전부 출력이 되게 하려면 어떻게 해야하나요?

본문

<< 최근게시물 스킨 일부 >>

<ul>
        <?php
        for($i=0; $i<count($list); $i++) {  ?>

            <li>
            <a href="<?php echo $list[$i]['href'];?>" title="<?=$list[$i]['subject']?>">
            <h3><?php echo "<span class='date'> ".$list[$i]['datetime']." </span> ";?></h3>

            <?php echo "<span class='name'> ".$list[$i]['name']." </span> ";?>
            <?php echo "<span class='label'> 인터넷접수 </span> ";?>


            <?php echo "<span class='label_part'> ".mb_strimwidth($bo_subject,0,9,'')." </span> ";?>

            </a>
            </li>
         <?php 
    } 
    if (count($list) == 0) { //게시물이 없을 때  ?>
    <li class="empty_li"><i class="fa fa-exclamation-triangle"></i> 게시물이 없습니다.</li>
    <?php }  ?>   
        </ul>

 

 

<< bbs/latest.lib.php 아래의 소스를 붙였어요 >>

 

bbs/latest.lib.php 에 아래의 소스 사용중입니다.

// 여러게시판에서 가져오기 시작 
// $bo_tables 테이블들 사이 콤마(,) 단위로 구분해서 넣을 것, 콤마 사이에 공백 없이 (ex aaa,bbb,)
function latest_all($skin_dir='', $bo_tables, $rows=10, $subject_len=40, $cache_time=1, $options='')
{

    global $g5;

    if (!$skin_dir) $skin_dir = 'basic';

    if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
        if (G5_IS_MOBILE) {
            $latest_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
            if(!is_dir($latest_skin_path))
                $latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
            $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
        } else {
            $latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
            $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
        }
        $skin_dir = $match[1];
    } else {
        if(G5_IS_MOBILE) {
            $latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
            $latest_skin_url  = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
        } else {
            $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;
            $latest_skin_url  = G5_SKIN_URL.'/latest/'.$skin_dir;
        }
    }

        $list = array();
        $sql_common = " from {$g5['board_new_table']} a  where find_in_set(a.bo_table, '{$bo_tables}')";
        $sql_common .= " and a.wr_id = a.wr_parent ";
        $sql_order = " order by a.bn_id desc ";
        $sql = " select a.* {$sql_common} {$sql_order} limit 0, {$rows}";

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

            $sql = " select * from {$g5['board_table']} where bo_table = '{$row['bo_table']}' ";

          

            $board = sql_fetch($sql);

            $tmp_write_table = $g5['write_prefix'] . $row['bo_table'];


        $bo_subject = get_text($board['bo_subject']);   ==> 추가했습니다. 
 
            $row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");

            $list[$i] = $row2;
            $list[$i] = get_list($row2, $board, $latest_skin_url, $subject_len);
            $list[$i]['bo_subject'] = $row['bo_subject'];
            $list[$i]['bo_table'] = $row['bo_table'];
        }

 

shuffle($list); ==> 추가했습니다. 

    ob_start();
    include $latest_skin_path.'/latest.skin.php';
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}

// 여러게시판에서 가져오기 끝 

 

 

<< 메인 페이지에서 출력 >>

출력 ::

<?php echo latest_all("theme/color_main_slider2_noimg", "f01,o01,of01", 10, 20); ?>

=> 3개의 게시판의 bo_subject 가 출력이 되게 하고 싶은데 

    마지막 게시판 of01 이 게시판 bo_subject 만 출력이 됩니다.

     보드(  $list[$i]['bo_subject'] ) 의 이름이 출력이 되게 하려고요. 

 

3개의 게시판이 전부 출력이 되게 하려면 어떻게 해야하나요?

감사합니다. 

 

 

이 질문에 댓글 쓰기 :

답변 2

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

회원로그인

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