diff --git a/modules/board/board.admin.controller.php b/modules/board/board.admin.controller.php index 3ebbbb954..e1b0ed55f 100644 --- a/modules/board/board.admin.controller.php +++ b/modules/board/board.admin.controller.php @@ -186,6 +186,7 @@ class boardAdminController extends board { $vars = Context::getRequestVars(); $module_srl = intval($vars->target_module_srl); $include_modules = array_map('intval', $vars->include_modules ?: []); + $include_days = max(0, floatval($vars->include_days)); $module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl); if (!$module_info) @@ -196,6 +197,7 @@ class boardAdminController extends board { $module_info->include_modules = implode(',', array_filter($include_modules, function($item) { return $item > 0; })); + $module_info->include_days = floatval(number_format($include_days, 2, '.', '')); $output = getController('module')->updateModule($module_info); if (!$output->toBool()) diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 6d16a7fd5..2ce9ec495 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -182,7 +182,12 @@ class boardView extends board } // display the board content - $this->dispBoardContentView(); + $output = $this->dispBoardContentView(); + if ($output instanceof DocumentItem) + { + $this->setRedirectUrl($output->getPermanentUrl()); + return; + } // list config, columnList setting $this->listConfig = BoardModel::getListConfig($this->module_info->module_srl); @@ -251,7 +256,14 @@ class boardView extends board { if (!in_array($oDocument->get('module_srl'), $this->include_modules)) { - throw new Rhymix\Framework\Exceptions\TargetNotFound; + return $oDocument; + } + if (isset($this->module_info->include_days) && $this->module_info->include_days > 0) + { + if ($oDocument->get('regdate') < date('YmdHis', time() - ($this->module_info->include_days * 86400))) + { + return $oDocument; + } } } @@ -480,6 +492,10 @@ class boardView extends board $args->page = intval(Context::get('page')) ?: null; $args->list_count = $this->list_count; $args->page_count = $this->page_count; + if (isset($this->module_info->include_days) && $this->module_info->include_days > 0) + { + $args->start_regdate = date('YmdHis', time() - ($this->module_info->include_days * 86400)); + } // get the search target and keyword if ($this->grant->view) diff --git a/modules/board/lang/en.php b/modules/board/lang/en.php index 65a317803..7e1882cc2 100644 --- a/modules/board/lang/en.php +++ b/modules/board/lang/en.php @@ -95,4 +95,6 @@ $lang->msg_document_notify_mail = '[%s] The new post : %s'; $lang->cmd_board_combined_board = 'Combined Board'; $lang->about_board_combined_board = 'You can use this board to view documents from other boards. Press the Ctrl key and click to select multiple boards.'; $lang->cmd_board_include_modules = 'Include Boards'; -$lang->cmd_board_include_modules_none = '(None)'; \ No newline at end of file +$lang->cmd_board_include_modules_none = '(None)'; +$lang->cmd_board_include_days = 'Include Duration'; +$lang->about_board_include_days = 'Only combine recent documents. If this value is set to 0, all documents from selected boards will be combined.
Durations shorter than 1 day can be set as fractions of a day, e.g. 0.25 days = 6 hours.'; \ No newline at end of file diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index dd740c15a..803dc647c 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -107,4 +107,6 @@ $lang->msg_not_target = '문서 또는 댓글의 추천인목록만 조회가능 $lang->cmd_board_combined_board = '통합 게시판'; $lang->about_board_combined_board = '다른 게시판의 글을 모아서 볼 수 있습니다. 여러 게시판을 선택하려면 Ctrl 키를 누르고 클릭하세요.'; $lang->cmd_board_include_modules = '포함할 게시판 선택'; -$lang->cmd_board_include_modules_none = '(포함하지 않음)'; \ No newline at end of file +$lang->cmd_board_include_modules_none = '(포함하지 않음)'; +$lang->cmd_board_include_days = '포함할 기간'; +$lang->about_board_include_days = '최근 글만 모으도록 설정할 수 있습니다. 0을 입력하면 위에서 선택한 게시판의 모든 글을 모아서 보여 줍니다.
1일 미만의 기간은 소수로 표현할 수 있습니다. 예: 0.25일 = 6시간'; \ No newline at end of file diff --git a/modules/board/tpl/addition_setup.html b/modules/board/tpl/addition_setup.html index 1f6364faf..9cb2e128d 100644 --- a/modules/board/tpl/addition_setup.html +++ b/modules/board/tpl/addition_setup.html @@ -14,9 +14,9 @@ {@ $include_modules = explode(',', $module_info->include_modules ?? '')}
- +
- @@ -25,6 +25,13 @@

