Browse Source

Update functions.php

pull/663/head
danpros 2 years ago
parent
commit
79f7bf3f8e
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      system/includes/functions.php

+ 4
- 2
system/includes/functions.php View File

@ -2482,6 +2482,7 @@ function sitemap_post_path()
// The post date // The post date
$post->date = strtotime($timestamp); $post->date = strtotime($timestamp);
$post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($filepath)));
// The archive per day // The archive per day
$post->archiveday = site_url() . 'archive/' . date('Y-m-d', $post->date); $post->archiveday = site_url() . 'archive/' . date('Y-m-d', $post->date);
@ -2524,6 +2525,7 @@ function sitemap_page_path()
// The static page URL // The static page URL
$url = str_replace($replaced, '', $v); $url = str_replace($replaced, '', $v);
$post->url = site_url() . str_replace('.md', '', $url); $post->url = site_url() . str_replace('.md', '', $url);
$post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($v)));
$tmp[] = $post; $tmp[] = $post;
} }
@ -2604,7 +2606,7 @@ function generate_sitemap($str)
foreach ($posts as $p) { foreach ($posts as $p) {
echo '<url><loc>' . $p->url . '</loc><priority>' . $priority . '</priority><lastmod>' . date('Y-m-d', $p->date) . '</lastmod></url>';
echo '<url><loc>' . $p->url . '</loc><priority>' . $priority . '</priority><lastmod>' . date('Y-m-d\TH:i:sP', $p->lastMod) . '</lastmod></url>';
} }
echo '</urlset>'; echo '</urlset>';
@ -2622,7 +2624,7 @@ function generate_sitemap($str)
foreach ($posts as $p) { foreach ($posts as $p) {
echo '<url><loc>' . $p->url . '</loc><priority>' . $priority . '</priority></url>';
echo '<url><loc>' . $p->url . '</loc><priority>' . $priority . '</priority><lastmod>' . date('Y-m-d\TH:i:sP', $p->lastMod) . '</lastmod></url>';
} }
echo '</urlset>'; echo '</urlset>';


Loading…
Cancel
Save