From 5ac4836453ae6c15ca5d67562dbcd10167390f42 Mon Sep 17 00:00:00 2001 From: BJRambo Date: Sat, 2 Apr 2016 17:30:50 +0900 Subject: [PATCH] improve the code of the option to operate on the situation. --- modules/ncenterlite/ncenterlite.controller.php | 10 +++++++++- modules/ncenterlite/ncenterlite.model.php | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php index ce9085886..ed0018379 100644 --- a/modules/ncenterlite/ncenterlite.controller.php +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -119,6 +119,10 @@ class ncenterliteController extends ncenterlite $args->target_browser = $module_info->browser_title; $args->notify = $this->_getNotifyId($args); $output = $this->_insertNotify($args, $is_anonymous); + if($output->toBool()) + { + return $output; + } } } @@ -346,6 +350,10 @@ class ncenterliteController extends ncenterlite { $oNcenterliteModel = getModel('ncenterlite'); $config = $oNcenterliteModel->getConfig(); + if(empty($config->use)) + { + return new Object(); + } $args = new stdClass(); $args->srl = $obj->comment_srl; @@ -357,7 +365,7 @@ class ncenterliteController extends ncenterlite { $oNcenterliteModel = getModel('ncenterlite'); $config = $oNcenterliteModel->getConfig(); - if($config->use != 'Y') + if(empty($config->use)) { return new Object(); } diff --git a/modules/ncenterlite/ncenterlite.model.php b/modules/ncenterlite/ncenterlite.model.php index afb37578f..5c1c01c8a 100644 --- a/modules/ncenterlite/ncenterlite.model.php +++ b/modules/ncenterlite/ncenterlite.model.php @@ -11,6 +11,11 @@ class ncenterliteModel extends ncenterlite { $oModuleModel = getModel('module'); $config = $oModuleModel->getModuleConfig('ncenterlite'); + + if(!$config) + { + $config = new stdClass(); + } if(!$config->use) { $config->use = array();