여러게시물 최신글 질문입니다. 채택완료
꼬마새벽
8년 전
조회 3,411
latest.php
</p><p>// $bo_tables 테이블들 사이 콤마(,) 단위로 구분해서 넣을 것, 콤마 사이에 공백 없이 (ex aaa,bbb,)</p><p>function latest_all($skin_dir='', $bo_tables, $rows=10, $subject_len=40, $cache_time=1, $options='')</p><p>{</p><p> </p><p> global $g5;</p><p> </p><p> if (!$skin_dir) $skin_dir = 'basic';</p><p> </p><p> if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {</p><p> if (G5_IS_MOBILE) {</p><p> $latest_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];</p><p> if(!is_dir($latest_skin_path))</p><p> $latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];</p><p> $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);</p><p> } else {</p><p> $latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];</p><p> $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);</p><p> }</p><p> $skin_dir = $match[1];</p><p> } else {</p><p> if(G5_IS_MOBILE) {</p><p> $latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;</p><p> $latest_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;</p><p> } else {</p><p> $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;</p><p> $latest_skin_url = G5_SKIN_URL.'/latest/'.$skin_dir;</p><p> }</p><p> }</p><p> </p><p> $list = array();</p><p> $sql_common = " from {$g5['board_new_table']} a where find_in_set(a.bo_table, '{$bo_tables}')";</p><p> $sql_common .= " and a.wr_id = a.wr_parent ";</p><p> $sql_order = " order by a.bn_id desc ";</p><p> $sql = " select a.* {$sql_common} {$sql_order} limit 0, {$rows}";</p><p> </p><p> $result = sql_query($sql);</p><p> </p><p> for ($i=0; $row=sql_fetch_array($result); $i++) {</p><p> </p><p> $sql = " select * from {$g5['board_table']} where bo_table = '{$row['bo_table']}' ";</p><p> $board = sql_fetch($sql);</p><p> </p><p> $tmp_write_table = $g5['write_prefix'] . $row['bo_table'];</p><p> $row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");</p><p> </p><p> $list[$i] = $row2;</p><p> $list[$i] = get_list($row2, $board, $latest_skin_url, $subject_len);</p><p> $list[$i]['bo_subject'] = $row['bo_subject'];</p><p> $list[$i]['bo_table'] = $row['bo_table'];</p><p> }</p><p> </p><p> ob_start();</p><p> include $latest_skin_path.'/latest.skin.php';</p><p> $content = ob_get_contents();</p><p> ob_end_clean();</p><p> </p><p> return $content;</p><p>}</p><p>
index.php
</p><p> <div><h1>새글</h1></div></p><p> <div class="main_new"> </p><p> <?php </p><p> echo latest_all("basic","Notice,Notice",5,50);</p><p style="margin-left: 80px;">?></p><p> </div> </p><p>
PMA

g5_board 에 있는 데이터 하나를 빼서 g5_board_new에 넣었는데
계속 게시물이 없다고 뜹니다.
g5_board에 있는 게시물 중 최신글 몇개가 나와야 하는거 아닌가요 ?
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
답변에 대한 댓글 2개
�
꼬마새벽
8년 전
메일로 보내드리겠습니다.
�
왕계란
8년 전
g5_board_new 테이블은
bn_id
bo_table
wr_id
wr_parent
bn_datetime
mb_id
칼럼이 이게 전부 아닌가요?
지금 보내신 건 g5_board 테이블 같네요.
최근 게시물에서 사용하는 테이블은 g5_board_new 테이블입니다.
bn_id
bo_table
wr_id
wr_parent
bn_datetime
mb_id
칼럼이 이게 전부 아닌가요?
지금 보내신 건 g5_board 테이블 같네요.
최근 게시물에서 사용하는 테이블은 g5_board_new 테이블입니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인