Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions assets/xsl-stylesheets/xml-sitemap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@
<table id="sitemap" cellpadding="3">
<thead>
<tr>
<th width="70%">URL</th>
<th width="5%">Priority</th>
<th width="80%">URL</th>
<th width="5%">Images</th>
<th width="5%">Videos</th>
<th width="5%">Change Freq.</th>
<th width="10%">Last Change</th>
</tr>
</thead>
Expand All @@ -102,18 +100,12 @@
<xsl:value-of select="sitemap:loc"/>
</a>
</td>
<td>
<xsl:value-of select="concat(sitemap:priority*100,'%')"/>
</td>
<td>
<xsl:value-of select="count(image:image)"/>
</td>
<td>
<xsl:value-of select="count(video:video)"/>
</td>
<td>
<xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/>
</td>
<td>
<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
</td>
Expand Down
31 changes: 1 addition & 30 deletions lib/yrewrite/seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,6 @@ public function sendSitemap($domain = '')
$domain = rex_yrewrite::getDomainByName($domain);
}

$domain_article_id = $domain->getStartId();
$paths = 0;
if ($dai = rex_article::get($domain_article_id)) {
$paths = count($dai->getParentTree());
}

foreach (rex_yrewrite::getPathsByDomain($domain->getName()) as $article_id => $path) {
foreach ($domain->getClangs() as $clang_id) {
if (!isset($path[$clang_id]) || !rex_clang::get($clang_id)->isOnline()) {
Expand All @@ -287,27 +281,6 @@ public function sendSitemap($domain = '')
&& (1 == $index || ($article->isOnline() && 0 == $index))
&& ($article_id != $domain->getNotfoundId() || $article_id == $domain->getStartId())
) {
$changefreq = $article->getValue(self::$meta_changefreq_field);
if (!in_array($changefreq, self::$changefreq)) {
$changefreq = self::$changefreq_default;
}

$priority = $article->getValue(self::$meta_priority_field);

if (!in_array($priority, self::$priority)) {
$article_paths = count($article->getParentTree());
$prio = $article_paths - $paths - 1;
if ($prio < 0) {
$prio = 0;
}

if (isset(self::$priority[$prio])) {
$priority = self::$priority[$prio];
} else {
$priority = self::$priority_default;
}
}

$sitemap_entry =
"\n" . '<url>' .
"\n\t" . '<loc>' . rex_yrewrite::getFullPath($path[$clang_id]) . '</loc>' .
Expand All @@ -321,9 +294,7 @@ public function sendSitemap($domain = '')
"\n\t" . '</image:image>';
}
}
$sitemap_entry .= "\n\t" . '<changefreq>' . $changefreq . '</changefreq>' .
"\n\t" . '<priority>' . $priority . '</priority>' .
"\n" . '</url>';
$sitemap_entry .= "\n" . '</url>';
$sitemap[] = $sitemap_entry;
}
}
Expand Down