@version(2) @php // 커머스 스킨 공용 헬퍼(가격 표기)는 커머스 컨트롤러가 로드한다. // 대문은 다른 모듈이므로 여기서 직접 불러 둔다. 커머스 미설치면 그냥 넘어간다. if (!function_exists('shop_item_price')) { $rl_helper = \RX_BASEDIR . 'modules/commerce/helpers.php'; if (is_file($rl_helper)) { require_once $rl_helper; } } if (!function_exists('rl_price')) { function rl_price($rl_amount) { if (function_exists('shop_money')) { return shop_money((int)$rl_amount); } return number_format((int)$rl_amount); } } if (!function_exists('rl_flat')) { // 꺾쇠를 직접 쓰면 템플릿 컴파일이 깨지므로 chr 로 만든다 function rl_flat($rl_t) { $rl_lt = chr(60); $rl_gt = chr(62); $rl_t = preg_replace('/' . $rl_lt . 'br[^' . $rl_gt . ']*' . $rl_gt . '/i', ' ', (string)$rl_t); return trim(strip_tags($rl_t)); } } if (!function_exists('rl_post_thumb')) { // 코어 썸네일은 사이트 설정이 '첨부파일'이면 본문 이미지를 쓰지 않는다. // 그런 사이트에서도 카드가 비지 않게 본문 첫 이미지를 폴백으로 쓴다. function rl_post_thumb($rl_doc, $rl_w, $rl_h) { $rl_t = $rl_doc->getThumbnail($rl_w, $rl_h); if ($rl_t) { return $rl_t; } $rl_body = (string)$rl_doc->get('content'); $rl_lt = chr(60); if (preg_match('/' . $rl_lt . 'img\s[^>]*?src=("|\')([^"\' ]+)("|\')/i', $rl_body, $rl_m)) { return htmlspecialchars_decode(trim($rl_m[2])); } return ''; } } if (!function_exists('rl_cmp_new')) { function rl_cmp_new($rl_a, $rl_b) { return (int)$rl_b->item_srl <=> (int)$rl_a->item_srl; } } if (!function_exists('rl_board_rows')) { function rl_board_rows($rl_mid, $rl_count) { if ($rl_mid === '') { foreach (ModuleModel::getMidList((object)['module' => 'board'], ['mid']) ?: [] as $rl_brow) { $rl_mid = (string)($rl_brow->mid ?? ''); break; } } if ($rl_mid === '') { return ['mid' => '', 'rows' => []]; } $rl_binfo = ModuleModel::getModuleInfoByMid($rl_mid); if (!is_object($rl_binfo) || empty($rl_binfo->module_srl)) { return ['mid' => $rl_mid, 'rows' => []]; } $rl_args = new stdClass; $rl_args->module_srl = (int)$rl_binfo->module_srl; $rl_args->list_count = $rl_count; $rl_args->sort_index = 'list_order'; $rl_args->order_type = 'asc'; $rl_args->statusList = ['PUBLIC']; $rl_out = getModel('document')->getDocumentList($rl_args); $rl_rows = []; foreach ((array)($rl_out->data ?? []) as $rl_doc) { $rl_rows[] = $rl_doc; } return ['mid' => $rl_mid, 'rows' => $rl_rows]; } } // 굿즈 상점 $rl_shop = trim((string)($rl->shop_mid ?? '')); if ($rl_shop === '') { foreach (ModuleModel::getMidList((object)['module' => 'commerce'], ['mid']) ?: [] as $rl_row) { $rl_shop = (string)($rl_row->mid ?? ''); break; } } // 섹션 구성 $rl_secs = []; foreach (array_values((array)($rl->home_sections ?? [])) as $rl_srow) { $rl_srow = (array)$rl_srow; if (empty($rl_srow['stype'])) { continue; } $rl_secs[] = [ 'stype' => (string)$rl_srow['stype'], 'title' => trim((string)($rl_srow['title'] ?? '')), 'text' => trim((string)($rl_srow['text'] ?? '')), 'image' => trim((string)($rl_srow['image'] ?? '')), 'source' => trim((string)($rl_srow['source'] ?? '')), 'link_text' => trim((string)($rl_srow['link_text'] ?? '')), 'link_url' => trim((string)($rl_srow['link_url'] ?? '')), 'count' => max(2, min(12, (int)($rl_srow['count'] ?? 8))), ]; } if (!count($rl_secs)) { $rl_secs = [ ['stype' => 'statement', 'title' => '', 'text' => '', 'image' => '', 'source' => '', 'link_text' => '', 'link_url' => '', 'count' => 4], ['stype' => 'riders', 'title' => '', 'text' => '', 'image' => '', 'source' => '', 'link_text' => '', 'link_url' => '', 'count' => 8], ['stype' => 'stats', 'title' => '', 'text' => '', 'image' => '', 'source' => '', 'link_text' => '', 'link_url' => '', 'count' => 4], ['stype' => 'goods', 'title' => '', 'text' => '', 'image' => '', 'source' => '', 'link_text' => '', 'link_url' => '', 'count' => 8], ['stype' => 'journal', 'title' => '', 'text' => '', 'image' => '', 'source' => '', 'link_text' => '', 'link_url' => '', 'count' => 3], ]; } // 상품 풀. 굿즈 섹션이 하나라도 있으면 한 번만 조회한다 $rl_pool = []; $rl_need_items = false; foreach ($rl_secs as $rl_s) { if (strpos($rl_s['stype'], 'goods') === 0) { $rl_need_items = true; } } if ($rl_need_items && $rl_shop !== '') { $rl_out = executeQuery('commerce.getItemList', (object)[ 'status_list' => 'sale,soldout', 'sort_index' => 'list_order', 'order_type' => 'asc', 'list_count' => 120, ]); if ($rl_out->toBool() && !empty($rl_out->data)) { $rl_rows = is_array($rl_out->data) ? $rl_out->data : [$rl_out->data]; $rl_now = date('YmdHis'); foreach ($rl_rows as $rl_it) { if (empty($rl_it->item_srl)) { continue; } if (!empty($rl_it->sale_start) && $rl_now < $rl_it->sale_start) { continue; } if (!empty($rl_it->sale_end) && $rl_now > $rl_it->sale_end) { continue; } $rl_it->item_name = \Context::replaceUserLang((string)$rl_it->item_name); $rl_pool[] = $rl_it; } } } $rl_riders = []; foreach (array_values((array)($rl->riders ?? [])) as $rl_rr) { $rl_rr = (array)$rl_rr; if (trim((string)($rl_rr['name'] ?? '')) === '') { continue; } $rl_riders[] = $rl_rr; } $rl_stats = []; foreach (array_values((array)($rl->stats ?? [])) as $rl_st) { $rl_st = (array)$rl_st; if (trim((string)($rl_st['value'] ?? '')) === '') { continue; } $rl_stats[] = $rl_st; } @endphp
{{ $rl_sec['text'] !== '' ? $rl_sec['text'] : $lang->rl_statement_default }}
@if ($rl_sec['link_url'] !== '' && $rl_sec['link_text'] !== '') {{ $rl_sec['link_text'] }} @endif{{ $rl_sec['text'] }}
@endif @if ($rl_sec['link_url'] !== '' && $rl_sec['link_text'] !== '') {{ $rl_sec['link_text'] }} @endif