Skip to content

Commit

Permalink
Merge pull request #2 from Reboog711/jhouser/dev/merge-custom-code
Browse files Browse the repository at this point in the history
* Merged in my own BlogCFC Extension.
  • Loading branch information
Reboog711 authored Dec 30, 2018
2 parents 4bdd916 + 0740b51 commit 58cfdbf
Show file tree
Hide file tree
Showing 9 changed files with 927 additions and 308 deletions.
9 changes: 7 additions & 2 deletions client/Application.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ The prefix is now dynamic in case 2 people want to run blog.cfc on the same mach
<!--- load and init blog --->
<cfset application.blog = createObject("component","org.camden.blog.blog").init(blogname)>

<!--- Do we need to run the installer? --->
<cfset application.downloadTracker = createObject("component","org.camden.blog.downloadtracker").init()>

<!--- Do we need to run the installer? --->
<cfif application.blog.getProperty("installed") is 0>
<cflocation url="./installer/index.cfm?blog=#urlEncodedFormat(blogname)#" addToken="false">
</cfif>
Expand Down Expand Up @@ -132,13 +134,16 @@ The prefix is now dynamic in case 2 people want to run blog.cfc on the same mach
<!--- Do we allow settings in the admin? --->
<cfset application.settings = application.blog.getProperty("settings")>

<cfset application.tableprefix = application.blog.getProperty("tableprefix")>

<!--- load pod --->
<cfset application.pod = createObject("component", "org.camden.blog.pods")>

<!--- Finally, do a DSN check --->
<!--- We end up throwing away this call, but it should be lightweight --->
<cfset foo = application.blog.getNameForUser(createUUID())>



<!--- We are initialized --->
<cfset application.init = true>

Expand Down
38 changes: 19 additions & 19 deletions client/admin/stats.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

<cfquery name="getTotalSubscribers" datasource="#dsn#" username="#username#" password="#password#">
select count(email) as totalsubscribers
from tblblogsubscribers
where tblblogsubscribers.blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
from #application.tableprefix#tblBlogSubscribers
where #application.tableprefix#tblBlogSubscribers.blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
and verified = 1
</cfquery>

Expand Down Expand Up @@ -66,22 +66,22 @@
</cfquery>

<cfquery name="getTotalComments" datasource="#dsn#" username="#username#" password="#password#">
select count(tblblogcomments.id) as totalcomments
from tblblogcomments, tblblogentries
where tblblogcomments.entryidfk = tblblogentries.id
select count(#application.tableprefix#tblBlogComments.id) as totalcomments
from #application.tableprefix#tblBlogComments, tblblogentries
where #application.tableprefix#tblBlogComments.entryidfk = tblblogentries.id
and tblblogentries.blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
<cfif application.commentmoderation>
and tblblogcomments.moderated = 1
and #application.tableprefix#tblBlogComments.moderated = 1
</cfif>
</cfquery>

<!--- gets num of entries per category --->
<cfquery name="getCategoryCount" datasource="#dsn#" username="#username#" password="#password#">
select categoryid, categoryname, count(categoryidfk) as total
from tblblogcategories, tblblogentriescategories
where tblblogentriescategories.categoryidfk = tblblogcategories.categoryid
and tblblogcategories.blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
group by tblblogcategories.categoryid, tblblogcategories.categoryname
from #application.tableprefix#tblBlogCategories, #application.tableprefix#tblBlogEntriesCategories
where #application.tableprefix#tblBlogEntriesCategories.categoryidfk = #application.tableprefix#tblBlogCategories.categoryid
and #application.tableprefix#tblBlogCategories.blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
group by #application.tableprefix#tblBlogCategories.categoryid, #application.tableprefix#tblBlogCategories.categoryname
<cfif dbtype is not "msaccess">
order by total desc
<cfelse>
Expand All @@ -93,7 +93,7 @@
<cfquery name="topCommentedEntries" datasource="#dsn#" username="#username#" password="#password#">
select
<cfif not listFindNoCase("mysql,oracle",dbtype)>top 10 </cfif>
tblblogentries.id, tblblogentries.title, count(tblblogcomments.id) as commentcount
tblblogentries.id, tblblogentries.title, count(#application.tableprefix#tblBlogComments.id) as commentcount
from tblblogentries, tblblogcomments
where tblblogcomments.entryidfk = tblblogentries.id
<cfif dbtype is "oracle">
Expand All @@ -117,20 +117,20 @@
<cfquery name="topCommentedCategories" datasource="#dsn#" username="#username#" password="#password#">
select
<cfif not listFindNoCase("mysql,oracle",dbtype)>top 10 </cfif>
tblblogcategories.categoryid,
tblblogcategories.categoryname,
#application.tableprefix#tblBlogCategories.categoryid,
#application.tableprefix#tblBlogCategories.categoryname,
count(tblblogcomments.id) as commentcount
from tblblogcategories, tblblogcomments, tblblogentriescategories
where tblblogcomments.entryidfk = tblblogentriescategories.entryidfk
from #application.tableprefix#tblBlogCategories, tblblogcomments, #application.tableprefix#tblBlogEntriesCategories
where tblblogcomments.entryidfk = #application.tableprefix#tblBlogEntriesCategories.entryidfk
<cfif dbtype is "oracle">
and rownum <= 10
</cfif>
and tblblogentriescategories.categoryidfk = tblblogcategories.categoryid
and tblblogcategories.blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
and #application.tableprefix#tblBlogEntriesCategories.categoryidfk = #application.tableprefix#tblBlogCategories.categoryid
and #application.tableprefix#tblBlogCategories.blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
<cfif application.commentmoderation>
and tblblogcomments.moderated = 1
</cfif>
group by tblblogcategories.categoryid, tblblogcategories.categoryname
group by #application.tableprefix#tblBlogCategories.categoryid, #application.tableprefix#tblBlogCategories.categoryname
<cfif dbtype is not "msaccess">
order by commentcount desc
<cfelse>
Expand All @@ -143,7 +143,7 @@
select
<cfif not listFindNoCase("mysql,oracle",dbtype)>top 10 </cfif>
searchterm, count(searchterm) as total
from tblblogsearchstats
from #application.tableprefix#tblBlogSearchStats
where blog = <cfqueryparam cfsqltype="cf_sql_varchar" value="#blog#">
<cfif dbtype is "oracle">
and rownum <= 10
Expand Down
Loading

0 comments on commit 58cfdbf

Please sign in to comment.