From 0fdb48c31a4328f19c52cd2bbfcb4c132a1df733 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 14 Sep 2019 21:24:36 +0900 Subject: [PATCH] Add options to hide the bottom list --- modules/board/board.admin.controller.php | 3 +++ modules/board/board.view.php | 24 ++++++++++++----- modules/board/lang/en.php | 9 ++++++- modules/board/lang/ko.php | 11 ++++++-- modules/board/tpl/board_insert.html | 33 +++++++++++++++++++++--- 5 files changed, 67 insertions(+), 13 deletions(-) diff --git a/modules/board/board.admin.controller.php b/modules/board/board.admin.controller.php index 112cb9c47..a40d71511 100644 --- a/modules/board/board.admin.controller.php +++ b/modules/board/board.admin.controller.php @@ -44,6 +44,9 @@ class boardAdminController extends board { // setup other variables if($args->except_notice != 'Y') $args->except_notice = 'N'; + if($args->use_bottom_list != 'Y') $args->use_bottom_list = 'N'; + if($args->skip_bottom_list_for_olddoc != 'Y') $args->skip_bottom_list_for_olddoc = 'N'; + if($args->skip_bottom_list_for_robot != 'Y') $args->skip_bottom_list_for_robot = 'N'; if($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; if($args->consultation != 'Y') $args->consultation = 'N'; if($args->protect_content!= 'Y') $args->protect_content = 'N'; diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 178e2dac1..9ad9669ac 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -449,7 +449,7 @@ class boardView extends board **/ function dispBoardNoticeList(){ // check the grant - if(!$this->grant->list) + if(!$this->grant->list || (Context::get('document_srl') && $this->module_info->use_bottom_list === 'N')) { Context::set('notice_list', array()); return; @@ -467,7 +467,7 @@ class boardView extends board **/ function dispBoardContentList(){ // check the grant - if(!$this->grant->list) + if(!$this->grant->list || (Context::get('document_srl') && $this->module_info->use_bottom_list === 'N')) { Context::set('document_list', array()); Context::set('total_count', 0); @@ -482,7 +482,7 @@ class boardView extends board // setup module_srl/page number/ list number/ page count $args = new stdClass(); $args->module_srl = $this->module_srl; - $args->page = Context::get('page'); + $args->page = intval(Context::get('page')) ?: null; $args->list_count = $this->list_count; $args->page_count = $this->page_count; @@ -525,14 +525,24 @@ class boardView extends board // set the current page of documents $document_srl = Context::get('document_srl'); - if(!$args->page && $document_srl) + if($document_srl && $this->module_info->skip_bottom_list_for_robot === 'Y' && isCrawler()) + { + Context::set('page', $args->page = null); + } + elseif(!$args->page && $document_srl) { $oDocument = $oDocumentModel->getDocument($document_srl); if($oDocument->isExists() && !$oDocument->isNotice()) { - $page = $oDocumentModel->getDocumentPage($oDocument, $args); - Context::set('page', $page); - $args->page = $page; + if($oDocument->getRegdateTime() < (time() - (86400 * 30)) && $this->module_info->skip_bottom_list_for_olddoc === 'Y') + { + Context::set('page', $args->page = null); + } + else + { + $args->page = $oDocumentModel->getDocumentPage($oDocument, $args); + Context::set('page', $args->page); + } } } diff --git a/modules/board/lang/en.php b/modules/board/lang/en.php index 2f4d21609..096da04f6 100644 --- a/modules/board/lang/en.php +++ b/modules/board/lang/en.php @@ -1,6 +1,8 @@ board = 'Board'; $lang->except_notice = 'Exclude Notices'; +$lang->use_bottom_list = 'Display Bottom List'; +$lang->customize_bottom_list = 'Customize Bottom List'; $lang->use_anonymous = 'Use Anonymous'; $lang->anonymous_name = 'Anonymous Name for Display'; $lang->cmd_manage_menu = 'Manage Menus'; @@ -20,11 +22,14 @@ $lang->cmd_board_list = 'Boards List'; $lang->cmd_module_config = 'Common Board Setting'; $lang->cmd_board_info = 'Board Info'; $lang->cmd_list_setting = 'List Setting'; +$lang->cmd_list_items = 'Displayed Items and Order'; $lang->cmd_create_board = 'Create a new board'; $lang->cmd_manage_selected_board = 'Manage Selected Board'; $lang->about_layout_setup = 'You can manually modify board layout code. Insert or manage the widget code anywhere you want'; $lang->about_board_category = 'You can make board categories. When board category is broken, try rebuilding the cache file manually.'; -$lang->about_except_notice = 'Notice articles will not be displayed on normal list.'; +$lang->about_except_notice = 'Notices will not be displayed in the normal list.
Caution: using this option can increase DB load if you have many visitors and lots of articles.'; +$lang->about_use_bottom_list = 'Display the list at the bottom when viewing an article.'; +$lang->about_customize_bottom_list = 'Calculating the bottom list consumes a lot of server resources.
You may be able to reduce DB load by not calculating it exactly when not needed.
This should have no effect on SEO.'; $lang->about_use_anonymous_part1 = 'Hide the author\'s nickname to turn this board into an anonymous board.'; $lang->about_use_anonymous_part2 = 'It is more useful if you also hide the nickname in the skin.
Please also turn off document history, or the author\'s information may be revealed by the history.'; $lang->about_anonymous_name = 'You can customize the anonymous name that is displayed instead of the author\'s nickname.
$NUM will be replaced with a random number that is unique to each member. (e.g. anon_$NUM → anon_12345678)
$DAILYNUM will be replaced with a random number that is unique to each member but changes every day.
$DOCNUM will be replaced with a random number that is unique to each member and changes from document to document.
$DOCDAILYNUM will be replaced with a random number that is unique to each member and changes every day from document to document.'; @@ -36,6 +41,8 @@ $lang->about_list_config = 'If using list-style skin, you may arrange items to d $lang->about_use_status = 'Please select status that can be selected when you write article.'; $lang->about_protect_comment = 'Prevent updating or deleting a comment if it has children.'; $lang->about_update_log = 'Store a log of every version of a document every time it is updated.'; +$lang->skip_bottom_list_for_olddoc = 'Do not calculate the bottom list exactly when viewing an old article.'; +$lang->skip_bottom_list_for_robot = 'Do not calculate the bottom list exactly when a robot is visiting.'; $lang->msg_not_enough_point = 'Your point is not enough to write an article in this board.'; $lang->write_comment = 'Write a comment'; $lang->msg_not_allow_comment = 'This article is not allowed to write comment.'; diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index fbf433408..2461eb182 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -1,6 +1,8 @@ board = '게시판'; $lang->except_notice = '공지사항 제외'; +$lang->use_bottom_list = '하단목록 표시'; +$lang->customize_bottom_list = '하단목록 설정'; $lang->use_anonymous = '익명 사용'; $lang->anonymous_name = '익명 닉네임'; $lang->cmd_manage_menu = '메뉴관리'; @@ -20,12 +22,15 @@ $lang->last_updater = '수정한 사람'; $lang->cmd_board_list = '게시판 목록'; $lang->cmd_module_config = '게시판 공통 설정'; $lang->cmd_board_info = '게시판 정보'; -$lang->cmd_list_setting = '목록설정'; +$lang->cmd_list_setting = '목록 설정'; +$lang->cmd_list_items = '표시 항목 및 순서'; $lang->cmd_create_board = '게시판 등록'; $lang->cmd_manage_selected_board = '선택한 게시판 관리'; $lang->about_layout_setup = '블로그의 레이아웃 코드를 직접 수정할 수 있습니다. 위젯 코드를 원하는 곳에 삽입하시거나 관리하세요'; $lang->about_board_category = '분류를 만들 수 있습니다. 분류가 오동작을 할 경우 캐시파일 재생성을 수동으로 해주시면 해결이 될 수 있습니다.'; -$lang->about_except_notice = '목록 상단에 늘 나타나는 공지사항을 일반 목록에서 공지사항을 출력하지 않도록 합니다.'; +$lang->about_except_notice = '목록 상단에 늘 나타나는 공지사항을 일반 목록에 출력하지 않도록 합니다.
주의: 이용자와 게시물이 많은 게시판에서 이 옵션을 사용하면 DB 부하를 유발할 수 있습니다.'; +$lang->about_use_bottom_list = '글읽기 화면 하단에도 목록을 표시합니다.'; +$lang->about_customize_bottom_list = '게시물이 많은 경우 하단목록 계산에 많은 서버 자원이 소요됩니다.
불필요한 상황에서 하단목록을 계산하지 않도록 하면 DB 부하를 크게 줄일 수 있습니다.
검색 노출에는 영향을 주지 않습니다.'; $lang->about_use_anonymous_part1 = '글쓴이의 정보를 제거하고 익명으로 게시판을 사용하도록 합니다.'; $lang->about_use_anonymous_part2 = '스킨 설정에서 글쓴이 정보 등을 숨기도록 설정하면 더욱 유용합니다.
추가 설정에서 문서 히스토리가 켜져 있으면 문서 수정시 작성자가 표시될 수 있으니 주의하십시오.'; $lang->about_anonymous_name = '익명 기능을 사용할 때 표시할 익명 닉네임을 정할 수 있습니다.
$NUM을 사용하면 회원마다 고유한 난수를 부여할 수 있습니다. (예: 익명_$NUM → 익명_12345678)
$DAILYNUM을 사용하면 매일 난수가 변경되고, $DOCNUM을 사용하면 문서마다 변경됩니다.
$DOCDAILYNUM을 사용하면 문서마다 각각, 그리고 매일 변경됩니다.'; @@ -37,6 +42,8 @@ $lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목 $lang->about_use_status = '글 작성 시 선택할 수 있는 상태를 지정해주세요.'; $lang->about_protect_comment = '댓글의 댓글이 있을경우 해당댓글을 삭제 및 수정을 할 수 없도록 합니다.'; $lang->about_update_log = '게시글을 수정할 경우 수정한 내역을 저장하도록 합니다.'; +$lang->skip_bottom_list_for_olddoc = '오래된 게시물 열람시 하단 목록을 정확하게 계산하지 않음'; +$lang->skip_bottom_list_for_robot = '로봇 방문시 하단 목록을 정확하게 계산하지 않음'; $lang->msg_not_enough_point = '포인트가 부족합니다'; $lang->write_comment = '댓글 쓰기'; $lang->msg_not_allow_comment = '해당 글의 댓글 쓰기가 잠겨있습니다.'; diff --git a/modules/board/tpl/board_insert.html b/modules/board/tpl/board_insert.html index 3473d85f7..1cfcf5d60 100644 --- a/modules/board/tpl/board_insert.html +++ b/modules/board/tpl/board_insert.html @@ -163,9 +163,9 @@
-

{$lang->subtitle_advanced}

+

{$lang->cmd_list_setting}

- +
{@$list = array_keys($list_config)} @@ -209,9 +209,36 @@
- + + +

{$lang->about_except_notice}

+
+ +
+ + +

{$lang->about_use_bottom_list}

+
+
+
+ +
+ + +

{$lang->about_customize_bottom_list}

+
+
+
+
+

{$lang->subtitle_advanced}