{$lang->about_board_combined_board}

+
+ +
+ {$lang->unit_day} +

{$lang->about_board_include_days}

+
+
diff --git a/modules/document/document.model.php b/modules/document/document.model.php index bcdbd99d1..7b909220e 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -1307,6 +1307,8 @@ class documentModel extends document $args->page_count = $searchOpt->page_count ?? 10; $args->start_date = $searchOpt->start_date ?? null; $args->end_date = $searchOpt->end_date ?? null; + $args->start_regdate = $searchOpt->start_regdate ?? null; + $args->end_regdate = $searchOpt->end_regdate ?? null; $args->s_is_notice = ($searchOpt->except_notice ?? false) ? 'N' : null; $args->statusList = $searchOpt->statusList ?? array(self::getConfigStatus('public'), self::getConfigStatus('secret')); $args->columnList = $searchOpt->columnList ?? array(); diff --git a/modules/document/queries/getDocumentCount.xml b/modules/document/queries/getDocumentCount.xml index 9edba2211..4b064dcc2 100644 --- a/modules/document/queries/getDocumentCount.xml +++ b/modules/document/queries/getDocumentCount.xml @@ -35,6 +35,8 @@ + + diff --git a/modules/document/queries/getDocumentCountByGroupStatus.xml b/modules/document/queries/getDocumentCountByGroupStatus.xml index d2a470e5b..ec922d296 100644 --- a/modules/document/queries/getDocumentCountByGroupStatus.xml +++ b/modules/document/queries/getDocumentCountByGroupStatus.xml @@ -36,6 +36,8 @@ + + diff --git a/modules/document/queries/getDocumentList.xml b/modules/document/queries/getDocumentList.xml index 47f71318f..23dc88782 100644 --- a/modules/document/queries/getDocumentList.xml +++ b/modules/document/queries/getDocumentList.xml @@ -39,6 +39,8 @@ + + diff --git a/modules/document/queries/getDocumentListExtraSort.xml b/modules/document/queries/getDocumentListExtraSort.xml index 58d2fcdd1..300270b2c 100644 --- a/modules/document/queries/getDocumentListExtraSort.xml +++ b/modules/document/queries/getDocumentListExtraSort.xml @@ -44,6 +44,8 @@ + + diff --git a/modules/document/queries/getDocumentListUseIndex.xml b/modules/document/queries/getDocumentListUseIndex.xml index 00a401dff..5163e701c 100644 --- a/modules/document/queries/getDocumentListUseIndex.xml +++ b/modules/document/queries/getDocumentListUseIndex.xml @@ -42,6 +42,8 @@ + + diff --git a/modules/document/queries/getDocumentListWithinComment.xml b/modules/document/queries/getDocumentListWithinComment.xml index 066e3253c..cfb1f7511 100644 --- a/modules/document/queries/getDocumentListWithinComment.xml +++ b/modules/document/queries/getDocumentListWithinComment.xml @@ -20,6 +20,8 @@ + + diff --git a/modules/document/queries/getDocumentListWithinExtraVarsExtraSort.xml b/modules/document/queries/getDocumentListWithinExtraVarsExtraSort.xml index 5c4306d2a..650d229fa 100644 --- a/modules/document/queries/getDocumentListWithinExtraVarsExtraSort.xml +++ b/modules/document/queries/getDocumentListWithinExtraVarsExtraSort.xml @@ -45,6 +45,8 @@ + + diff --git a/modules/document/queries/getDocumentListWithinTag.xml b/modules/document/queries/getDocumentListWithinTag.xml index 53e9729dc..8f5cefd24 100644 --- a/modules/document/queries/getDocumentListWithinTag.xml +++ b/modules/document/queries/getDocumentListWithinTag.xml @@ -19,6 +19,8 @@ + +