You cannot see this page without javascript.

Skip to content

Home

조회 수 286 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
<?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 홀러를 생성하고 풀어 넣으면 된다

2015-01-07 20;11;55.jpg EXIF Viewer사진 크기939x64





(안심) 짧은 주소는 : 입니다
?

List of Articles
번호 제목 날짜 조회 수
27 카운터스킨에 총게시물수랑 댓글수 알아내기 /widgets/counter_status/counter_status.class.php // 가입한 회원수 출력 $oMemberModel = &amp;getModel(&#39;member&#39;); $args-&gt;date = date(&quot;Ymd000000&quot;,... 2017.03.07 309
26 글쓰기&읽기 권한 없을때 로그인창으로 강제 이동법 modules/board/board_view.php 파일에서 function alertMessage($message) //이 함수를 변경하면 된다. function alertMessage($message) { if($message==&quot;msg_no... 2015.12.18 5229
25 글쓰기 할때 자동으로 테그값을 글제목의 단어를 공간체크 하여 태그 입력되게 function triggerArrangeTag(&amp;$obj) // &lt;-- 요부분 밑에 { // if(!$obj-&gt;tags) return new Object(); 이부분을 주석처리 if(!$obj-&gt;tags &amp;&amp; $obj-&gt;t... 2015.12.18 614
24 게시물에 링크(Link) 있을때 새창으로 보여 주기 jQuery(function(){ jQuery('.xe_content[class^=document_] a').attr('target', '_blank'); }); jQuery(function(){ jQuery('.xe_content[class^=comment_] a').... 2015.04.16 509
23 NaverWorks 도메인 메일 사용시 XE에서 인증메일 보내는 방법 classes/mail/Mail.class.php 화일에서 fonction mail(){ $this-&gt;useNaverAccount(&quot;아이디@등록한도메인&quot;, &quot;*비밀번호); // 이 한줄만 추가하면 됩니다.Myceo... ... 2015.04.09 845
22 setitle2.addon.php에서 category 명 같이 나오게... title바꾸기 /addons/setitle2/setitle2.addon.php 화일을 수정한다 $pointconfig = $module-&gt;getModuleConfig('point'); //각종 정보 담아오기 //아래는 수정 추가 한것이다.... 2015.04.07 1061
21 atom10.html 변경하여 게시판이름-게시물-기본타이틀명 나오게 {'&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;'} &lt;feed xmlns=&quot;http://webmastertool.naver.com&quot;&gt; &lt;id&gt;{$info-&gt;link}&lt;/id&gt; &lt;title&gt;{$info-&gt;title}&lt;/title&gt; &lt;author&gt;... 2015.04.03 691
20 네이버 신디케이션 사용자 가이드 NAVER Syndication User Guide `` `` 2 저작권 Copyright © NAVER Corp. All Rights Reserved. 이 문서는 네이버(주)의 지적 재산이므로 어떠한 경우에도 네이버(주)의 공식적인 허가 없이 이 ... 1 2015.04.01 1728
19 신디케이션 ver 4.0을 사용시에 타이틀이 제대로 나오지 않을경우 modules/syndication/syndication.model.php 여기 화일중에.. case 'site' : $site_info = new stdClass; $site_info-&gt;id = $this-&gt;getID('site'); $site_info-&gt;s... 1 2015.03.28 497
18 [XE]Layouts 모듈이 Layout 을 파싱하는 시점에 전달해 주는 변수 및 데이터 덤프 Array ( [buff] =&gt; file://./files/cache/template_compiled/99b4a68c4de6bdf7b15cc072553a8c7c.compiled.php [__Context] =&gt; stdClass Object ( [lang] =&gt; stdC... 2015.02.14 106179
17 카카오 API 로그인 연동하여 토큰 받아오기 https://www.xpressengine.com/index.php?mid=download&amp;package_id=22753522 LginXE Server ver 1.02를 이용하여 하였다 해당 화일은 loginxeserver.view.php... 2015.02.14 1824
16 logged_info 정보 $logged_info-&gt;member_srl : 회원의 고유 번호. 중복 X $logged_info-&gt;user_id : 아이디 $logged_info-&gt;email_address : 메일 주소 $logged_info-&gt;passwrod : 비... 2015.02.12 342
15 XE에서 태그값이 없으면 제목의 공간을 이용해 자동 태그값 넣기 /modules/tag/tag.controller.php 중에서 function triggerArrangeTag(&amp;$obj) { // if(!$obj-&gt;tags) return new Object(); 2015-02-10(화)_myceo 이부분을 ... 2015.02.11 432
14 XE $module_info 변수 추출 결과 레이아웃에서 아래와 같이 해서 뽑아온 변수 정보 {print_r($module_info)} 대충 각 모듈별로 레이아웃을 구성할 때는 아래의 module 정보를 빼내오는 것이 가장 ... 2015.01.28 822
13 "이 페이지 나가기" 경고창이 뜨는 사이트의 경우 common / js / jquery.min.js 파일을 열어서 global:!0 을 찾은 후(두 군데) global:!1 로 바꿔줍니다. 보통의 경우엔 바꿔주지 않아도 뜨지 않는 경고창이지만 ... 2015.01.15 6415
12 인증메일이 발송 되지 않을때 /classes/mail/Mail.class.php 에서 약 140번째 라인에 보면 function Mail() { } 여기 부분을 function Mail() { $this-&gt;useGmailAccount(&quot;구글아이디@gmail.com... 2015.01.13 482
» 다양한 카운터 위젯 그림및 소스 참조 &lt;?php /* Copyright (C) NAVER &lt;http://www.navercorp.com&gt; */ /** * @class counter_status * @author NAVER (developers@xpressengine.com) * @version 0.1 * @... file 2015.01.07 286
10 각종 API 적용(밴드,카카오톡,카카오스토리,마이피플) &lt;?php if(!defined(&quot;__ZBXE__&quot;)) exit(); if(Context::getResponseMethod() == &quot;XMLRPC&quot; || Context::get('module') == &quot;admin&quot;) return; if($called_position !=... 2 2014.11.26 23101
9 특정 이메일 가입 않되게 (인증메일 관련) 인증메일 때문에... 특정 사이트로는 인증메일이 않들어가지는 부분을 해결하고자 다음과 같이 수정 하였다 /modules/member/member.controller.php 이 화일을 열... 2014.08.06 4764
8 XE보드 회원가입시 가입 아이피 기록하기 modules/member/member.controller.php 열기 // Insert data into the DB 찾기 // Insert data into the DB $args-&gt;list_order = -1 * $args-&gt;member_srl; $args-... 2014.07.23 2332
Board Pagination Prev 1 2 Next
/ 2

전체 방문자 : 1,166,432 오늘 : 122 어제 : 169 문서 : 0 댓글 : 0
전체회원 : 0 엮인글 : 0 첨부파일 : 0 전체 페이지뷰 : 11,257,672 오늘 페이지뷰 : 490 어제 페이지뷰 : 551
Copyright by Myceo 2008 All rights reserved
수원시 팔달구 인계동 1017-3 2층
☏1600-0324

Made By Myceo

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소