XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
counter_status.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
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
Definition: ko.install.php:193
proc($args)
Widget execution Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments After generat...
set($key, $val, $set_to_get_vars=0)
Handler class for widget execution.
$args
Definition: ko.install.php:185
getModel($module_name)
Definition: func.inc.php:145
Display counter status by using data in the counter module.