Skip to content

armgit / Vvveb

Public Imported from GitHub
0

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

Added avatar_url key for user avatar images

givanz0a2b1a2a75b7
diff --git a/app/component/comments.php b/app/component/comments.php
index 5396827..85cdb53 100755
--- a/app/component/comments.php
+++ b/app/component/comments.php
@@ -27,6 +27,7 @@ use function Vvveb\session as sess;
use Vvveb\Sql\CommentSQL;
use Vvveb\System\Component\ComponentBase;
use Vvveb\System\Event;
+use Vvveb\System\Images;
use function Vvveb\url;
class Comments extends ComponentBase {
@@ -106,14 +107,19 @@ class Comments extends ComponentBase {
}
}
+ if (isset($comment['avatar'])) {
+ $comment['avatar_url'] = Images::image($comment['avatar'], 'user');
+ }
+
//rfc
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['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;
}
}