Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Added lastMod field for components to be used for sitemap generation

givanzca52946975b0
diff --git a/app/component/post.php b/app/component/post.php
index f679581..d95ec4a 100755
--- a/app/component/post.php
+++ b/app/component/post.php
@@ -73,6 +73,10 @@ class Post extends ComponentBase {
$results['author-url'] = url('content/user/index', $results);
$results['comments-url'] = $results['url'] . '#comments';
+ //rfc
+ $results['pubDate'] = date('r', strtotime($results['created_at']));
+ $results['modDate'] = date('r', strtotime($results['updated_at']));
+
list($results) = Event :: trigger(__CLASS__,__FUNCTION__, $results);
return $results;
diff --git a/app/component/posts.php b/app/component/posts.php
index 0327eab..611e7b9 100755
--- a/app/component/posts.php
+++ b/app/component/posts.php
@@ -178,6 +178,7 @@ class Posts extends ComponentBase {
//rfc
$post['pubDate'] = date('r', strtotime($post['created_at']));
$post['modDate'] = date('r', strtotime($post['updated_at']));
+ $post['lastMod'] = date('Y-m-d\TH:i:sP', strtotime($post['updated_at']));
//url
$url = ['slug' => $post['slug'], 'post_id' => $post['post_id']] + $language;
diff --git a/app/component/product.php b/app/component/product.php
index 11237f6..f5e5a52 100755
--- a/app/component/product.php
+++ b/app/component/product.php
@@ -22,6 +22,7 @@
namespace Vvveb\Component;
+use function Vvveb\getCurrency;
use function Vvveb\model;
use function Vvveb\sanitizeHTML;
use Vvveb\Sql\ProductSQL;
@@ -73,6 +74,7 @@ class Product extends ComponentBase {
$tax = Tax::getInstance();
$currency = Currency::getInstance();
+ $results['price_currency'] = getCurrency();
$results['price_tax'] = $tax->addTaxes($results['price'], $results['tax_type_id']);
$results['price_tax_formatted'] = $currency->format($results['price_tax']);
$results['price_formatted'] = $currency->format($results['price']);
@@ -84,6 +86,10 @@ class Product extends ComponentBase {
$results['promotion_discount'] = 100 - ceil($results['promotion'] * 100 / $results['price']);
}
+ //rfc
+ $results['pubDate'] = date('r', strtotime($results['created_at']));
+ $results['modDate'] = date('r', strtotime($results['updated_at']));
+
list($results) = Event :: trigger(__CLASS__,__FUNCTION__, $results);
return $results;
diff --git a/app/component/products.php b/app/component/products.php
index 151f255..0027d64 100755
--- a/app/component/products.php
+++ b/app/component/products.php
@@ -137,6 +137,7 @@ class Products extends ComponentBase {
//rfc
$product['pubDate'] = date('r', strtotime($product['created_at']));
$product['modDate'] = date('r', strtotime($product['updated_at']));
+ $product['lastMod'] = date('Y-m-d\TH:i:sP', strtotime($product['updated_at']));
$url = ['slug' => $product['slug'], 'product_id' => $product['product_id']] + $language;
$product['url'] = url('product/product/index', $url);
diff --git a/public/themes/default/feed/page-sitemap.xml b/public/themes/default/feed/page-sitemap.xml
index 68f1572..e121806 100644
--- a/public/themes/default/feed/page-sitemap.xml
+++ b/public/themes/default/feed/page-sitemap.xml
@@ -14,13 +14,13 @@
>
<url data-v-post="post">
<loc data-v-post-full-url="name">https://vvveb.com/page/about</loc>
- <lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
+ <lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url data-v-post="post">
<loc data-v-post-full-url="name">https://vvveb.com/page/services</loc>
- <lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
+ <lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
diff --git a/public/themes/default/feed/post-sitemap.xml b/public/themes/default/feed/post-sitemap.xml
index f201bb0..255b4b8 100644
--- a/public/themes/default/feed/post-sitemap.xml
+++ b/public/themes/default/feed/post-sitemap.xml
@@ -14,13 +14,13 @@
>
<url data-v-post="post">
<loc data-v-post-full-url="name">https://vvveb.com/page/about</loc>
- <lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
+ <lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url data-v-post="post">
<loc data-v-post-full-url="name">https://vvveb.com/page/services</loc>
- <lastmod data-v-post-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
+ <lastmod data-v-post-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
diff --git a/public/themes/default/feed/product-sitemap.xml b/public/themes/default/feed/product-sitemap.xml
index 7bd51b6..7e09884 100644
--- a/public/themes/default/feed/product-sitemap.xml
+++ b/public/themes/default/feed/product-sitemap.xml
@@ -14,13 +14,13 @@
>
<url data-v-product="product">
<loc data-v-product-full-url="name">https://vvveb.com/page/about</loc>
- <lastmod data-v-product-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
+ <lastmod data-v-product-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url data-v-product="product">
<loc data-v-product-full-url="name">https://vvveb.com/page/services</loc>
- <lastmod data-v-product-pubDate="date">2023-05-26T12:37:22+00:00</lastmod>
+ <lastmod data-v-product-lastMod="date">2023-05-26T12:37:22+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>