/widgets/counter_status/counter_status.class.php
// 가입한 회원수 출력
$oMemberModel = &getModel('member');
$args->date = date("Ymd000000", time()-60*60*24);
$today = date("Ymd");
$output = executeQueryArray("admin.getMemberStatus", $args);
if($output->data) {
foreach($output->data as $var) {
if($var->date == $today) {
$status->member->today = $var->count;
} else {
$status->member->yesterday = $var->count;
}
}
}
$output = executeQuery("admin.getMemberCount", $args);
$status->member->total = $output->data->count;
Context::set('start_module', $output->data);
Context::set('status', $status);
// 전체글수
$output = executeQueryArray("admin.getDocumentStatus", $args);
if($output->data) {
foreach($output->data as $var) {
if($var->date == $today) {
$status->document->today = $var->count;
} else {
$status->document->yesterday = $var->count;
}
}
}
$output = executeQuery("admin.getDocumentCount", $args);
$status->document->total = $output->data->count;
Context::set('start_module', $output->data);
Context::set('status', $status);
// 전체 댓글수
$output = executeQueryArray("admin.getCommentStatus", $args);
if($output->data) {
foreach($output->data as $var) {
if($var->date == $today) {
$status->comment->today = $var->count;
} else {
$status->comment->yesterday = $var->count;
}
}
}
$output = executeQuery("admin.getCommentCount", $args);
$status->comment->total = $output->data->count;
Context::set('start_module', $output->data);
Context::set('status', $status);
// 엮인글수
$output = executeQueryArray("admin.getTrackbackStatus", $args);
if($output->data) {
foreach($output->data as $var) {
if($var->date == $today) {
$status->trackback->today = $var->count;
} else {
$status->trackback->yesterday = $var->count;
}
}
}
$output = executeQuery("admin.getTrackbackCount", $args);
$status->trackback->total = $output->data->count;
Context::set('start_module', $output->data);
Context::set('status', $status);
// 첨부파일수
$output = executeQueryArray("admin.getFileStatus", $args);
if($output->data) {
foreach($output->data as $var) {
if($var->date == $today) {
$status->file->today = $var->count;
} else {
$status->file->yesterday = $var->count;
}
}
}
$output = executeQuery("admin.getFileCount", $args);
$status->file->total = $output->data->count;
Context::set('start_module', $output->data);
Context::set('status', $status);
회원 : {number_format($status->member->total)}
신규회원 : {number_format($status->member->today)}
문서 : {number_format($status->document->total)}
신규문서 : {number_format($status->document->today)}
댓글 : {number_format($status->comment->total)}
신규댓글 : {number_format($status->comment->today)}
엮인글 : {number_format($status->trackback->total)}
신규엮인글 : {number_format($status->trackback->today)}
첨부파일 : {number_format($status->file->total)}
신규첨부파일 : {number_format($status->file->today)}
yesterday를 통해 어제 내용도 출력 가능.