Skip to content

Commit ca52946

Browse files
committed
Added lastMod field for components to be used for sitemap generation
1 parent f7986fd commit ca52946

File tree

7 files changed

+18
-6
lines changed

7 files changed

+18
-6
lines changed

app/component/post.php

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ function results() {
7373
$results['author-url'] = url('content/user/index', $results);
7474
$results['comments-url'] = $results['url'] . '#comments';
7575

76+
//rfc
77+
$results['pubDate'] = date('r', strtotime($results['created_at']));
78+
$results['modDate'] = date('r', strtotime($results['updated_at']));
79+
7680
list($results) = Event :: trigger(__CLASS__,__FUNCTION__, $results);
7781

7882
return $results;

app/component/posts.php

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ function results() {
178178
//rfc
179179
$post['pubDate'] = date('r', strtotime($post['created_at']));
180180
$post['modDate'] = date('r', strtotime($post['updated_at']));
181+
$post['lastMod'] = date('Y-m-d\TH:i:sP', strtotime($post['updated_at']));
181182

182183
//url
183184
$url = ['slug' => $post['slug'], 'post_id' => $post['post_id']] + $language;

app/component/product.php

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
namespace Vvveb\Component;
2424

25+
use function Vvveb\getCurrency;
2526
use function Vvveb\model;
2627
use function Vvveb\sanitizeHTML;
2728
use Vvveb\Sql\ProductSQL;
@@ -73,6 +74,7 @@ function results() {
7374

7475
$tax = Tax::getInstance();
7576
$currency = Currency::getInstance();
77+
$results['price_currency'] = getCurrency();
7678
$results['price_tax'] = $tax->addTaxes($results['price'], $results['tax_type_id']);
7779
$results['price_tax_formatted'] = $currency->format($results['price_tax']);
7880
$results['price_formatted'] = $currency->format($results['price']);
@@ -84,6 +86,10 @@ function results() {
8486
$results['promotion_discount'] = 100 - ceil($results['promotion'] * 100 / $results['price']);
8587
}
8688

89+
//rfc
90+
$results['pubDate'] = date('r', strtotime($results['created_at']));
91+
$results['modDate'] = date('r', strtotime($results['updated_at']));
92+
8793
list($results) = Event :: trigger(__CLASS__,__FUNCTION__, $results);
8894

8995
return $results;

app/component/products.php

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function results() {
137137
//rfc
138138
$product['pubDate'] = date('r', strtotime($product['created_at']));
139139
$product['modDate'] = date('r', strtotime($product['updated_at']));
140+
$product['lastMod'] = date('Y-m-d\TH:i:sP', strtotime($product['updated_at']));
140141

141142
$url = ['slug' => $product['slug'], 'product_id' => $product['product_id']] + $language;
142143
$product['url'] = url('product/product/index', $url);

public/themes/default/feed/page-sitemap.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
>
1515
<url data-v-post="post">
1616
<loc data-v-post-full-url="name">https://vvveb.com/page/about</loc>
17-
<lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
17+
<lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
1818
<changefreq>weekly</changefreq>
1919
<priority>0.7</priority>
2020
</url>
2121
<url data-v-post="post">
2222
<loc data-v-post-full-url="name">https://vvveb.com/page/services</loc>
23-
<lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
23+
<lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
2424
<changefreq>weekly</changefreq>
2525
<priority>0.7</priority>
2626
</url>

public/themes/default/feed/post-sitemap.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
>
1515
<url data-v-post="post">
1616
<loc data-v-post-full-url="name">https://vvveb.com/page/about</loc>
17-
<lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
17+
<lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
1818
<changefreq>weekly</changefreq>
1919
<priority>0.7</priority>
2020
</url>
2121
<url data-v-post="post">
2222
<loc data-v-post-full-url="name">https://vvveb.com/page/services</loc>
23-
<lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
23+
<lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
2424
<changefreq>weekly</changefreq>
2525
<priority>0.7</priority>
2626
</url>

public/themes/default/feed/product-sitemap.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
>
1515
<url data-v-product="product">
1616
<loc data-v-product-full-url="name">https://vvveb.com/page/about</loc>
17-
<lastmod data-v-product-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
17+
<lastmod data-v-product-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
1818
<changefreq>weekly</changefreq>
1919
<priority>0.7</priority>
2020
</url>
2121
<url data-v-product="product">
2222
<loc data-v-product-full-url="name">https://vvveb.com/page/services</loc>
23-
<lastmod data-v-product-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
23+
<lastmod data-v-product-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
2424
<changefreq>weekly</changefreq>
2525
<priority>0.7</priority>
2626
</url>

0 commit comments

Comments
 (0)