Example #1
0
 $params = array('MainNodeOnly' => true, 'ClassFilterType' => $classFilterType, 'ClassFilterArray' => $classFilterArray, 'Limit' => 49999, 'Offset' => 0, 'SortBy' => array(array('depth', true), array('published', true)));
 $nodeArray = $rootNode->subTree($params);
 $nodeArrayCount = count($nodeArray) + 1;
 if ($nodeArrayCount == 1) {
     $cli->output("No Items found under node #" . $contentINI->variable('NodeSettings', 'RootNode') . ".");
 }
 if (!$isQuiet) {
     $cli->output("Adding {$nodeArrayCount} nodes to the sitemap.");
     $output = new ezcConsoleOutput();
     $bar = new ezcConsoleProgressbar($output, $nodeArrayCount);
 }
 $addPrio = false;
 if ($googlesitemapsINI->variable('SiteMapSettings', 'AddPriorityToSubtree') == 'true') {
     $addPrio = true;
 }
 $sitemap = new xrowGoogleSiteMap();
 // Generate Sitemap
 // Adding the root node
 $object = $rootNode->object();
 $meta = xrowMetaDataFunctions::fetchByObject($object);
 $modified = $rootNode->attribute('modified_subnode');
 if ($meta and $meta->googlemap != '0') {
     $url = $rootNode->attribute('url_alias');
     eZURI::transformURI($url, true, 'full');
     $sitemap->add($url, $modified, $meta->change, $meta->priority);
 } elseif ($meta === false) {
     if ($addPrio) {
         $rootDepth = $rootNode->attribute('depth');
         $prio = 1;
     } else {
         $prio = null;
Example #2
0
 } else {
     $domain = $siteURL;
 }
 // Get the Sitemap's root node
 $rootNode = eZContentObjectTreeNode::fetch(eZINI::instance('content.ini')->variable('NodeSettings', 'RootNode'));
 if (!$rootNode instanceof eZContentObjectTreeNode) {
     $cli->output("Invalid RootNode.\n");
     return;
 }
 /* Change the siteaccess */
 $access = changeAccess(array("name" => $language["siteaccess"], "type" => EZ_ACCESS_TYPE_URI));
 unset($GLOBALS['eZContentObjectDefaultLanguage']);
 eZContentLanguage::expireCache();
 // Fetch the content tree
 $nodeArray = $rootNode->subTree(array('Language' => $language['locale'], 'ClassFilterType' => $classFilterType, 'ClassFilterArray' => $classFilterArray));
 $sitemap = new xrowGoogleSiteMap();
 // Generate Sitemap
 foreach ($nodeArray as $subTreeNode) {
     $object = $subTreeNode->object();
     $meta = xrowMetaDataFunctions::fetchByObject($object);
     if ($meta->googlemap != '0') {
         // stevo - removed siteaccess
         $url = 'http://' . $domain . '/' . $subTreeNode->attribute('url_alias');
         $sitemap->add($url, $object->attribute('modified'), $meta->change, $meta->priority);
     }
 }
 // write XML Sitemap to file
 $dir = eZSys::storageDirectory() . '/sitemap';
 mkdir($dir, 0777, true);
 if (count($languages) != 1) {
     $filename = $dir . '/' . xrowGoogleSiteMap::BASENAME . '_' . $language['siteaccess'] . '.' . xrowGoogleSiteMap::SUFFIX;