묻고답하기
레이아웃에 사이트현황 출력하기 추가질문 입니다.
2012.12.08 17:06
송동우님께서 답변을 해주셔서 카운터 위젯 스킨에 적용하여 레이아웃에 출력을 해 주었습니다.
그런데 추가로 답변해주신 투데이 증가현황을 괄호안에 표시해 주는 것이 목표였거든요.
근데 제가 지식이 없다보니 말씀해주신 부분을 보아도 어떻게 수정을 해야할지 알 수가 없어 추가 질문 드립니다.
{@
$oCounterModel = &getModel('counter');
$site_module_info = Context::get('site_module_info');
$output = $oCounterModel->getStatus(array('00000000', date('Ymd',time()-60*60*24), date('Ymd')), $site_module_info->site_srl);
}
<!--@foreach($output as $key => $val)-->
<!--@if(!$key)-->
{@$total_counter = $val}
<!--@elseif($key == date("Ymd"))-->
{@$today_counter = $val}
<!--@else-->
{@$yesterday_counter = $val}
<!--@end-->
<!--@end-->
{$lang->total} : {number_format($total_counter->unique_visitor)}<br />
{$lang->today} : {number_format($today_counter->unique_visitor)}<br />
{$lang->yesterday} : {number_format($yesterday_counter->unique_visitor)}<br />
{@ $output = executeQuery('admin.getDocumentCount', $args)}
{$lang->document} : {number_format($output->data->count)}<br />
{@ $output = executeQuery('admin.getCommentCount', $args)}
{$lang->comment} : {number_format($output->data->count)}<br />
{@ $output = executeQuery('admin.getFileCount', $args)}
{$lang->file} : {number_format($output->data->count)}<br />
{@ $output = executeQuery('admin.getMemberCount', $args)}
{$lang->member} : {number_format($output->data->count)}<br />
만일 관리페이지처럼 괄호속에 오늘 올라온 갯수처럼 출력하고 싶다면
xe - modules - admin - admin.admin.view.php 열고
line 217 쯤에
function dispAdminIndex()
이 부분을 참고해보세요.....
밑줄 쳐진 부분을 적용하고 싶은데 어떻게 해야 할지 잘 모르겠어요...
현재는 송동우님 답변대로 위젯 스킨을 수정을 해서 아래와 같이 만들었답니다.
<div class="widgetContainer<!--@if($colorset=="black")--> black<!--@end-->">
<dl class="widgetCounter">
<dt>{$lang->today} :</dt>
<dd class="today">{number_format($today_counter->unique_visitor)}</dd>
<dt>{$lang->yesterday} :</dt>
<dd>{number_format($yesterday_counter->unique_visitor)}</dd>
<dt>{$lang->total} :</dt>
<dd>{number_format($total_counter->unique_visitor)}</dd>
<dt>{$lang->member} :</dt>
<dd>{@ $output = executeQuery('admin.getMemberCount', $args)}
{number_format($output->data->count)}</dd>
<dt>{$lang->document} :</dt>
<dd>{@ $output = executeQuery('admin.getDocumentCount', $args)}
{number_format($output->data->count)}</dd>
<dt>{$lang->comment} :</dt>
<dd>{@ $output = executeQuery('admin.getCommentCount', $args)}
{number_format($output->data->count)}</dd>
</dl>
</div>
$today = date("Ymd");
$oMemberAdminModel = &getAdminModel('member');
$status->member->todayCount = $oMemberAdminModel->getMemberCountByDate($today);
$status->member->totalCount = $oMemberAdminModel->getMemberCountByDate();
}
{$lang->member} : {$status->member->totalCount}({$status->member->todayCount})<br />
{@
$oDocumentAdminModel = &getAdminModel('document');
$statusList = array('PUBLIC', 'SECRET');
$status->document->todayCount = $oDocumentAdminModel->getDocumentCountByDate($today, array(), $statusList);
$status->document->totalCount = $oDocumentAdminModel->getDocumentCountByDate('', array(), $statusList);
}
{$lang->document} : {$status->document->totalCount}({$status->document->todayCount})<br />
{@
$oCommentModel = &getModel('comment');
$status->comment->todayCount = $oCommentModel->getCommentCountByDate($today);
$status->comment->totalCount = $oCommentModel->getCommentCountByDate();
}
{$lang->comment} : {$status->comment->totalCount}({$status->comment->todayCount}}<br />
{@
$oFileAdminModel = &getAdminModel('file');
$status->file->todayCount = $oFileAdminModel->getFilesCountByDate($today);
$status->file->totalCount = $oFileAdminModel->getFilesCountByDate();
}
{$lang->file} : {$status->file->totalCount}({$status->file->todayCount})