mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 09:32:15 +09:00
english comments added
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0_english@8278 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
693e215bc1
commit
4d272994dd
219 changed files with 6407 additions and 8705 deletions
|
|
@ -2,38 +2,35 @@
|
|||
/**
|
||||
* @class counterAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief counter 모듈의 Admin view class
|
||||
* @brief Admin view class of counter module
|
||||
**/
|
||||
|
||||
class counterAdminView extends counter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
// 템플릿 경로 지정
|
||||
// set the template path
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지 초기화면
|
||||
* @brief Admin page
|
||||
**/
|
||||
function dispCounterAdminIndex() {
|
||||
// 정해진 일자가 없으면 오늘자로 설정
|
||||
// set today's if no date is given
|
||||
$selected_date = Context::get('selected_date');
|
||||
if(!$selected_date) $selected_date = date("Ymd");
|
||||
Context::set('selected_date', $selected_date);
|
||||
|
||||
// counter model 객체 생성
|
||||
// create the counter model object
|
||||
$oCounterModel = &getModel('counter');
|
||||
|
||||
// 전체 카운터 및 지정된 일자의 현황 가져오기
|
||||
// get a total count and daily count
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$status = $oCounterModel->getStatus(array(0,$selected_date),$site_module_info->site_srl);
|
||||
Context::set('total_counter', $status[0]);
|
||||
Context::set('selected_day_counter', $status[$selected_date]);
|
||||
|
||||
// 시간, 일, 월, 년도별로 데이터 가져오기
|
||||
// get data by time, day, month, and year
|
||||
$type = Context::get('type');
|
||||
if(!$type) {
|
||||
$type = 'day';
|
||||
|
|
@ -42,7 +39,7 @@
|
|||
$detail_status = $oCounterModel->getHourlyStatus($type, $selected_date, $site_module_info->site_srl);
|
||||
Context::set('detail_status', $detail_status);
|
||||
|
||||
// 표시
|
||||
// display
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,31 +2,29 @@
|
|||
/**
|
||||
* @class counter
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief counter 모듈의 high class
|
||||
* @brief high class of counter module
|
||||
**/
|
||||
|
||||
class counter extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
**/
|
||||
function moduleInstall() {
|
||||
$oCounterController = &getController('counter');
|
||||
|
||||
// 0 일자로 기록될 전체 방문 기록 row 추가
|
||||
// add a row for the total visit history
|
||||
//$oCounterController->insertTotalStatus();
|
||||
|
||||
// 오늘자 row입력
|
||||
// add a row for today's status
|
||||
//$oCounterController->insertTodayStatus();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
* @brief method if successfully installed
|
||||
**/
|
||||
function checkUpdate() {
|
||||
// 카운터에 site_srl추가
|
||||
// Add site_srl to the counter
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists('counter_log', 'site_srl')) return true;
|
||||
if(!$oDB->isIndexExists('counter_log','idx_site_counter_log')) return true;
|
||||
|
|
@ -35,10 +33,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
* @brief Update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
// 카운터에 site_srl추가
|
||||
// Add site_srl to the counter
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists('counter_log', 'site_srl')) $oDB->addColumn('counter_log','site_srl','number',11,0,true);
|
||||
if(!$oDB->isIndexExists('counter_log','idx_site_counter_log')) $oDB->addIndex('counter_log','idx_site_counter_log',array('site_srl','ipaddress'),false);
|
||||
|
|
@ -47,7 +45,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 캐시 파일 재생성
|
||||
* @brief re-generate the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
/**
|
||||
* @class counterController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief counter 모듈의 controller class
|
||||
* @brief counter module's controller class
|
||||
**/
|
||||
|
||||
class counterController extends counter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카운터 기록
|
||||
* @brief Counter logs
|
||||
**/
|
||||
function procCounterExecute() {
|
||||
$oDB = &DB::getInstance();
|
||||
|
|
@ -22,26 +22,21 @@
|
|||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
|
||||
// 로그를 검사
|
||||
// Check the logs
|
||||
$oCounterModel = &getModel('counter');
|
||||
|
||||
// 오늘자 row가 있는지 체크하여 없으면 등록
|
||||
// Register today's row if not exist
|
||||
if(!$oCounterModel->isInsertedTodayStatus($site_srl)) {
|
||||
$this->insertTodayStatus(0,$site_srl);
|
||||
|
||||
// 기존 row가 있으면 사용자 체크
|
||||
// check user if the previous row exists
|
||||
} else {
|
||||
|
||||
// 등록되어 있지 않은 아이피일 경우
|
||||
// If unregistered IP
|
||||
if(!$oCounterModel->isLogged($site_srl)) {
|
||||
// 로그 등록
|
||||
// Leave logs
|
||||
$this->insertLog($site_srl);
|
||||
|
||||
// unique 및 pageview 등록
|
||||
// Register unique and pageview
|
||||
$this->insertUniqueVisitor($site_srl);
|
||||
} else {
|
||||
// pageview 등록
|
||||
// Register pageview
|
||||
$this->insertPageView($site_srl);
|
||||
}
|
||||
}
|
||||
|
|
@ -50,7 +45,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 로그 등록
|
||||
* @brief Leave logs
|
||||
**/
|
||||
function insertLog($site_srl=0) {
|
||||
$args->regdate = date("YmdHis");
|
||||
|
|
@ -60,7 +55,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief unique visitor 등록
|
||||
* @brief Register the unique visitor
|
||||
**/
|
||||
function insertUniqueVisitor($site_srl=0) {
|
||||
if($site_srl) {
|
||||
|
|
@ -78,7 +73,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief pageview 등록
|
||||
* @brief Register pageview
|
||||
**/
|
||||
function insertPageView($site_srl=0) {
|
||||
if($site_srl) {
|
||||
|
|
@ -96,7 +91,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 전체 카운터 status 추가
|
||||
* @brief Add the total counter status
|
||||
**/
|
||||
function insertTotalStatus($site_srl=0) {
|
||||
$args->regdate = 0;
|
||||
|
|
@ -109,7 +104,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 오늘자 카운터 status 추가
|
||||
* @brief Add today's counter status
|
||||
**/
|
||||
function insertTodayStatus($regdate = 0, $site_srl=0) {
|
||||
if($regdate) $args->regdate = $regdate;
|
||||
|
|
@ -118,23 +113,21 @@
|
|||
$args->site_srl = $site_srl;
|
||||
$query_id = 'counter.insertSiteTodayStatus';
|
||||
|
||||
$u_args->site_srl = $site_srl; ///< 일별 row입력시 전체 row (regdate=0)도 같이 입력 시도
|
||||
$u_args->site_srl = $site_srl; // /< when inserting a daily row, attempt to inser total rows(where regdate=0) together
|
||||
executeQuery($query_id, $u_args);
|
||||
} else {
|
||||
$query_id = 'counter.insertTodayStatus';
|
||||
executeQuery($query_id); ///< 일별 row입력시 전체 row (regdate=0)도 같이 입력 시도
|
||||
executeQuery($query_id); // /< when inserting a daily row, attempt to inser total rows(where regdate=0) together
|
||||
}
|
||||
$output = executeQuery($query_id, $args);
|
||||
|
||||
// 로그 등록
|
||||
// Leave logs
|
||||
$this->insertLog($site_srl);
|
||||
|
||||
// unique 및 pageview 등록
|
||||
// Register unique and pageview
|
||||
$this->insertUniqueVisitor($site_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 가상 사이트의 카운터 로그 삭제
|
||||
* @brief Delete counter logs of the specific virtual site
|
||||
**/
|
||||
function deleteSiteCounterLogs($site_srl) {
|
||||
$args->site_srl = $site_srl;
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
/**
|
||||
* @class counterModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief counter 모듈의 Model class
|
||||
* @brief Model class of counter module
|
||||
**/
|
||||
|
||||
class counterModel extends counter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 로그 검사
|
||||
* @brief Verify logs
|
||||
**/
|
||||
function isLogged($site_srl=0) {
|
||||
$args->regdate = date("Ymd");
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 오늘자 카운터 현황 row 있는지 체크
|
||||
* @brief Check if a row of today's counter status exists
|
||||
**/
|
||||
function isInsertedTodayStatus($site_srl=0) {
|
||||
$args->regdate = date("Ymd");
|
||||
|
|
@ -39,15 +39,14 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 일의 접속 통계를 가져옴
|
||||
* @brief Get access statistics for a given date
|
||||
**/
|
||||
function getStatus($selected_date, $site_srl=0) {
|
||||
// 여러개의 날짜 로그를 가져올 경우
|
||||
// If more than one date logs are selected
|
||||
if(is_array($selected_date)) {
|
||||
$date_count = count($selected_date);
|
||||
$args->regdate = implode(',',$selected_date);
|
||||
|
||||
// 단일 날짜의 로그를 가져올 경우
|
||||
// If a single date log is selected
|
||||
} else {
|
||||
if(strlen($selected_date)==8) $selected_date = $selected_date;
|
||||
$args->regdate = $selected_date;
|
||||
|
|
@ -73,14 +72,14 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 지정된 일자의 시간대별 로그 가져오기
|
||||
* @brief Select hourly logs of a given date
|
||||
**/
|
||||
function getHourlyStatus($type='hour', $selected_date, $site_srl=0) {
|
||||
$max = 0;
|
||||
$sum = 0;
|
||||
switch($type) {
|
||||
case 'year' :
|
||||
// 카운터 시작일 구함
|
||||
// Get a date to start counting
|
||||
if($site_srl) {
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('counter.getSiteStartLogDate', $args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue