rendered paste bodyclass WeekGraphModule extends HabaneroModule { function WeekGraphModule(&$Options, &$DB, &$Actions) { parent::HabaneroModule($Options, $DB, $Actions); $this->Actions->add('admin_area', array(&$this, 'loadMods')); } function loadMods() { $widget = & new HabaneroWidget($this->Actions, $this->Options, 'weeklygraphmodule'); $widget->setTitle($this->_('Weekly Graph')); $pastWeek = & new HabaneroGraph; $pastWeek->setTitle($this->_('Past Week')); $pastWeek->setCallback(array(&$this, 'pastWeek')); $pastWeek->setGraphMethod('pastxdays'); $pastWeek->setScaleLabel('Total Hits'); $widget->addChildObj($pastWeek); $this->registerWidget($widget); } function pastWeek() { $week = array(); for ($i = 1; $i < 8; $i++) { $now = $this->DB->getDate($this->thisDay - ($this->oneDay * ($i - 1))); $then = $this->DB->getDate($this->thisDay - ($this->oneDay * $i)); $results = $this->DB->getAll('db_0007', $now, $then); $week[$i][$i - 1] = count($results); } return $week; }}