From 480d7582f2e4aca3c46ccb8856673911978e0a09 Mon Sep 17 00:00:00 2001 From: zero Date: Tue, 8 Jan 2008 07:35:51 +0000 Subject: [PATCH] =?UTF-8?q?=EA=B8=80=20=EC=A1=B0=ED=9A=8C=EC=8B=9C=20?= =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=B0=A8=EA=B0=90=20=EB=98=90?= =?UTF-8?q?=EB=8A=94=20=EC=A6=9D=EA=B0=90=20=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80.=20=EB=AA=A8=EB=93=88=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=ED=95=84=EC=9A=94.=20=EC=A4=91=EB=B3=B5=20?= =?UTF-8?q?=EB=B6=80=EA=B3=BC=20=EC=95=88=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3501 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/document/document.controller.php | 4 +++ modules/point/lang/en.lang.php | 1 + modules/point/lang/es.lang.php | 1 + modules/point/lang/jp.lang.php | 1 + modules/point/lang/ko.lang.php | 1 + modules/point/lang/ru.lang.php | 1 + modules/point/lang/zh-CN.lang.php | 1 + modules/point/point.admin.controller.php | 4 ++- modules/point/point.class.php | 7 +++++ modules/point/point.controller.php | 30 ++++++++++++++++++++++ modules/point/point.view.php | 1 + modules/point/tpl/config.html | 6 ++++- modules/point/tpl/module_config.html | 12 +++++---- modules/point/tpl/point_module_config.html | 18 +++++++++---- 14 files changed, 76 insertions(+), 12 deletions(-) diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 899aadc47..8d5593245 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -361,6 +361,10 @@ // 로그 남기기 $output = executeQuery('document.insertDocumentReadedLog', $args); + // 조회수 업데이트가 되면 trigger 호출 (after) + $output = ModuleHandler::triggerCall('document.updateReadedCount', 'after', $oDocument); + if(!$output->toBool()) return $output; + // 세션 정보에 남김 return $_SESSION['readed_document'][$document_srl] = true; } diff --git a/modules/point/lang/en.lang.php b/modules/point/lang/en.lang.php index f8ee8b8e0..c8b4393b5 100644 --- a/modules/point/lang/en.lang.php +++ b/modules/point/lang/en.lang.php @@ -44,6 +44,7 @@ $lang->point_upload_file = 'On Uploading'; $lang->point_delete_file = 'On Deleting Files'; $lang->point_download_file = 'On Downloading Files (Exclude images)'; + $lang->point_read_document = 'On Reading'; $lang->cmd_point_config = 'Default Setting'; diff --git a/modules/point/lang/es.lang.php b/modules/point/lang/es.lang.php index 19dc287a3..fe6cafdb0 100644 --- a/modules/point/lang/es.lang.php +++ b/modules/point/lang/es.lang.php @@ -44,6 +44,7 @@ $lang->point_upload_file = 'Al subri archivos'; $lang->point_delete_file = 'Al borrar archivos'; $lang->point_download_file = 'Al descargar archivos (Excepto imágenes)'; + $lang->point_read_document = '게시글 조회'; $lang->cmd_point_config = 'Configuración predefinida'; diff --git a/modules/point/lang/jp.lang.php b/modules/point/lang/jp.lang.php index 6b497ac83..f0c351f15 100644 --- a/modules/point/lang/jp.lang.php +++ b/modules/point/lang/jp.lang.php @@ -44,6 +44,7 @@ $lang->point_upload_file = 'アップロード'; $lang->point_delete_file = 'ファイル削除'; $lang->point_download_file = 'ダウンロード'; + $lang->point_read_document = '게시글 조회'; $lang->cmd_point_config = 'デフォルト設定'; diff --git a/modules/point/lang/ko.lang.php b/modules/point/lang/ko.lang.php index 1047b7b87..1ad796912 100644 --- a/modules/point/lang/ko.lang.php +++ b/modules/point/lang/ko.lang.php @@ -44,6 +44,7 @@ $lang->point_upload_file = '파일 업로드'; $lang->point_delete_file = '파일 삭제'; $lang->point_download_file = '파일 다운로드 (이미지 제외)'; + $lang->point_read_document = '게시글 조회'; $lang->cmd_point_config = '기본 설정'; diff --git a/modules/point/lang/ru.lang.php b/modules/point/lang/ru.lang.php index 431a693fc..c0fb103cd 100644 --- a/modules/point/lang/ru.lang.php +++ b/modules/point/lang/ru.lang.php @@ -44,6 +44,7 @@ $lang->point_upload_file = 'При закачке файлов'; $lang->point_delete_file = 'При скачке файлов'; $lang->point_download_file = 'При скачке файлов (кроме изображений)'; + $lang->point_read_document = '게시글 조회'; $lang->cmd_point_config = 'Настройки по умолчанию'; diff --git a/modules/point/lang/zh-CN.lang.php b/modules/point/lang/zh-CN.lang.php index 0a91ebd49..09ecb1566 100644 --- a/modules/point/lang/zh-CN.lang.php +++ b/modules/point/lang/zh-CN.lang.php @@ -44,6 +44,7 @@ $lang->point_upload_file = '上传文件'; $lang->point_delete_file = '删除文件'; $lang->point_download_file = '下载文件 (图片除外)'; + $lang->point_read_document = '게시글 조회'; $lang->cmd_point_config = '基本设置'; diff --git a/modules/point/point.admin.controller.php b/modules/point/point.admin.controller.php index 2202513a6..485a244e0 100644 --- a/modules/point/point.admin.controller.php +++ b/modules/point/point.admin.controller.php @@ -30,6 +30,7 @@ $config->signup_point = (int)$args->signup_point; $config->login_point = (int)$args->login_point; $config->insert_document = (int)$args->insert_document; + $config->read_document = (int)$args->read_document; $config->insert_comment = (int)$args->insert_comment; $config->upload_file = (int)$args->upload_file; $config->download_file = (int)$args->download_file; @@ -71,7 +72,7 @@ $args = Context::getRequestVars(); foreach($args as $key => $val) { - preg_match("/^(insert_document|insert_comment|upload_file|download_file)_([0-9]+)$/", $key, $matches); + preg_match("/^(insert_document|insert_comment|upload_file|download_file|read_document)_([0-9]+)$/", $key, $matches); if(!$matches[1]) continue; $name = $matches[1]; $module_srl = $matches[2]; @@ -103,6 +104,7 @@ $config->module_point[$module_srl]['insert_comment'] = (int)Context::get('insert_comment'); $config->module_point[$module_srl]['upload_file'] = (int)Context::get('upload_file'); $config->module_point[$module_srl]['download_file'] = (int)Context::get('download_file'); + $config->module_point[$module_srl]['read_document'] = (int)Context::get('read_document'); $oModuleController = &getController('module'); $oModuleController->insertModuleConfig('point', $config); diff --git a/modules/point/point.class.php b/modules/point/point.class.php index 7b5a284db..b5c2c93b1 100644 --- a/modules/point/point.class.php +++ b/modules/point/point.class.php @@ -72,6 +72,9 @@ $config->download_file = -5; $config->download_file_act = 'procFileDownload'; + // 조회 + $config->read_document = 0; + // 설정 저장 $oModuleController->insertModuleConfig('point', $config); @@ -91,6 +94,7 @@ $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); + $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); return new Object(); } @@ -115,6 +119,7 @@ if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; return false; } @@ -152,6 +157,8 @@ $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) + $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); return new Object(0, 'success_updated'); } diff --git a/modules/point/point.controller.php b/modules/point/point.controller.php index 8b1100e66..e335d5590 100644 --- a/modules/point/point.controller.php +++ b/modules/point/point.controller.php @@ -309,6 +309,36 @@ return new Object(); } + /** + * @brief 조회수 증가시 포인트 적용 + **/ + function triggerUpdateReadedCount(&$obj) { + // 로그인 상태일때만 실행 + $logged_info = Context::get('logged_info'); + if(!$logged_info->member_srl) return new Object(); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + + $member_srl = $logged_info->member_srl; + $module_srl = $obj->get('module_srl'); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + // 포인트를 구해옴 + $point = $config->module_point[$obj->get('module_srl')]['read_document']; + if(!isset($point)) $point = $config->read_document; + + // 포인트 증감 + $cur_point += $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + /** * @brief 포인트 설정 **/ diff --git a/modules/point/point.view.php b/modules/point/point.view.php index 6c2aded2d..a30f98c18 100644 --- a/modules/point/point.view.php +++ b/modules/point/point.view.php @@ -41,6 +41,7 @@ $module_config['insert_comment'] = $config->insert_comment; $module_config['upload_file'] = $config->upload_file; $module_config['download_file'] = $config->download_file; + $module_config['read_document'] = $config->read_document; } $module_config['module_srl'] = $current_module_srl; diff --git a/modules/point/tpl/config.html b/modules/point/tpl/config.html index e0cfee35b..4d20afda6 100644 --- a/modules/point/tpl/config.html +++ b/modules/point/tpl/config.html @@ -31,7 +31,7 @@ - {$lang->is_default} + {$lang->is_default} {$lang->point_signup} {$config->point_name} @@ -58,6 +58,10 @@ {$lang->point_download_file} {$config->point_name} + + {$lang->point_read_document} + {$config->point_name} + {$lang->level_icon} diff --git a/modules/point/tpl/module_config.html b/modules/point/tpl/module_config.html index e5d241067..260ec59ab 100644 --- a/modules/point/tpl/module_config.html +++ b/modules/point/tpl/module_config.html @@ -9,17 +9,19 @@ {$lang->point_insert_comment} {$lang->point_upload_file} {$lang->point_download_file} + {$lang->point_read_document} - {$val->browser_title} ({$val->mid}) + {$val->browser_title} ({$val->mid}) - {$config->point_name} - {$config->point_name} - {$config->point_name} - {$config->point_name} + {$config->point_name} + {$config->point_name} + {$config->point_name} + {$config->point_name} + {$config->point_name} diff --git a/modules/point/tpl/point_module_config.html b/modules/point/tpl/point_module_config.html index 151318b7b..4a9c4897f 100644 --- a/modules/point/tpl/point_module_config.html +++ b/modules/point/tpl/point_module_config.html @@ -7,18 +7,26 @@ {$lang->point} {$lang->point_insert_document} - {$lang->point_insert_comment} - {$lang->point_upload_file} - {$lang->point_download_file} + {$module_config['point_name']} - {$module_config['point_name']} + {$lang->point_insert_comment} {$module_config['point_name']} + + + {$lang->point_upload_file} {$module_config['point_name']} + + + {$lang->point_download_file} {$module_config['point_name']} - + {$lang->point_read_document} + {$module_config['point_name']} + + +