summaryrefslogtreecommitdiff
path: root/templates/themes/sitemap
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2015-03-10 12:48:59 +0100
committerczaks <marcin@6irc.net>2015-03-10 12:48:59 +0100
commitbdb6001f3f7e93e0b9655c0491bbef6f1df8a5fa (patch)
tree4f4007d1b090694746fc6d36a19dd8accfd3f8ca /templates/themes/sitemap
parenteb245c2970062620f349024922f8c48379ffea88 (diff)
support for slugified links; may introduce a few bugs
Diffstat (limited to 'templates/themes/sitemap')
-rw-r--r--templates/themes/sitemap/sitemap.xml4
-rw-r--r--templates/themes/sitemap/theme.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/templates/themes/sitemap/sitemap.xml b/templates/themes/sitemap/sitemap.xml
index 733da607..95dfdd26 100644
--- a/templates/themes/sitemap/sitemap.xml
+++ b/templates/themes/sitemap/sitemap.xml
@@ -9,11 +9,11 @@
{% for board, thread_list in threads %}
{% for thread in thread_list %}
<url>
- <loc>{{ settings.url ~ (config.board_path | format(board)) ~ config.dir.res ~ (config.file_page | format(thread.thread_id)) }}</loc>
+ <loc>{{ settings.url ~ (config.board_path | format(board)) ~ config.dir.res ~ link_for(thread) }}</loc>
<lastmod>{{ thread.lastmod | date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }}</lastmod>
<changefreq>{{ settings.changefreq }}</changefreq>
</url>
{% endfor %}
{% endfor %}
</urlset>
-{% endfilter %} \ No newline at end of file
+{% endfilter %}
diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php
index 3e048dd5..1cebcdb6 100644
--- a/templates/themes/sitemap/theme.php
+++ b/templates/themes/sitemap/theme.php
@@ -26,7 +26,7 @@
$threads = array();
foreach ($boards as $board) {
- $query = query(sprintf("SELECT `id` AS `thread_id`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error());
+ $query = query(sprintf("SELECT `id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error());
$threads[$board] = $query->fetchAll(PDO::FETCH_ASSOC);
}