mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
삭제
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
commit
8326004cb2
2773 changed files with 91485 additions and 0 deletions
100
modules/counter/counter.controller.php
Normal file
100
modules/counter/counter.controller.php
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
/**
|
||||
* @class counterController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief counter 모듈의 controller class
|
||||
**/
|
||||
|
||||
class counterController extends counter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카운터 기록
|
||||
**/
|
||||
function procCounterExecute() {
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 로그를 검사
|
||||
$oCounterModel = &getModel('counter');
|
||||
|
||||
// 오늘자 row가 있는지 체크하여 없으면 등록
|
||||
if(!$oCounterModel->isInsertedTodayStatus()) {
|
||||
$this->insertTodayStatus();
|
||||
|
||||
// 기존 row가 있으면 사용자 체크
|
||||
} else {
|
||||
|
||||
// 등록되어 있지 않은 아이피일 경우
|
||||
if(!$oCounterModel->isLogged()) {
|
||||
// 로그 등록
|
||||
$this->insertLog();
|
||||
|
||||
// unique 및 pageview 등록
|
||||
$this->insertUniqueVisitor();
|
||||
} else {
|
||||
// pageview 등록
|
||||
$this->insertPageView();
|
||||
}
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 로그 등록
|
||||
**/
|
||||
function insertLog() {
|
||||
$args->regdate = date("YmdHis");
|
||||
$args->user_agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
return executeQuery('counter.insertCounterLog', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief unique visitor 등록
|
||||
**/
|
||||
function insertUniqueVisitor() {
|
||||
$args->regdate = date("Ymd");
|
||||
executeQuery('counter.updateCounterUnique', $args);
|
||||
executeQuery('counter.updateTotalCounterUnique');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief pageview 등록
|
||||
**/
|
||||
function insertPageView() {
|
||||
$args->regdate = date("Ymd");
|
||||
executeQuery('counter.updateCounterPageview', $args);
|
||||
executeQuery('counter.updateTotalCounterPageview');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 전체 카운터 status 추가
|
||||
**/
|
||||
function insertTotalStatus() {
|
||||
$args->regdate = 0;
|
||||
executeQuery('counter.insertTodayStatus', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 오늘자 카운터 status 추가
|
||||
**/
|
||||
function insertTodayStatus($regdate = 0) {
|
||||
if($regdate) $args->regdate = $regdate;
|
||||
else $args->regdate = date("Ymd");
|
||||
executeQuery('counter.insertTodayStatus', $args);
|
||||
|
||||
// 로그 등록
|
||||
$this->insertLog();
|
||||
|
||||
// unique 및 pageview 등록
|
||||
$this->insertUniqueVisitor();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue