묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
카운터스킨에 총게시물수랑 댓글수를 나타내고 싶습니다.
2012.11.09 00:38
다른 위젯들을 살펴봐도 홈페이지의 전체 글과 댓글을 나타내주는 기능은 없길래요.
어드민 모듈 php 파일 살펴보고 카운터 php에 갖다 붙여봐도
먹히는게 없네요 ㅜㅜ;
고수님들 알려주시면 감사하겠습니다 (__)
자문자답//
/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);