From 05d306c192f1af023897fa42a73606b77963a9a2 Mon Sep 17 00:00:00 2001 From: KWON Date: Tue, 25 Nov 2025 16:08:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B8=EB=8D=B1=EC=8A=A4=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=EC=9D=B4=20=EC=A0=9C=EB=8C=80=EB=A1=9C=20=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=B6=80=EB=B6=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../latest/rb.latest.event/latest.skin.php | 102 +++++++++--------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php b/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php index 1d8410498..b7c391839 100644 --- a/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php +++ b/theme/rb.basic/skin/latest/rb.latest.event/latest.skin.php @@ -107,6 +107,10 @@ $rb_skin['md_auto_is'] 자동롤링 여부(1,0)
$end_date) { - $item['_status'] = '종료'; // 종료 + } elseif ($today_time > $end_time) { + $item['_status'] = '종료'; $item['_sort'] = 3; } else { - $item['_status'] = '진행'; // 진행 중 + $item['_status'] = '진행'; $item['_sort'] = 0; } } else { @@ -130,15 +139,15 @@ $rb_skin['md_auto_is'] 자동롤링 여부(1,0) $item['_sort'] = 9; } - // 시작일 없을 경우를 고려한 비교용 날짜 (미입력 시 최후순) + // 시작일 없을 경우를 고려한 비교용 날짜 $item['_start_date'] = $start_date ? $start_date : '9999-99-99'; } unset($item); - // 정렬: 상태 우선순위(_sort) → 시작일(_start_date) + // 정렬: 상태 우선순위(_sort) → 시작일 최근순(내림차순) usort($list, function ($a, $b) { if ($a['_sort'] === $b['_sort']) { - // 시작일이 빠른 순서대로 하려는 경우 a, b의 순서를 변경하면 됨 + // strcmp를 역순으로: 시작일이 최근인 것을 먼저 (내림차순) return strcmp($b['_start_date'], $a['_start_date']); } return $a['_sort'] <=> $b['_sort']; @@ -149,52 +158,50 @@ $rb_skin['md_auto_is'] 자동롤링 여부(1,0) return $item['_status'] !== '종료'; }); + // array_filter 후 인덱스 재정렬 (중요!) + $list = array_values($list); + // 정렬 후 list_count 재설정 $list_count = count($list); for ($i=0; $i<$list_count; $i++) { - //썸네일 - $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true); + //썸네일 + $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true); - //썸네일여부 확인 - if($thumb['src']) { - if (strstr($list[$i]['wr_option'], 'secret')) { - $img = G5_THEME_URL.'/rb.img/sec_image.png'; - } else { - $img = $thumb['src']; + //썸네일여부 확인 + if($thumb['src']) { + if (strstr($list[$i]['wr_option'], 'secret')) { + $img = G5_THEME_URL.'/rb.img/sec_image.png'; + } else { + $img = $thumb['src']; + } + } else { + $img = G5_THEME_URL.'/rb.img/no_image.png'; + $thumb['alt'] = '이미지가 없습니다.'; + } + + //썸네일 출력 class="skin_list_image" 필수 (높이값 설정용) + $img_content = ''.$thumb['alt'].''; + + //게시물 링크 + $wr_href = get_pretty_url($bo_table, $list[$i]['wr_id']); + $sec_txt = '작성자 및 관리자 외 열람할 수 없습니다.
비밀글 기능으로 보호된 글입니다.
'; + $wr_content = strip_tags($list[$i]['wr_content']); + + //이벤트 라벨 + $rb_ev_ico = ''; + switch ($list[$i]['_status']) { + case '예정': + $rb_ev_ico = '예정'; + break; + case '종료': + $rb_ev_ico = '종료'; + break; + case '진행': + $rb_ev_ico = '진행'; + break; } - } else { - $img = G5_THEME_URL.'/rb.img/no_image.png'; - $thumb['alt'] = '이미지가 없습니다.'; - } - - //썸네일 출력 class="skin_list_image" 필수 (높이값 설정용) - $img_content = ''.$thumb['alt'].''; - - //게시물 링크 - $wr_href = get_pretty_url($bo_table, $list[$i]['wr_id']); - $sec_txt = '작성자 및 관리자 외 열람할 수 없습니다.
비밀글 기능으로 보호된 글입니다.
'; - $wr_content = strip_tags($list[$i]['wr_content']); - - //이벤트 - $todays = date('Y-m-d'); // 오늘 날짜 - - $start_date = isset($list[$i]['wr_1']) ? $list[$i]['wr_1'] : ''; - $end_date = isset($list[$i]['wr_2']) ? $list[$i]['wr_2'] : ''; - $rb_ev_ico = ''; - - switch ($list[$i]['_status']) { - case '예정': - $rb_ev_ico = '예정'; - break; - case '종료': - $rb_ev_ico = '종료'; - break; - case '진행': - $rb_ev_ico = '진행'; - break; - } ?>
@@ -303,7 +310,6 @@ $rb_skin['md_auto_is'] 자동롤링 여부(1,0)
-