latest함수에는 캐시 기능이 있어서 한 페이지에서 여러번 출력이 안되는 경우가 있습니다.
latest함수를 보면 캐시값을 만드는 변수는 아래와 같습니다.
if(G5_USE_CACHE) {
$cache_file_name = "latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}-".g5_cache_secret_key();
$caches = g5_get_cache($cache_file_name, (int) $time_unit * (int) $cache_time);
$cache_list = isset($caches['list']) ? $caches['list'] : array();
g5_latest_cache_data($bo_table, $cache_list);
}
이부분 : $cache_file_name = "latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}-".g5_cache_secret_key();
한 페이지에서 여러번 호출하고 싶다면 위 부분에 변수를 추가해야 합니다.
예를들어 : $cache_file_name = "latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}-{$separator}-".g5_cache_secret_key();
이를 위해 latest함수에도 매개변수를 포함합니다.
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=1, $options='',$separator='')
latest 호출시 마지막 매개변수에 각각 다른 인자를 넣어서 호출합니다.
latest(ㅇ,ㅇ,~~~~,'type1');
latest(ㅇ,ㅇ,~~~~,'type2');
--------------------
get_board_files_db 함수도 아래와 같이 추가합니다.
// 게시판 첨부파일 테이블에서 n행을 읽음
function get_board_files_db($bo_table, $wr_id, $fields='*', $add_where='', $is_cache=false, $cnt=1, $separator='')
$key = md5($bo_table.'|'.$wr_id.$fields.$add_where.$separator);
게시글 목록
| 번호 | 제목 |
|---|---|
| 23254 | |
| 23244 | |
| 23241 | |
| 23236 | |
| 23200 | |
| 23199 | |
| 23179 | |
| 23174 | |
| 23138 | |
| 23128 | |
| 23125 | |
| 23116 | |
| 23109 | |
| 23099 | |
| 23092 | |
| 23083 | |
| 23079 | |
| 23063 | |
| 23050 | |
| 23036 | |
| 23029 | |
| 23007 | |
| 23003 | |
| 22983 | |
| 22959 | |
| 22943 | |
| 22939 | |
| 22934 | |
| 22905 | |
| 22897 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기