diff --git a/classes/db/DB.class.php b/classes/db/DB.class.php index f1fb14b50..109c335f9 100644 --- a/classes/db/DB.class.php +++ b/classes/db/DB.class.php @@ -293,7 +293,9 @@ case 'like' : $value = '%'.$value.'%'; break; - + case 'in' : + return "'".$value."'"; + break; } return "'".$this->addQuotes($value)."'"; diff --git a/classes/plugin/PluginHandler.class.php b/classes/plugin/PluginHandler.class.php index 90371f3c0..891b267da 100644 --- a/classes/plugin/PluginHandler.class.php +++ b/classes/plugin/PluginHandler.class.php @@ -34,26 +34,30 @@ * @brief 플러그인 객체를 return **/ function getObject($plugin) { - // 일단 플러그인의 위치를 찾음 - $oPluginModel = &getModel('plugin'); - $path = $oPluginModel->getPluginPath($plugin); + if(!$GLOBALS['_xe_loaded_plugins_'][$plugin]) { + // 일단 플러그인의 위치를 찾음 + $oPluginModel = &getModel('plugin'); + $path = $oPluginModel->getPluginPath($plugin); - // 플러그인 클래스 파일을 찾고 없으면 에러 출력 (html output) - $class_file = sprintf('%s%s.class.php', $path, $plugin); - if(!file_exists($class_file)) return sprintf(Context::getLang('msg_plugin_is_not_exists'), $plugin); + // 플러그인 클래스 파일을 찾고 없으면 에러 출력 (html output) + $class_file = sprintf('%s%s.class.php', $path, $plugin); + if(!file_exists($class_file)) return sprintf(Context::getLang('msg_plugin_is_not_exists'), $plugin); - // 플러그인 클래스를 include - require_once($class_file); + // 플러그인 클래스를 include + require_once($class_file); - // 객체 생성 - $eval_str = sprintf('$oPlugin = new %s();', $plugin); - @eval($eval_str); - if(!is_object($oPlugin)) return sprintf(Context::getLang('msg_plugin_object_is_null'), $plugin); - if(!method_exists($oPlugin, 'proc')) return sprintf(Context::getLang('msg_plugin_proc_is_null'), $plugin); + // 객체 생성 + $eval_str = sprintf('$oPlugin = new %s();', $plugin); + @eval($eval_str); + if(!is_object($oPlugin)) return sprintf(Context::getLang('msg_plugin_object_is_null'), $plugin); - $oPlugin->plugin_path = $path; + if(!method_exists($oPlugin, 'proc')) return sprintf(Context::getLang('msg_plugin_proc_is_null'), $plugin); - return $oPlugin; + $oPlugin->plugin_path = $path; + + $GLOBALS['_xe_loaded_plugins_'][$plugin] = $oPlugin; + } + return $GLOBALS['_xe_loaded_plugins_'][$plugin]; } } diff --git a/layouts/sample_blog/layout.html b/layouts/sample_blog/layout.html index ddf5ca2b1..4954df09a 100644 --- a/layouts/sample_blog/layout.html +++ b/layouts/sample_blog/layout.html @@ -39,6 +39,9 @@ + + + diff --git a/modules/counter/counter.class.php b/modules/counter/counter.class.php index 777b04dd9..ae2049bde 100644 --- a/modules/counter/counter.class.php +++ b/modules/counter/counter.class.php @@ -17,8 +17,8 @@ $oCounterController = &getController('counter'); - // 00000000000000 일자로 기록될 전체 방문 기록 row 추가 - $oCounterController->insertTodayStatus('00000000000000'); + // 00000000 일자로 기록될 전체 방문 기록 row 추가 + $oCounterController->insertTodayStatus('000000'); // 오늘자 row입력 $oCounterController->insertTodayStatus(); diff --git a/modules/counter/counter.controller.php b/modules/counter/counter.controller.php index 727f85417..374c876e5 100644 --- a/modules/counter/counter.controller.php +++ b/modules/counter/counter.controller.php @@ -54,16 +54,18 @@ * @brief unique visitor 등록 **/ function insertUniqueVisitor() { - $args->regdate = date("Ymd000000"); - return executeQuery('counter.updateCounterUnique', $args); + $args->regdate = date("Ymd"); + executeQuery('counter.updateCounterUnique', $args); + executeQuery('counter.updateTotalCounterUnique'); } /** * @brief pageview 등록 **/ function insertPageView() { - $args->regdate = date("Ymd000000"); - return executeQuery('counter.updateCounterPageview', $args); + $args->regdate = date("Ymd"); + executeQuery('counter.updateCounterPageview', $args); + executeQuery('counter.updateTotalCounterPageview'); } /** @@ -71,7 +73,7 @@ **/ function insertTodayStatus($regdate = 0) { if($regdate) $args->regdate = $regdate; - else $args->regdate = date("Ymd000000"); + else $args->regdate = date("Ymd"); executeQuery('counter.insertTodayStatus', $args); // 로그 등록 diff --git a/modules/counter/counter.model.php b/modules/counter/counter.model.php index 60b7e9fee..29bce40da 100644 --- a/modules/counter/counter.model.php +++ b/modules/counter/counter.model.php @@ -26,7 +26,7 @@ * @brief 오늘자 카운터 현황 row 있는지 체크 **/ function isInsertedTodayStatus() { - $args->regdate = date("Ymd000000"); + $args->regdate = date("Ymd"); $output = executeQuery('counter.getTodayStatus', $args); return $output->data->count?true:false; } @@ -38,18 +38,26 @@ // 여러개의 날자 로그를 가져올 경우 if(is_array($regdate)) { $date_count = count($regdate); - for($i=0;$i<$date_count;$i++) { - if(strlen($regdate[$i])==8) $regdate[$i] = $regdate[$i].'000000'; - $args->regdate = "'".implode("','",$regdate)."'"; - } + $args->regdate = implode(',',$regdate); + // 단일 날자의 로그를 가져올 경우 } else { - if(strlen($regdate)==8) $regdate = $regdate.'000000'; + if(strlen($regdate)==8) $regdate = $regdate; $args->regdate = $regdate; } $output = executeQuery('counter.getCounterStatus', $args); - return $output->data; + $status = $output->data; + + if(!is_array($regdate)) return $status; + + if(!is_array($status)) $status = array($status); + unset($output); + + foreach($status as $key => $val) { + $output[substr($val->regdate,0,8)] = $val; + } + return $output; } } diff --git a/modules/counter/queries/updateCounterPageview.xml b/modules/counter/queries/updateCounterPageview.xml index 2153cd197..d4ec933b4 100644 --- a/modules/counter/queries/updateCounterPageview.xml +++ b/modules/counter/queries/updateCounterPageview.xml @@ -6,7 +6,6 @@ - - + diff --git a/modules/counter/queries/updateCounterUnique.xml b/modules/counter/queries/updateCounterUnique.xml index c4b614c87..2cdfe6048 100644 --- a/modules/counter/queries/updateCounterUnique.xml +++ b/modules/counter/queries/updateCounterUnique.xml @@ -7,7 +7,6 @@ - - + diff --git a/modules/counter/queries/updateTotalCounterPageview.xml b/modules/counter/queries/updateTotalCounterPageview.xml new file mode 100644 index 000000000..ed4732972 --- /dev/null +++ b/modules/counter/queries/updateTotalCounterPageview.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/modules/counter/queries/updateTotalCounterUnique.xml b/modules/counter/queries/updateTotalCounterUnique.xml new file mode 100644 index 000000000..5c4e99d7d --- /dev/null +++ b/modules/counter/queries/updateTotalCounterUnique.xml @@ -0,0 +1,12 @@ + + +
+ + + + + + + + + diff --git a/modules/counter/schemas/counter_status.xml b/modules/counter/schemas/counter_status.xml index 627e82a1f..a9cf7dbb7 100644 --- a/modules/counter/schemas/counter_status.xml +++ b/modules/counter/schemas/counter_status.xml @@ -1,5 +1,5 @@
- +
diff --git a/plugins/counter_status/counter_status.class.php b/plugins/counter_status/counter_status.class.php index 73856d12d..b1148cd60 100644 --- a/plugins/counter_status/counter_status.class.php +++ b/plugins/counter_status/counter_status.class.php @@ -14,6 +14,16 @@ * 결과를 만든후 print가 아니라 return 해주어야 한다 **/ function proc($args) { + // 전체, 어제, 오늘 접속 현황을 가져옴 + $oCounterModel = &getModel('counter'); + + $output = $oCounterModel->getStatus(array('00000000', date('Ymd', time()-60*60*24), date('Ymd'))); + foreach($output as $key => $val) { + if(!$key) Context::set('total_counter', $val); + elseif($key == date("Ymd")) Context::set('today_counter', $val); + else Context::set('yesterday_counter', $val); + } + // 변수 설정 Context::set('style', $args->style); @@ -28,7 +38,5 @@ $oTemplate = new TemplateHandler(); return $oTemplate->compile($tpl_path, $tpl_file); } - - } ?> diff --git a/plugins/counter_status/skins/default/counter_status.html b/plugins/counter_status/skins/default/counter_status.html index 0c8926854..12f75c441 100644 --- a/plugins/counter_status/skins/default/counter_status.html +++ b/plugins/counter_status/skins/default/counter_status.html @@ -1,83 +1,22 @@ - - + - - - - diff --git a/plugins/counter_status/skins/default/normal/document_bullet.gif b/plugins/counter_status/skins/default/normal/document_bullet.gif deleted file mode 100644 index c29051c5d..000000000 Binary files a/plugins/counter_status/skins/default/normal/document_bullet.gif and /dev/null differ diff --git a/plugins/counter_status/skins/default/normal/style.css b/plugins/counter_status/skins/default/normal/style.css index 07072513e..46dd238f5 100644 --- a/plugins/counter_status/skins/default/normal/style.css +++ b/plugins/counter_status/skins/default/normal/style.css @@ -1,151 +1,19 @@ -.login_plugin { +.counter_plugin { border:3px solid #DDDDDD; padding:6px; - height:80px; margin-bottom:10px; + color:#999999; + font-family:tahoma; + font-size:8pt; } -.login_plugin .top_box { - height:22px; - border-bottom:2px dotted #DDDDDD; - overflow:hidden; - margin-bottom:5px; -} - -.login_plugin .top_box .nick_name { +.counter_plugin .header { font-weight:bold; float:left; - color:#555555; + width:50px; + margin-right:10px; } -.login_plugin .top_box .logout { - float:right; -} - -.login_plugin .top_box .logout A { - text-decoration:none; - color:#737CF5; -} - -.login_plugin .top_box .logout A:hover { - font-weight:bold; - letter-spacing:-1px; - color:#151F9E; -} - - -.login_plugin .info_box { - clear:both; - color:#555555; -} - -.login_plugin .info_box A:link { - text-decoration:none; - color:#555555; -} - -.login_plugin .info_box A:visited { - text-decoration:none; - color:#555555; -} - -.login_plugin .info_box A:hover { - text-decoration:none; - font-weight:bold; - letter-spacing:-1px; - color:#555555; -} - -.login_plugin .info_box div { - padding-left:15px; - margin:0px 0px 4px 0px; -} - -.login_plugin .info_box .member_info { - background:url("../images/icon_profile.gif") no-repeat left; - float:left; - width:90px; -} - -.login_plugin .info_box .friend_list { - background:url("../images/icon_friend_list.gif") no-repeat left; - float:left; -} - -.login_plugin .info_box .message_box { - background:url("../images/icon_message_box.gif") no-repeat left; - float:left; - width:90px; -} - -.login_plugin .info_box .link_admin { - background:url("../images/icon_key.gif") no-repeat left; - float:left; -} - -.login_plugin .info_box .link_admin A { - color:#cd0000; -} - -.login_plugin .info_box .last_login { - clear:left; - background:url("../images/icon_last_login.gif") no-repeat left; - padding-left:15px; - margin-bottom:4px; -} - - -.login_plugin .login_box { - height:40px; -} - -.login_plugin .header { - float:left; - clear:left; - width:80px; - margin-bottom:5px; - font-weight:bold; - color:#555555; -} - -.login_plugin .body { - float:left; - width:100px; - margin-bottom:5px; -} - -.login_plugin .body .input { - width:90px; - height:13px; - border:1px solid #AAAAAA; - color:#555555; -} - -.login_plugin .body label { - cursor:pointer; -} - -.login_plugin .button_area { - clear:both; - height:20px; - margin-top:5px; - text-align:center; -} - -.login_plugin .button_area .submit_button { - width:80px; - height:18px; - border:1px solid #AAAAAA; - background-color:#555555; - color:#FFFFFF; - font-weight:bold; -} - -.login_plugin .button_area .signup_button { - width:80px; - height:18px; - border:1px solid #555555; - background-color:#FFFFFF; - color:#000000; - font-weight:bold; +.counter_plugin .footer { + clear:right; } diff --git a/plugins/counter_status/skins/default/normal/title_bullet.gif b/plugins/counter_status/skins/default/normal/title_bullet.gif deleted file mode 100644 index 12ed834cc..000000000 Binary files a/plugins/counter_status/skins/default/normal/title_bullet.gif and /dev/null differ