/** * Adds the CMS URLs to $this->content * * @param int forumdid to start at * @param int perpage limit defaults to 30000 */ public function generate_sitemap($startat = 0, $perpage = 30000) { global $config; //make sure we have the node information if (!$this->nodes) { $this->nodes = vBCms_ContentManager::getPublicContent($startat, $perpage); } $this->has_more = false; $route = vB_Route::create('vBCms_Route_Content'); foreach ($this->nodes as $node) { $this->pagecount++; $this->lastid = $node['nodeid']; $route->node = $node['nodeid'] . (empty($node['url']) ? '' : '-' . $node['url']); $rawurl = $route->getCurrentURL(); $pageurl = str_replace('/' . vB::$vbulletin->config['Misc']['admincpdir'] . '/', '/', $rawurl); $priority = $this->get_effective_priority('cms', $node['sectionid']); $this->content .= $this->url_block($pageurl, $node['publishdate'], $priority); if ($this->pagecount >= $perpage) { $this->has_more = true; break; } } // Return the amout done return $this->pagecount; }