All pastes #75834 Raw Edit

Something

public php v1 · immutable
#75834 ·published 2006-06-30 17:00 UTC
rendered paste body
class 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;	}}