diff --git a/administrator/components/com_schuweb_sitemap/language/en-GB/en-GB.com_schuweb_sitemap.ini b/administrator/components/com_schuweb_sitemap/language/en-GB/en-GB.com_schuweb_sitemap.ini index 73acf01..7950e52 100755 --- a/administrator/components/com_schuweb_sitemap/language/en-GB/en-GB.com_schuweb_sitemap.ini +++ b/administrator/components/com_schuweb_sitemap/language/en-GB/en-GB.com_schuweb_sitemap.ini @@ -36,7 +36,9 @@ DATE_NEVER="Never" SCHUWEB_SITEMAP_INTROTEXT_LABEL="Intro Text" SCHUWEB_SITEMAP_INTROTEXT_DESC="Enter the text that will be displayed above the site map" SCHUWEB_SITEMAP_PRIORITY="Priority" +SCHUWEB_SITEMAP_PRIORITY_DESC="The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0. This value does not affect how your pages are compared to pages on other sites—it only lets the search engines know which pages you deem most important for the crawlers. The default priority of a page is 0.5. Please note that the priority you assign to a page is not likely to influence the position of your URLs in a search engine's result pages. Search engines may use this information when selecting between URLs on the same site, so you can use this tag to increase the likelihood that your most important pages are present in a search index. Also, please note that assigning a high priority to all of the URLs on your site is not likely to help you. Since the priority is relative, it is only used to select between URLs on your site." SCHUWEB_SITEMAP_CHANGE_FREQUENCY="Change Frequency" +SCHUWEB_SITEMAP_CHANGE_FREQUENCY_DESC="How frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page. Valid values are: always, hourly, daily, weekly, monthly, yearly, never. The value "always" should be used to describe documents that change each time they are accessed. The value "never" should be used to describe archived URLs. Please note that the value of this tag is considered a hint and not a command. Even though search engine crawlers may consider this information when making decisions, they may crawl pages marked "hourly" less frequently than that, and they may crawl pages marked "yearly" more frequently than that. Crawlers may periodically crawl pages marked "never" so that they can handle unexpected changes to those pages." SCHUWEB_SITEMAP_PAGE_ADD_SITEMAP="New Sitemap" SCHUWEB_SITEMAP_PAGE_EDIT_SITEMAP="Edit Sitemap" SCHUWEB_SITEMAP_SITEMAP_DETAILS_FIELDSET="Sitemap Details" diff --git a/administrator/components/com_schuweb_sitemap/models/forms/sitemap.xml b/administrator/components/com_schuweb_sitemap/models/forms/sitemap.xml index f6ecf52..f774639 100644 --- a/administrator/components/com_schuweb_sitemap/models/forms/sitemap.xml +++ b/administrator/components/com_schuweb_sitemap/models/forms/sitemap.xml @@ -312,6 +312,28 @@ + + + + + + + +
diff --git a/components/com_schuweb_sitemap/displayer.php b/components/com_schuweb_sitemap/displayer.php index d49fbf7..da5c3f7 100644 --- a/components/com_schuweb_sitemap/displayer.php +++ b/components/com_schuweb_sitemap/displayer.php @@ -153,6 +153,8 @@ protected function printMenuTree($menu,&$items) $node->modified = @$item->modified; $node->secure = $item->params->get('secure'); $node->lastmod = $item->lastmod; + $node->xmlInsertChangeFreq = $item->xmlInsertChangeFreq; + $node->xmlInsertPriority = $item->xmlInsertPriority; // New on SchuWeb_Sitemap 2.0: send the menu params $node->params =& $item->params; diff --git a/components/com_schuweb_sitemap/helpers/schuweb_sitemap.php b/components/com_schuweb_sitemap/helpers/schuweb_sitemap.php index 5522e5a..199c581 100644 --- a/components/com_schuweb_sitemap/helpers/schuweb_sitemap.php +++ b/components/com_schuweb_sitemap/helpers/schuweb_sitemap.php @@ -88,12 +88,16 @@ public static function &getMenuItems($selections) $item->priority = $menuOptions['priority']; $item->changefreq = $menuOptions['changefreq']; $item->lastmod = $menuOptions['lastmod']; + $item->xmlInsertChangeFreq = $menuOptions['xmlInsertChangeFreq']; + $item->xmlInsertPriority = $menuOptions['xmlInsertPriority']; SchuWeb_SitemapHelper::prepareMenuItem($item); } else { $item->priority = null; $item->changefreq = null; $item->lastmod = null; + $item->xmlInsertChangeFreq = null; + $item->xmlInsertPriority = null; } if ($item->parent_id > 1) { diff --git a/components/com_schuweb_sitemap/models/sitemap.php b/components/com_schuweb_sitemap/models/sitemap.php index e1683a5..ba7310a 100644 --- a/components/com_schuweb_sitemap/models/sitemap.php +++ b/components/com_schuweb_sitemap/models/sitemap.php @@ -134,12 +134,16 @@ public function &getItem($pk = null) $data->selections = $registry->toArray(); $lastmod = $data->params->get('xmlLastMod'); + $xmlInsertChangeFreq = $data->params->get('xmlInsertChangeFreq'); + $xmlInsertPriority = $data->params->get('xmlInsertPriority'); // only display the Menüs which are activated foreach ($data->selections as $key => $selection) { if (!isset($selection["enabled"]) || is_null($selection["enabled"]) || $selection["enabled"] != 1) { unset($data->selections[$key]); } else { $data->selections[$key]["lastmod"] = $lastmod; + $data->selections[$key]["xmlInsertChangeFreq"] = $xmlInsertChangeFreq; + $data->selections[$key]["xmlInsertPriority"] =$xmlInsertPriority; } } diff --git a/components/com_schuweb_sitemap/views/xml/tmpl/default_class.php b/components/com_schuweb_sitemap/views/xml/tmpl/default_class.php index 7e18abe..d86c74f 100644 --- a/components/com_schuweb_sitemap/views/xml/tmpl/default_class.php +++ b/components/com_schuweb_sitemap/views/xml/tmpl/default_class.php @@ -6,7 +6,7 @@ * @author Guillermo Vargas (guille@vargas.co.cr) */ // No direct access -defined( '_JEXEC' ) or die( 'Restricted access' ); +defined('_JEXEC') or die('Restricted access'); require_once(JPATH_COMPONENT . '/displayer.php'); @@ -47,7 +47,7 @@ function __construct($config, $sitemap) $this->uids = array(); $this->defaultLanguage = strtolower(JFactory::getLanguage()->getTag()); - if (preg_match('/^([a-z]+)-.*/',$this->defaultLanguage,$matches) && !in_array($this->defaultLanguage, array(' zh-cn',' zh-tw')) ) { + if (preg_match('/^([a-z]+)-.*/', $this->defaultLanguage, $matches) && !in_array($this->defaultLanguage, array(' zh-cn', ' zh-tw'))) { $this->defaultLanguage = $matches[1]; } @@ -68,7 +68,7 @@ function __construct($config, $sitemap) function printNode(&$node) { $node->isExcluded = false; - if ($this->isExcluded($node->id,$node->uid)) { + if ($this->isExcluded($node->id, $node->uid)) { if (!$this->showExcluded || !$this->canEdit) { return false; } @@ -91,7 +91,8 @@ function printNode(&$node) $node->browserNav = 0; if ($node->browserNav != 3 // ignore "no link" - && empty($this->_links[$link])) { // ignore links that have been added already + && empty($this->_links[$link]) + ) { // ignore links that have been added already $this->count++; $this->_links[$link] = 1; @@ -102,17 +103,21 @@ function printNode(&$node) $node->changefreq = 'daily'; // Get the chancefrequency and priority for this item - $changefreq = $this->getProperty('changefreq', $node->changefreq, $node->id, 'xml', $node->uid); - $priority = $this->getProperty('priority', $node->priority, $node->id, 'xml', $node->uid); + $changefreq = null; + if ($node->xmlInsertChangeFreq != 0) + $changefreq = $this->getProperty('changefreq', $node->changefreq, $node->id, 'xml', $node->uid); + $priority = null; + if ($node->xmlInsertPriority != 0) + $priority = $this->getProperty('priority', $node->priority, $node->id, 'xml', $node->uid); echo '' . "\n"; echo '', $link, '' . "\n"; if ($this->canEdit) { if ($this->showTitle) { - echo '<![CDATA['.$node->name.']]>' . "\n"; + echo '<![CDATA[' . $node->name . ']]>' . "\n"; } if ($this->showExcluded) { - echo '',($node->isExcluded? 'excluded':''),''; + echo '', ($node->isExcluded ? 'excluded' : ''), ''; } echo '', $node->uid, '' . "\n"; echo '', $node->id, '' . "\n"; @@ -145,16 +150,18 @@ function printNode(&$node) echo ''; } if (isset($image->license) && $image->license) { - echo '',str_replace('&', '&',html_entity_decode($image->license, ENT_NOQUOTES, 'UTF-8')),'',"\n"; + echo '', str_replace('&', '&', html_entity_decode($image->license, ENT_NOQUOTES, 'UTF-8')), '', "\n"; } echo '', "\n"; } } else { - if ($modified){ + if ($modified) { echo '', $modified, '' . "\n"; } - echo '', $changefreq, '' . "\n"; - echo '', $priority, '' . "\n"; + if ($changefreq) + echo '', $changefreq, '' . "\n"; + if ($priority) + echo '', $priority, '' . "\n"; } } else { if (isset($node->keywords)) { @@ -168,12 +175,12 @@ function printNode(&$node) } echo "\n"; - echo ''."\n"; - echo ' '.(htmlspecialchars($this->sitemap->params->get('news_publication_name'))).''."\n"; - echo ' '.$node->language.''."\n"; - echo ''."\n"; + echo '' . "\n"; + echo ' ' . (htmlspecialchars($this->sitemap->params->get('news_publication_name'))) . '' . "\n"; + echo ' ' . $node->language . '' . "\n"; + echo '' . "\n"; echo '', $modified, '' . "\n"; - echo 'name.']]>' . "\n"; + echo 'name . ']]>' . "\n"; if ($keywords) { echo '', $keywords, '' . "\n"; } @@ -190,9 +197,9 @@ function printNode(&$node) * * @param string $property The property that is needed * @param string $value The default value if the property is not found - * @param int $Itemid The menu item id - * @param string $view (xml / html) - * @param int $uid Unique id of the element on the sitemap + * @param int $Itemid The menu item id + * @param string $view (xml / html) + * @param int $uid Unique id of the element on the sitemap * (the id asigned by the extension) * @return string */ diff --git a/components/com_schuweb_sitemap/views/xml/tmpl/default_xsl.php b/components/com_schuweb_sitemap/views/xml/tmpl/default_xsl.php index 4bdbdfd..df592cc 100644 --- a/components/com_schuweb_sitemap/views/xml/tmpl/default_xsl.php +++ b/components/com_schuweb_sitemap/views/xml/tmpl/default_xsl.php @@ -426,10 +426,14 @@ function checkToggleExcluded(result,xmlResponse) { isImages): ?> item->params->get('xmlLastMod') != 0) : ?> - + + + item->params->get('xmlInsertChangeFreq') != 0) : ?> + + + item->params->get('xmlInsertPriority') != 0) : ?> + - - @@ -458,14 +462,18 @@ function checkToggleExcluded(result,xmlResponse) { isImages): ?> item->params->get('xmlLastMod') != 0) : ?> - + canEdit): ?> - - + item->params->get('xmlInsertChangeFreq') != 0) : ?> + + + item->params->get('xmlInsertPriority') != 0) : ?> + +