_title = $title; if ($path == '') { $path = '/'; } $this->_path = $path; } function getTitle() { return $this->_title; } function getPath() { return $this->_path; } } class k4History { var $_pages = array(); function addPage(&$page) { // make sure the last url is not the same as the current if($this->_index > -1) { if($this->_pages[count($this->_pages) - 1]->getPath() == $page->getPath()) { return; } } // add the page to the start of stack array_unshift($this->_pages, $page); // only keep track of the last 8 pages $this->_pages = array_slice($this->_pages, 0, 8); } function &prevPage() { return array_shift($this->_pages); } } ?>