여러게시물 최신글 질문입니다.

여러게시물 최신글 질문입니다.

QA

여러게시물 최신글 질문입니다.

본문

latest.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'];
            $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'];
        }
 
    ob_start();
    include $latest_skin_path.'/latest.skin.php';
    $content = ob_get_contents();
    ob_end_clean();
 
    return $content;
}


index.php


           <div><h1>새글</h1></div>
          <div class="main_new"> 
            <?php 
              echo latest_all("basic","Notice,Notice",5,50);
?>
          </div>  


PMA

917f8c627156b1e92a6f3e8c56692932_1500637097_86.png
 

g5_board 에 있는 데이터 하나를 빼서 g5_board_new에 넣었는데

계속 게시물이 없다고 뜹니다.

g5_board에 있는 게시물 중 최신글 몇개가 나와야 하는거 아닌가요 ?

이 질문에 댓글 쓰기 :

답변 1

마지막 pma 스샷 전체를 보여 주세요.

bo_table 칼럼 옆에 더 있습니다.

그걸 다 보여 주셔야 할 것 같네요.

g5_board_new 테이블은
bn_id
bo_table
wr_id
wr_parent
bn_datetime
mb_id
칼럼이 이게 전부 아닌가요?
지금 보내신 건 g5_board 테이블 같네요.
최근 게시물에서 사용하는 테이블은 g5_board_new 테이블입니다.

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

회원로그인

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