<?php /* Copyright (C) NAVER <http://www.navercorp.com> */ /** * @class counter_status * @author NAVER (developers@xpressengine.com) * @version 0.1 * @brief Display counter status by using data in the counter module */ class counter_status extends WidgetHandler { /** * @brief Widget execution * Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments * After generating the result, do not print but return it. */ function proc($args) { // Get status of the accumulated, yesterday's, today's counts $oCounterModel = getModel('counter'); $site_module_info = Context::get('site_module_info'); $output = $oCounterModel->getStatus(array('00000000', date('Ymd', $_SERVER['REQUEST_TIME']-60*60*24), date('Ymd')), $site_module_info->site_srl); if(count($output)) { foreach($output as $key => $val) { if(!$key) Context::set('total_counter', $val); elseif($key == date("Ymd")) Context::set('today_counter', $val); else Context::set('yesterday_counter', $val); } } // 젠체 글수. 댓글수. 파일수 등 today 출력하려면 아래 코드가 들어가야한다. $args->date = date("Ymd000000", time()-60*60*24); $today = date("Ymd"); // 전체 글수 $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.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); $oMemberModel = &getModel('member'); $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); // Set a path of the template skin (values of skin, colorset settings) $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin); Context::set('colorset', $args->colorset); // Specify a template file $tpl_file = 'counter_status'; // Compile a template $oTemplate = &TemplateHandler::getInstance(); return $oTemplate->compile($tpl_path, $tpl_file); } } /* End of file counter_status.class.php */ /* Location: ./widgets/counter_status/counter_status.class.php */
위화일을 /widgets/counter_status/counter_status.class.php 화일이다
<!--%import("./css/widget.css")--> <div id="myceo_counter"> <center> <span class="visitor">[방문자수]</span> 전체 : {number_format($total_counter->unique_visitor)} | 오늘 : {number_format($today_counter->unique_visitor)} | 어제 : {number_format($yesterday_counter->unique_visitor)} <span class="pageview"> [페이지뷰]</span> 전체 : {number_format($total_counter->pageview)} | 오늘 : {number_format($today_counter->pageview)} | 어제 : {number_format($yesterday_counter->pageview)} <span class="user_info"> [정보]</span> 회원 : {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)}) <span class="user_info"> [첨부파일]</span> {number_format($status->file->total)} (+{number_format($status->file->today)}) </center> </div>
위 화일은 widgets/counter_status/skins/myceo_counter/counter_status.html 이다
첨부화일을 압축을 풀어 widgets/counter_status/skins/에 myceo_counter 홀러를 생성하고 풀어 넣으면 된다
EXIF Viewer사진 크기939x64
TAG •
첨부 '2' |
---|