Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/Controller.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ component extends="wheels.Controller" {
// Shared business logic across multiple controllers
public function getBlogBySlug(required string slug) {
return model("Blog").findOne(
where="blog_posts.slug = '#arguments.slug#' AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= CURRENT_TIMESTAMP",
where="blog_posts.slug = '#arguments.slug#' AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#now()#'",
include="User,PostStatus",
cache=10
);
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/web/HomeController.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ component extends="app.Controllers.Controller" {
});

// Add blog posts
var blogPosts = model("Blog").findAll(where="blog_posts.statusId <> 1 AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= CURRENT_TIMESTAMP ");
var blogPosts = model("Blog").findAll(where="blog_posts.statusId <> 1 AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#now()#' ");
for (var post in blogPosts) {
arrayAppend(urls, {
loc: getBaseUrl() & "/blog/" & post.slug,
Expand All @@ -231,7 +231,7 @@ component extends="app.Controllers.Controller" {
select="username",
include="User",
distinct="true",
where="blog_posts.statusId <> 1 AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= CURRENT_TIMESTAMP AND blog_posts.createdBy IS NOT NULL"
where="blog_posts.statusId <> 1 AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#now()#' AND blog_posts.createdBy IS NOT NULL"
);
for (var author in authors) {
arrayAppend(urls, {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/web/NewsController.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ component extends="app.Controllers.Controller" {
try {
var blogQuery = model("Blog").findAll(
select = "title, slug, content, postDate",
where = "blog_posts.statusId <> 1 AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= CURRENT_TIMESTAMP ",
where = "blog_posts.statusId <> 1 AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#now()#' ",
order = "createdAt DESC",
cache = 10
);
Expand Down
8 changes: 4 additions & 4 deletions app/views/web/BlogController/partials/_blogList.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<cfset blogUrl = "/blog/#blogs.slug#">
<cfset authorHxGet = "/blog/list/author/#blogs.createdby#?page=1&perPage=6&infiniteScroll=true">
<cfset formattedDate = dateformat(blogs.postDate, 'MMMM DD, YYYY')>
<cfset profileImageTag = '<img src="#gravatarUrl(blogs.email, 80)#"
<cfset profileImageTag = '<img src="#gravatarUrl(blogs.email, 80)#&d=404"
class="rounded-circle"
style="width:2.5rem; height:2.5rem;"
onerror="this.style.display=''none'';this.nextElementSibling.style.display=''flex'';"
onerror="this.classList.add(''d-none'');this.nextElementSibling.classList.remove(''d-none'');"
alt="avatar">
<div style="display:none;width:2.5rem;height:2.5rem;"
class="d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(blogs.fullname, " "), 1)))# text-white rounded-circle fw-bold text-uppercase">
<div class="d-none d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(blogs.fullname, " "), 1)))# text-white rounded-circle fw-bold text-uppercase"
style="width:2.5rem;height:2.5rem;">
#ucase(left(listLast(blogs.fullName, " "), 1))#
</div>'>

Expand Down
34 changes: 17 additions & 17 deletions app/views/web/BlogController/show.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@
<cfif commentParentId eq '' or commentParentId eq 0>
<div class="d-flex align-items-start gap-3">
<div>
<img src="#gravatarUrl(email, 96)#"
<img src="#gravatarUrl(email, 96)#&d=404"
class="rounded-circle"
style="width:3rem; height:3rem;"
onerror="this.style.display='none';this.nextElementSibling.style.display='flex';"
onerror="this.classList.add('d-none');this.nextElementSibling.classList.remove('d-none');"
alt="avatar">
<div style="display:none;width:3rem;height:3rem;"
class="d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(fullName, ' '), 1)))# text-white rounded-circle fw-bold text-uppercase">
<div class="d-none d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(fullName, ' '), 1)))# text-white rounded-circle fw-bold text-uppercase"
style="width:3rem;height:3rem;">
#ucase(left(listLast(fullName, " "), 1))#
</div>
</div>
</div>
<div class="p-3 rounded-4 flex-grow-1 bg-light">
<h6 class="fs-16 fw-bold">#fullName#</h6>
<cfif findNoCase("```", content) OR findNoCase("##", content) OR findNoCase("**", content) OR findNoCase("__", content) OR findNoCase(">", content)>
Expand Down Expand Up @@ -186,18 +186,18 @@
<div class="mt-4">
<div class="d-flex align-items-start gap-3 position-relative" style="margin-left: 70px;">
<div>
<img src="#gravatarUrl(email, 96)#"
<img src="#gravatarUrl(session.email, 96)#&d=404"
class="rounded-circle"
style="width:3rem; height:3rem;"
onerror="this.style.display='none';this.nextElementSibling.style.display='flex';"
onerror="this.classList.add('d-none');this.nextElementSibling.classList.remove('d-none');"
alt="avatar">
<div style="display:none;width:3rem;height:3rem;"
class="d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(fullName, ' '), 1)))# text-white rounded-circle fw-bold text-uppercase">
#ucase(left(listLast(fullName, " "), 1))#
<div class="d-none d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(session.username, ' '), 1)))# text-white rounded-circle fw-bold text-uppercase"
style="width:3rem;height:3rem;">
#ucase(left(listLast(session.username, " "), 1))#
</div>
</div>
</div>
<div class="p-3 rounded-4 flex-grow-1 bg-light">
<h6 class="fs-16 fw-bold">#fullName#</h6>
<h6 class="fs-16 fw-bold">#session.username#</h6>

<cfif findNoCase("```", content) OR findNoCase("##", content) OR findNoCase("**", content) OR findNoCase("__", content) OR findNoCase(">", content)>
<p class="fs-14 fw-normal text-dark markdown-content">#encodeForHTML(content)#</p>
Expand All @@ -220,14 +220,14 @@
<cfif isLoggedInUser() AND canUserComment()>
<form hx-target="##comment" hx-on:htmx:after-request="handleClear()" hx-swap="beforeend" id="commentForm" hx-post="/blog/comment" class="pt-3 px-1 needs-validation" novalidate hx-validate="true">
<div class="d-flex gap-3 align-items-start">
<img src="#gravatarUrl(session.email, 96)#"
<img src="#gravatarUrl(session.email, 96)#&d=404"
class="rounded-circle"
style="width:3rem; height:3rem;"
onerror="this.style.display='none';this.nextElementSibling.style.display='flex';"
onerror="this.classList.add('d-none');this.nextElementSibling.classList.remove('d-none');"
alt="avatar">
<div style="display:none;width:3rem;height:3rem;"
class="d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(session.USERNAME, ' '), 1)))# text-white rounded-circle fw-bold text-uppercase">
#ucase(left(listLast(session.USERNAME, " "), 1))#
<div class="d-none d-flex align-items-center justify-content-center #getAvatarColorByLetter(ucase(left(listLast(session.username, ' '), 1)))# text-white rounded-circle fw-bold text-uppercase"
style="width:3rem;height:3rem;">
#ucase(left(listLast(session.username, " "), 1))#
</div>
<div class="flex-grow-1 gap-2 d-flex justify-content-between align-items-center">
<input class="form-control" type="hidden" name="blogId" id="blogId" value="#blog.Id#">
Expand Down