Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 435262f

Browse files
committed
wip
1 parent 1227593 commit 435262f

8 files changed

Lines changed: 27 additions & 27 deletions

File tree

app/controllers/Controller.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ component extends="wheels.Controller" {
101101
// Shared business logic across multiple controllers
102102
public function getBlogBySlug(required string slug) {
103103
return model("Blog").findOne(
104-
where="blog_posts.slug = '#arguments.slug#' AND status ='Approved' AND isPublished IS TRUE ",
104+
where="blog_posts.slug = '#arguments.slug#' AND status ='Approved' AND isPublished = 1 ",
105105
include="User,PostStatus",
106106
cache=10
107107
);

app/controllers/admin/AdminController.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,8 @@ component extends="app.Controllers.Controller" {
655655
blogJsonData = serializeJSON(blogChartData);
656656

657657
totalComments = model("comment").count();
658-
totalPublishComments = model("comment").count(where="isPublished IS TRUE");
659-
totalUnPublishComments = model("comment").count(where="isPublished IS FALSE");
658+
totalPublishComments = model("comment").count(where="isPublished = 1");
659+
totalUnPublishComments = model("comment").count(where="isPublished = 0");
660660

661661
last_7Days_Comments = queryExecute("
662662
SELECT TO_CHAR(d::date, 'YYYY-MM-DD') AS day,

app/controllers/web/BlogController.cfc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ component extends="app.Controllers.Controller" {
271271
private function getBlogsByAuthor(required authorId, numeric page=1, numeric perPage=6, boolean isInfiniteScroll=false) {
272272
var result = {
273273
query = model("Blog").findAll(
274-
where="statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE AND createdBy = #authorId#",
274+
where="statusid <> 1 AND status = 'Approved' AND isPublished = 1 AND createdBy = #authorId#",
275275
include="User",
276276
order="postDate DESC",
277277
page = arguments.page,
@@ -282,7 +282,7 @@ component extends="app.Controllers.Controller" {
282282
};
283283

284284
result.totalCount = model("Blog").count(
285-
where="statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE AND createdBy = #authorId#"
285+
where="statusid <> 1 AND status = 'Approved' AND isPublished = 1 AND createdBy = #authorId#"
286286
);
287287
result.hasMore = (page * perPage) < result.totalCount;
288288

@@ -324,7 +324,7 @@ component extends="app.Controllers.Controller" {
324324

325325
if (len(trim(searchTerm))) {
326326
var query = model("blog").findAll(
327-
where="status ='Approved' AND isPublished IS TRUE
327+
where="status ='Approved' AND isPublished = 1
328328
AND (slug LIKE '%#searchTerm#%' OR title LIKE '%#searchTerm#%' OR content LIKE '%#searchTerm#%' OR fullname LIKE '%#searchTerm#%' OR email LIKE '%#searchTerm#%')",
329329
include="User, PostStatus, PostType",
330330
order = "postDate DESC",
@@ -335,7 +335,7 @@ component extends="app.Controllers.Controller" {
335335
if (isInfiniteScroll) {
336336
totalCount = model("blog").count(
337337
include="User, PostStatus, PostType",
338-
where="status ='Approved' AND isPublished IS TRUE
338+
where="status ='Approved' AND isPublished = 1
339339
AND (slug LIKE '%#searchTerm#%' OR title LIKE '%#searchTerm#%' OR content LIKE '%#searchTerm#%' OR fullname LIKE '%#searchTerm#%' OR email LIKE '%#searchTerm#%')"
340340
);
341341
hasMore = (page * perPage) < totalCount;
@@ -363,7 +363,7 @@ component extends="app.Controllers.Controller" {
363363
}
364364
// Function to load categories for the blog list
365365
function categories() {
366-
categorylist = model("Category").findAll(where="isActive IS TRUE", cache=60);
366+
categorylist = model("Category").findAll(where="isActive = 1", cache=60);
367367
renderPartial(partial="partials/categorylist");
368368
}
369369

@@ -731,7 +731,7 @@ component extends="app.Controllers.Controller" {
731731
public function feed() {
732732
// Fetch all blogs
733733
blogPosts = model("Blog").findAll(
734-
where="status = 'Approved' AND isPublished IS TRUE",
734+
where="status = 'Approved' AND isPublished = 1",
735735
include="User",
736736
order="postDate DESC",
737737
cache=10
@@ -744,7 +744,7 @@ component extends="app.Controllers.Controller" {
744744
public function commentsFeed() {
745745
// Get recent comments with related blog post
746746
comments = model("Comment").findAll(
747-
where = "isPublished IS TRUE",
747+
where = "isPublished = 1",
748748
include = "Blog",
749749
order = "createdAt DESC",
750750
limit = 20,
@@ -788,7 +788,7 @@ component extends="app.Controllers.Controller" {
788788
private function getAllBlogs(numeric page=1, numeric perPage=6, boolean isInfiniteScroll=false) {
789789
var result = {
790790
query = model("Blog").findAll(
791-
where="statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE",
791+
where="statusid <> 1 AND status = 'Approved' AND isPublished = 1",
792792
include="User",
793793
order="postDate DESC",
794794
page = arguments.page,
@@ -800,7 +800,7 @@ component extends="app.Controllers.Controller" {
800800
};
801801

802802
result.totalCount = model("Blog").count(
803-
where="statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE",
803+
where="statusid <> 1 AND status = 'Approved' AND isPublished = 1",
804804
cache = 5
805805
);
806806
result.hasMore = (page * perPage) < result.totalCount;
@@ -815,7 +815,7 @@ component extends="app.Controllers.Controller" {
815815

816816
var result = {
817817
query = model("Blog").findAll(
818-
where="blog_posts.post_created_date BETWEEN '#startdate#' AND '#enddate#' AND blog_posts.status='Approved' AND blog_posts.isPublished IS TRUE",
818+
where="blog_posts.post_created_date BETWEEN '#startdate#' AND '#enddate#' AND blog_posts.status='Approved' AND blog_posts.isPublished = 1",
819819
order="postCreatedDate DESC",
820820
include="User",
821821
returnAs="query",
@@ -827,7 +827,7 @@ component extends="app.Controllers.Controller" {
827827
};
828828

829829
result.totalCount = model("Blog").count(
830-
where="blog_posts.post_created_date BETWEEN '#startdate#' AND '#enddate#' AND blog_posts.status='Approved' AND blog_posts.isPublished IS TRUE"
830+
where="blog_posts.post_created_date BETWEEN '#startdate#' AND '#enddate#' AND blog_posts.status='Approved' AND blog_posts.isPublished = 1"
831831
);
832832
result.hasMore = (page * perPage) < result.totalCount;
833833

@@ -850,7 +850,7 @@ component extends="app.Controllers.Controller" {
850850

851851
var result = {
852852
query = model("Blog").findAll(
853-
where="id IN (#arrayToList(blogIds)#) AND categoryId = '#category.id#' AND status ='Approved' AND isPublished IS TRUE",
853+
where="id IN (#arrayToList(blogIds)#) AND categoryId = '#category.id#' AND status ='Approved' AND isPublished = 1",
854854
order="createdAt DESC",
855855
include="User,BlogCategory",
856856
returnAs="query",
@@ -862,7 +862,7 @@ component extends="app.Controllers.Controller" {
862862
};
863863

864864
result.totalCount = model("Blog").count(
865-
where="id IN (#arrayToList(blogIds)#) AND categoryId = '#category.id#' AND status ='Approved' AND isPublished IS TRUE",
865+
where="id IN (#arrayToList(blogIds)#) AND categoryId = '#category.id#' AND status ='Approved' AND isPublished = 1",
866866
include="User,BlogCategory"
867867
);
868868
result.hasMore = (page * perPage) < result.totalCount;
@@ -874,7 +874,7 @@ component extends="app.Controllers.Controller" {
874874
private function getAllByTag(required string tag, numeric page=1, numeric perPage=6, boolean isInfiniteScroll=false) {
875875
var result = {
876876
query = model("Blog").findAll(
877-
where="name = '#tag#' AND status ='Approved' AND isPublished IS TRUE",
877+
where="name = '#tag#' AND status ='Approved' AND isPublished = 1",
878878
order="createdAt DESC",
879879
include="User,tag",
880880
returnAs="query",
@@ -885,7 +885,7 @@ component extends="app.Controllers.Controller" {
885885
totalCount = 0
886886
};
887887

888-
result.totalCount = model("Blog").count(where="name = '#tag#' AND status ='Approved' AND isPublished IS TRUE", include="User,tag");
888+
result.totalCount = model("Blog").count(where="name = '#tag#' AND status ='Approved' AND isPublished = 1", include="User,tag");
889889
result.hasMore = (page * perPage) < result.totalCount;
890890

891891
return result;
@@ -1250,7 +1250,7 @@ component extends="app.Controllers.Controller" {
12501250
}
12511251

12521252
function getAllCommentsByBlogid(required numeric id) {
1253-
var comments = model("Comment").findAll(include="User", where="isPublished IS TRUE AND blogid = '#arguments.id#' AND commentParentId ISNULL ", cache=5);
1253+
var comments = model("Comment").findAll(include="User", where="isPublished = 1 AND blogid = '#arguments.id#' AND commentParentId ISNULL ", cache=5);
12541254

12551255
return comments;
12561256
}
@@ -1300,7 +1300,7 @@ component extends="app.Controllers.Controller" {
13001300
response = saveComment(params);
13011301
}
13021302
if(structKeyExists(response, "Id")){
1303-
comments = commentModel.findAll(include="User", where="id ='#response.Id#' AND isPublished IS TRUE");
1303+
comments = commentModel.findAll(include="User", where="id ='#response.Id#' AND isPublished = 1");
13041304
renderPartial(partial="partials/comment");
13051305
}
13061306
} catch (any e) {

app/controllers/web/HomeController.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ component extends="app.Controllers.Controller" {
321321
});
322322

323323
// Add blog posts
324-
var blogPosts = model("Blog").findAll(where="statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE");
324+
var blogPosts = model("Blog").findAll(where="statusid <> 1 AND status = 'Approved' AND isPublished = 1");
325325
for (var post in blogPosts) {
326326
arrayAppend(urls, {
327327
loc: getBaseUrl() & "/blog/" & post.slug,
@@ -336,7 +336,7 @@ component extends="app.Controllers.Controller" {
336336
select="username",
337337
include="User",
338338
distinct="true",
339-
where="statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE AND createdBy IS NOT NULL"
339+
where="statusid <> 1 AND status = 'Approved' AND isPublished = 1 AND createdBy IS NOT NULL"
340340
);
341341
for (var author in authors) {
342342
arrayAppend(urls, {

app/controllers/web/NewsController.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ component extends="app.Controllers.Controller" {
4242
try {
4343
var blogQuery = model("Blog").findAll(
4444
select = "title, slug, content, postDate",
45-
where = "statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE",
45+
where = "statusid <> 1 AND status = 'Approved' AND isPublished = 1",
4646
order = "createdAt DESC",
4747
cache = 10
4848
);

app/controllers/web/TestimonialController.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ component extends="app.Controllers.Controller" {
1313
*/
1414
public void function publicList() {
1515
testimonials = model("Testimonial").findAll(
16-
where="isApproved IS TRUE",
16+
where="isApproved = 1",
1717
include="User",
1818
order="createdAt DESC"
1919
);

app/models/Comment.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ component extends="app.Models.Model" {
3030

3131
// fetch all comments
3232
public function getAllComments(){
33-
var comments = findAll(where="isPublished IS TRUE", include="User");
33+
var comments = findAll(where="isPublished = 1", include="User");
3434
return comments;
3535
}
3636
}

app/models/Testimonial.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ component extends="app.Models.Model" {
5050

5151
mergedOptions.append(options, true);
5252

53-
conditions = "isApproved IS TRUE AND displayPermission IS TRUE";
53+
conditions = "isApproved = 1 AND displayPermission = 1";
5454
if (mergedOptions.onlyFeatured) {
55-
conditions &= " AND isFeatured IS TRUE";
55+
conditions &= " AND isFeatured = 1";
5656
}
5757

5858
return model("Testimonial").findAll(

0 commit comments

Comments
 (0)