XpressEngine Core
1.11.2
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
widgets
counter_status
counter_status.class.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) NAVER <http://www.navercorp.com> */
9
class
counter_status
extends
WidgetHandler
10
{
16
function
proc
(
$args
)
17
{
18
// Get status of the accumulated, yesterday's, today's counts
19
$oCounterModel =
getModel
(
'counter'
);
20
21
$site_module_info =
Context::get
(
'site_module_info'
);
22
$output
= $oCounterModel->getStatus(array(
'00000000'
, date(
'Ymd'
, $_SERVER[
'REQUEST_TIME'
]-60*60*24), date(
'Ymd'
)), $site_module_info->site_srl);
23
if
(count(
$output
))
24
{
25
foreach
(
$output
as $key => $val)
26
{
27
if
(!$key)
Context::set
(
'total_counter'
, $val);
28
elseif($key == date(
"Ymd"
))
Context::set
(
'today_counter'
, $val);
29
else
Context::set
(
'yesterday_counter'
, $val);
30
}
31
}
32
// Set a path of the template skin (values of skin, colorset settings)
33
$tpl_path = sprintf(
'%sskins/%s'
, $this->widget_path,
$args
->skin);
34
Context::set
(
'colorset'
,
$args
->colorset);
35
// Specify a template file
36
$tpl_file =
'counter_status'
;
37
// Compile a template
38
$oTemplate = &
TemplateHandler::getInstance
();
39
return
$oTemplate->compile($tpl_path, $tpl_file);
40
}
41
}
42
/* End of file counter_status.class.php */
43
/* Location: ./widgets/counter_status/counter_status.class.php */
$output
$output
Definition:
ko.install.php:193
counter_status\proc
proc($args)
Widget execution Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments After generat...
Definition:
counter_status.class.php:16
TemplateHandler\getInstance
static & getInstance()
Definition:
TemplateHandler.class.php:60
Context\set
set($key, $val, $set_to_get_vars=0)
Definition:
Context.class.php:1948
WidgetHandler
Handler class for widget execution.
Definition:
WidgetHandler.class.php:10
$args
$args
Definition:
ko.install.php:185
getModel
getModel($module_name)
Definition:
func.inc.php:145
Context\get
get($key)
Definition:
Context.class.php:1973
counter_status
Display counter status by using data in the counter module.
Definition:
counter_status.class.php:9
Generated on Tue Dec 18 2018 17:04:29 for XpressEngine Core by
1.8.5