$end_date) {
$item['_status'] = '종료'; // 종료
$item['_sort'] = 3;
} else {
$item['_status'] = '진행'; // 진행 중
$item['_sort'] = 0;
}
} else {
$item['_status'] = '기타';
$item['_sort'] = 9;
}
// 시작일 없을 경우를 고려한 비교용 날짜 (미입력 시 최후순)
$item['_start_date'] = $start_date ? $start_date : '9999-99-99';
}
unset($item);
// 정렬: 상태 우선순위(_sort) → 시작일(_start_date)
usort($list, function ($a, $b) {
if ($a['_sort'] === $b['_sort']) {
// 시작일이 빠른 순서대로 하려는 경우 a, b의 순서를 변경하면 됨
return strcmp($b['_start_date'], $a['_start_date']);
}
return $a['_sort'] <=> $b['_sort'];
});
// 종료 상태인 항목 제외
$list = array_filter($list, function ($item) {
return $item['_status'] !== '종료';
});
// 정렬 후 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);
//썸네일여부 확인
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'].']('.$img.')
';
//게시물 링크
$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;
}
?>
style="width:100%">
-
-
-
댓글
조회
데이터가 없습니다.