From 3c9b6d7caf597dc13d54c3a61cf4f778c15ba5ad Mon Sep 17 00:00:00 2001 From: zero Date: Fri, 22 May 2009 10:10:55 +0000 Subject: [PATCH] =?UTF-8?q?=EC=B9=B4=EC=9A=B4=ED=84=B0=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=EC=97=90=20=EC=A3=BC=EA=B0=84=20=EB=A6=AC=ED=8F=AC?= =?UTF-8?q?=ED=8A=B8=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6357 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/counter/counter.model.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/counter/counter.model.php b/modules/counter/counter.model.php index 733178605..5c1e41096 100644 --- a/modules/counter/counter.model.php +++ b/modules/counter/counter.model.php @@ -105,6 +105,34 @@ $sum += $count; } break; + case 'week' : + $time = strtotime($selected_date); + $w = date("D"); + while(date("D",$time) != "Sun") { + $time += 60*60*24; + } + $time -= 60*60*24; + while(date("D",$time)!="Sun") { + $thisWeek[] = date("Ymd",$time); + $time -= 60*60*24; + } + $thisWeek[] = date("Ymd",$time); + asort($thisWeek); + foreach($thisWeek as $day) { + unset($args); + $args->start_date = $day; + $args->end_date = $day; + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteCounterStatus', $args); + } else { + $output = executeQuery('counter.getCounterStatus', $args); + } + $count = (int)$output->data->unique_visitor; + $status->list[$day] = (int)$count; + if($count>$max) $max = $count; + $sum += $count; + } break; case 'month' : $year = substr($selected_date, 0, 4);