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 ?? '')}
{$lang->about_board_include_days}
+