Powerful and easy to use cms to build websites, blogs or ecommerce stores.
HTML backendblogblog-engineblog-platformbloggingcmscontent-managementcontent-management-systemecommerceecommerce-platformno-codepage-builderphpphp-cmsphp7php8self-hostedshopping-cartweb-applicationwebsite-builder
Get user email for comments, reviews and questions
givanz4e726ea5c599
diff --git a/admin/sql/mysqli/comment.sql b/admin/sql/mysqli/comment.sqlindex e4f62a5..d913160 100755--- a/admin/sql/mysqli/comment.sql+++ b/admin/sql/mysqli/comment.sql@@ -7,10 +7,10 @@IN language_id INT,IN site_id INT,IN post_id INT,- IN user_id INT,- IN language_id INT,- IN status INT,- IN post_title INT,+ IN user_id INT,+ IN language_id INT,+ IN status INT,+ IN post_title INT,-- paginationIN start INT,@@ -23,7 +23,7 @@)BEGIN- SELECT user.username, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, comment.*, comment_id as array_key+ SELECT user.username, user.email, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, comment.*, comment_id as array_key@IF isset(:post_title) AND :post_titleTHEN,post_content.name, post_content.slugdiff --git a/admin/sql/mysqli/product_question.sql b/admin/sql/mysqli/product_question.sqlindex 7181f81..4d0a41e 100755--- a/admin/sql/mysqli/product_question.sql+++ b/admin/sql/mysqli/product_question.sql@@ -18,7 +18,7 @@)BEGIN- SELECT user.username, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_question.*,user.user_id as user_id+ SELECT user.username, user.email, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_question.*,user.user_id as user_idFROM product_question AS product_questionLEFT JOIN user on user.user_id = product_question.user_iddiff --git a/admin/sql/mysqli/product_review.sql b/admin/sql/mysqli/product_review.sqlindex 1896497..c902c53 100755--- a/admin/sql/mysqli/product_review.sql+++ b/admin/sql/mysqli/product_review.sql@@ -20,7 +20,7 @@)BEGIN- SELECT user.username, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_review.*,user.user_id as user_id,+ SELECT user.username, user.email, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_review.*,user.user_id as user_id,-- (SELECT CONCAT('[', GROUP_CONCAT('{"id":"', prm.product_review_media_id, '","image":"' , prm.image, '"}'), ']')(SELECT JSON_ARRAYAGG( JSON_OBJECT('id', prm.product_review_media_id, 'image', prm.image) )FROM product_review_media as prmdiff --git a/admin/sql/pgsql/comment.sql b/admin/sql/pgsql/comment.sqlindex 46fa2ec..90f6f2e 100755--- a/admin/sql/pgsql/comment.sql+++ b/admin/sql/pgsql/comment.sql@@ -7,10 +7,10 @@IN language_id INT,IN site_id INT,IN post_id INT,- IN user_id INT,- IN language_id INT,- IN status INT,- IN post_title INT,+ IN user_id INT,+ IN language_id INT,+ IN status INT,+ IN post_title INT,-- paginationIN start INT,@@ -23,7 +23,7 @@)BEGIN- SELECT user.username, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, comment.*, comment_id as array_key+ SELECT user.username, user.email, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, comment.*, comment_id as array_key@IF isset(:post_title) AND :post_titleTHEN,post_content.name, post_content.slugdiff --git a/admin/sql/pgsql/product_question.sql b/admin/sql/pgsql/product_question.sqlindex b298d83..9a3bb1c 100755--- a/admin/sql/pgsql/product_question.sql+++ b/admin/sql/pgsql/product_question.sql@@ -18,7 +18,7 @@)BEGIN- SELECT "user".username, "user".first_name, "user".last_name, "user".display_name, "user".avatar, "user".bio, "user".subscribe, product_question.*, "user".user_id as user_id+ SELECT "user".username, "user".email, "user".first_name, "user".last_name, "user".display_name, "user".avatar, "user".bio, "user".subscribe, product_question.*, "user".user_id as user_idFROM product_question AS product_questionLEFT JOIN "user" on "user".user_id = product_question.user_iddiff --git a/admin/sql/pgsql/product_review.sql b/admin/sql/pgsql/product_review.sqlindex ce09ab8..92f167c 100755--- a/admin/sql/pgsql/product_review.sql+++ b/admin/sql/pgsql/product_review.sql@@ -20,7 +20,7 @@)BEGIN- SELECT "user".username, "user".first_name, "user".last_name, "user".display_name, "user".avatar, "user".bio, "user".subscribe, product_review.*, "user".user_id as user_id,+ SELECT "user".username, "user".email, "user".first_name, "user".last_name, "user".display_name, "user".avatar, "user".bio, "user".subscribe, product_review.*, "user".user_id as user_id,(SELECT json_agg(json_build_object('id',prm.product_review_media_id,'image',prm.image))FROM product_review_media as prmWHERE prm.product_review_id = product_review.product_review_id GROUP BY prm.product_review_id) as imagesdiff --git a/admin/sql/sqlite/comment.sql b/admin/sql/sqlite/comment.sqlindex 726f046..c465d64 100755--- a/admin/sql/sqlite/comment.sql+++ b/admin/sql/sqlite/comment.sql@@ -7,10 +7,10 @@IN language_id INT,IN site_id INT,IN post_id INT,- IN user_id INT,- IN language_id INT,- IN status INT,- IN post_title INT,+ IN user_id INT,+ IN language_id INT,+ IN status INT,+ IN post_title INT,-- paginationIN start INT,@@ -23,7 +23,7 @@)BEGIN- SELECT user.username, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, comment.*, comment_id as array_key+ SELECT user.username, user.email, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, comment.*, comment_id as array_key@IF isset(:post_title) AND :post_titleTHEN,post_content.name, post_content.slugdiff --git a/admin/sql/sqlite/product_question.sql b/admin/sql/sqlite/product_question.sqlindex 15f6285..8229afd 100755--- a/admin/sql/sqlite/product_question.sql+++ b/admin/sql/sqlite/product_question.sql@@ -18,7 +18,7 @@)BEGIN- SELECT user.username, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_question.*,user.user_id as user_id+ SELECT user.username, user.email, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_question.*,user.user_id as user_idFROM product_question AS product_questionLEFT JOIN user on user.user_id = product_question.user_iddiff --git a/admin/sql/sqlite/product_review.sql b/admin/sql/sqlite/product_review.sqlindex ea7d0fb..a19ae9e 100755--- a/admin/sql/sqlite/product_review.sql+++ b/admin/sql/sqlite/product_review.sql@@ -20,7 +20,7 @@)BEGIN- SELECT user.username, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_review.*,user.user_id as user_id,+ SELECT user.username, user.email, user.first_name, user.last_name, user.display_name, user.avatar, user.bio, user.subscribe, product_review.*,user.user_id as user_id,(SELECT json_group_array(json_object('id',prm.product_review_media_id,'image',prm.image))FROM product_review_media as prmWHERE prm.product_review_id = product_review.product_review_id GROUP BY prm.product_review_id) as imagesdiff --git a/app/component/comments.php b/app/component/comments.phpindex 1adcb2e..43d0582 100755--- a/app/component/comments.php+++ b/app/component/comments.php@@ -107,11 +107,13 @@ class Comments extends ComponentBase {}//rfc- $comment['pubDate'] = date('r', strtotime($comment['created_at']));+ if (isset($comment['slug']) && $comment['slug']) {+ $comment['pubDate'] = date('r', strtotime($comment['created_at']));- $anchor = '#comment-' . $comment[$this->type . '_id'];- $comment['url'] = url($this->route, $comment) . $anchor;- $comment['full-url'] = url($this->route, $comment + ['host' => SITE_URL, 'scheme' => $_SERVER['REQUEST_SCHEME'] ?? 'http']) . $anchor;+ $anchor = '#comment-' . $comment[$this->type . '_id'];+ $comment['url'] = url($this->route, $comment) . $anchor;+ $comment['full-url'] = url($this->route, $comment + ['host' => SITE_URL, 'scheme' => $_SERVER['REQUEST_SCHEME'] ?? 'http']) . $anchor;+ }$comment['level'] = $level;}}