mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix #1505 duration limit to combined boards
- 통합게시판 글을 모을 기간을 설정할 수 있도록 함 - 통합게시판 소속이 아니거나 기간을 벗어나는 글 발견시 실제 게시판 주소로 redirect
This commit is contained in:
parent
89240196c3
commit
88907fa9df
14 changed files with 53 additions and 6 deletions
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)';
|
||||
$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.<br />Durations shorter than 1 day can be set as fractions of a day, e.g. 0.25 days = 6 hours.';
|
||||
|
|
@ -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 = '(포함하지 않음)';
|
||||
$lang->cmd_board_include_modules_none = '(포함하지 않음)';
|
||||
$lang->cmd_board_include_days = '포함할 기간';
|
||||
$lang->about_board_include_days = '최근 글만 모으도록 설정할 수 있습니다. 0을 입력하면 위에서 선택한 게시판의 모든 글을 모아서 보여 줍니다.<br />1일 미만의 기간은 소수로 표현할 수 있습니다. 예: 0.25일 = 6시간';
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl}" />
|
||||
{@ $include_modules = explode(',', $module_info->include_modules ?? '')}
|
||||
<div class="x_control-group">
|
||||
<label for="use_history" class="x_control-label">{$lang->cmd_board_include_modules}</label>
|
||||
<label for="include_modules" class="x_control-label">{$lang->cmd_board_include_modules}</label>
|
||||
<div class="x_controls">
|
||||
<select name="include_modules[]" size="8" multiple="multiple">
|
||||
<select name="include_modules[]" id="include_modules" size="8" multiple="multiple">
|
||||
<option value="">{$lang->cmd_board_include_modules_none}</option>
|
||||
<!--@foreach($board_list as $board_info)-->
|
||||
<option value="{$board_info->module_srl}" selected="selected"|cond="in_array($board_info->module_srl, $include_modules)">{$board_info->browser_title}</option>
|
||||
|
|
@ -25,6 +25,13 @@
|
|||
<p class="x_help-block">{$lang->about_board_combined_board}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="include_days" class="x_control-label">{$lang->cmd_board_include_days}</label>
|
||||
<div class="x_controls">
|
||||
<input name="include_days" id="include_days" type="number" min="0" step="0.01" value="{$module_info->include_days ?: 0}" /> {$lang->unit_day}
|
||||
<p class="x_help-block">{$lang->about_board_include_days}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@
|
|||
<group pipe="and">
|
||||
<condition operation="more" column="last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="regdate" var="end_regdate" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@
|
|||
<group pipe="and">
|
||||
<condition operation="more" column="last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="regdate" var="end_regdate" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
<groups>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@
|
|||
<group pipe="and">
|
||||
<condition operation="more" column="last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="regdate" var="end_regdate" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
<navigation>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@
|
|||
<group pipe="and">
|
||||
<condition operation="more" column="d.last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="d.last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="d.regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="d.regdate" var="end_regdate" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
<groups>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@
|
|||
<group pipe="and">
|
||||
<condition operation="more" column="last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="regdate" var="end_regdate" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
<navigation>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
<condition operation="below" column="documents.list_order" var="last_division" pipe="and" />
|
||||
<condition operation="more" column="documents.last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="documents.last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="documents.regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="documents.regdate" var="end_regdate" pipe="and" />
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="documents.document_srl" />
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
<group pipe="and">
|
||||
<condition operation="more" column="d.last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="d.last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="d.regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="d.regdate" var="end_regdate" pipe="and" />
|
||||
</group>
|
||||
<group pipe="and">
|
||||
<condition operation="equal" column="es.var_idx" var="var_idx" pipe="and" />
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
<condition operation="below" column="documents.list_order" var="last_division" pipe="and" />
|
||||
<condition operation="more" column="documents.last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="documents.last_update" var="end_date" pipe="and" />
|
||||
<condition operation="more" column="documents.regdate" var="start_regdate" pipe="and" />
|
||||
<condition operation="less" column="documents.regdate" var="end_regdate" pipe="and" />
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="documents.document_srl" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue