From 0a645d1128cda512feffac111245fccc36024b49 Mon Sep 17 00:00:00 2001 From: Justin Carter Date: Tue, 15 Oct 2013 22:10:08 +1100 Subject: [PATCH] initial commit --- customadmin/customadmin.xml | 15 ++ packages/forms/configBlog.cfc | 60 ++++++++ packages/types/blogCategory.cfc | 26 ++++ packages/types/blogPost.cfc | 33 ++++ webskin/blogCategory/displayBody.cfm | 18 +++ webskin/blogCategory/displaySystemFU.cfm | 12 ++ webskin/blogCategory/webtopBody.cfm | 14 ++ webskin/blogPost/displayBody.cfm | 43 ++++++ webskin/blogPost/displayComments.cfm | 27 ++++ webskin/blogPost/displayPageRSS.cfm | 59 +++++++ webskin/blogPost/displaySystemFU.cfm | 15 ++ webskin/blogPost/displayTypeBody.cfm | 18 +++ webskin/blogPost/webtopBody.cfm | 14 ++ .../webtopExportCommentsBlogCFC.cfm | 136 ++++++++++++++++ .../configBlog/webtopImportContentBlogCFC.cfm | 145 ++++++++++++++++++ 15 files changed, 635 insertions(+) create mode 100644 customadmin/customadmin.xml create mode 100644 packages/forms/configBlog.cfc create mode 100644 packages/types/blogCategory.cfc create mode 100644 packages/types/blogPost.cfc create mode 100644 webskin/blogCategory/displayBody.cfm create mode 100644 webskin/blogCategory/displaySystemFU.cfm create mode 100644 webskin/blogCategory/webtopBody.cfm create mode 100644 webskin/blogPost/displayBody.cfm create mode 100644 webskin/blogPost/displayComments.cfm create mode 100644 webskin/blogPost/displayPageRSS.cfm create mode 100644 webskin/blogPost/displaySystemFU.cfm create mode 100644 webskin/blogPost/displayTypeBody.cfm create mode 100644 webskin/blogPost/webtopBody.cfm create mode 100644 webskin/configBlog/webtopExportCommentsBlogCFC.cfm create mode 100644 webskin/configBlog/webtopImportContentBlogCFC.cfm diff --git a/customadmin/customadmin.xml b/customadmin/customadmin.xml new file mode 100644 index 0000000..0481aac --- /dev/null +++ b/customadmin/customadmin.xml @@ -0,0 +1,15 @@ + + +
+ + + + + + + + + + +
+
\ No newline at end of file diff --git a/packages/forms/configBlog.cfc b/packages/forms/configBlog.cfc new file mode 100644 index 0000000..69693f4 --- /dev/null +++ b/packages/forms/configBlog.cfc @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + function ftValidateUrlStem(objectid,typename,stFieldPost,stMetadata) { + var stResult = structNew(); + var oField = createObject("component", application.fapi.getPackagePath("formtools","field")); + + // url stem must not be empty and must begin with a slash + if (NOT len(arguments.stFieldPost.value)) { + arguments.stFieldPost.value = "/blog"; + } + else if (left(arguments.stFieldPost.value, 1) neq "/") { + arguments.stFieldPost.value = "/" & arguments.stFieldPost.value; + } + + stResult = oField.passed(value=arguments.stFieldPost.value); + return stResult; + } + + function ftValidateNumBlogPosts(objectid,typename,stFieldPost,stMetadata) { + var stResult = structNew(); + var oField = createObject("component", application.fapi.getPackagePath("formtools","field")); + + // numBlogPosts must be a number greater than 0 + if (NOT isNumeric(arguments.stFieldPost.value)) { + arguments.stFieldPost.value = 10; + } + else if (arguments.stFieldPost.value lt 1) { + arguments.stFieldPost.value = 10; + } + + stResult = oField.passed(value=arguments.stFieldPost.value); + return stResult; + } + + + + \ No newline at end of file diff --git a/packages/types/blogCategory.cfc b/packages/types/blogCategory.cfc new file mode 100644 index 0000000..0a4ced8 --- /dev/null +++ b/packages/types/blogCategory.cfc @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + SELECT objectid + FROM #application.dbowner#blogPost_aCategories + INNER JOIN #application.dbowner#blogPost ON (#application.dbowner#blogPost_aCategories.parentid = #application.dbowner#blogPost.objectid) + WHERE data = + ORDER BY posteddatetime DESC + + + + + + \ No newline at end of file diff --git a/packages/types/blogPost.cfc b/packages/types/blogPost.cfc new file mode 100644 index 0000000..6566dc3 --- /dev/null +++ b/packages/types/blogPost.cfc @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/webskin/blogCategory/displayBody.cfm b/webskin/blogCategory/displayBody.cfm new file mode 100644 index 0000000..33e5795 --- /dev/null +++ b/webskin/blogCategory/displayBody.cfm @@ -0,0 +1,18 @@ + + + + + + + + + + + +
+ +
+
+
+ + \ No newline at end of file diff --git a/webskin/blogCategory/displaySystemFU.cfm b/webskin/blogCategory/displaySystemFU.cfm new file mode 100644 index 0000000..6761e11 --- /dev/null +++ b/webskin/blogCategory/displaySystemFU.cfm @@ -0,0 +1,12 @@ + + + + + + + + + +#stem#/#alias# + + \ No newline at end of file diff --git a/webskin/blogCategory/webtopBody.cfm b/webskin/blogCategory/webtopBody.cfm new file mode 100644 index 0000000..962a648 --- /dev/null +++ b/webskin/blogCategory/webtopBody.cfm @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/webskin/blogPost/displayBody.cfm b/webskin/blogPost/displayBody.cfm new file mode 100644 index 0000000..32362cd --- /dev/null +++ b/webskin/blogPost/displayBody.cfm @@ -0,0 +1,43 @@ + + + + + + + + + + + + +

#stObj.title#

+ +
+ + #stObj.body# + +
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/webskin/blogPost/displayComments.cfm b/webskin/blogPost/displayComments.cfm new file mode 100644 index 0000000..fcbbe51 --- /dev/null +++ b/webskin/blogPost/displayComments.cfm @@ -0,0 +1,27 @@ + + + + + + + + + + +
+ +
+
+ + \ No newline at end of file diff --git a/webskin/blogPost/displayPageRSS.cfm b/webskin/blogPost/displayPageRSS.cfm new file mode 100644 index 0000000..59f59bf --- /dev/null +++ b/webskin/blogPost/displayPageRSS.cfm @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + +#xmlFormat(application.fapi.getConfig("general", "sitetitle"))# +#xmlFormat(oEnv.getCanonicalURL() & application.fapi.getConfig("blogfc", "urlStem"))# + +en-us +#xmlFormat(dateFormat(dateConvert("local2utc", now()), dateMask) & " " & timeFormat(dateConvert("local2utc", now()), timeMask))# +0000 +#xmlFormat(dateFormat(dateConvert("local2utc", now()), dateMask) & " " & timeFormat(dateConvert("local2utc", now()), timeMask))# +0000 +FarCry Blog +http://blogs.law.harvard.edu/tech/rss +#xmlFormat(application.fapi.getConfig("general", "adminemail"))# +#xmlFormat(application.fapi.getConfig("general", "adminemail"))# + + + + + + + #xmlFormat(stBlogPost.title)# + #xmlFormat(oEnv.getCanonicalURL() & application.fapi.getLink(type="blogPost", objectid=stBlogPost.objectid))# + #xmlFormat(stBlogPost.body)# + + #xmlFormat(qCategories.title)# + + #xmlFormat(dateFormat(dateConvert("local2utc", stBlogPost.posteddatetime), dateMask) & " " & timeFormat(dateConvert("local2utc", stBlogPost.posteddatetime), timeMask))# +0000 + #xmlFormat(oEnv.getCanonicalURL() & application.fapi.getLink(type="blogPost", objectid=stBlogPost.objectid))# + + + + + + + + + + + + + \ No newline at end of file diff --git a/webskin/blogPost/displaySystemFU.cfm b/webskin/blogPost/displaySystemFU.cfm new file mode 100644 index 0000000..941c601 --- /dev/null +++ b/webskin/blogPost/displaySystemFU.cfm @@ -0,0 +1,15 @@ + + + + + + + + + + + + +#stem#/#year#/#month#/#day#/#alias# + + \ No newline at end of file diff --git a/webskin/blogPost/displayTypeBody.cfm b/webskin/blogPost/displayTypeBody.cfm new file mode 100644 index 0000000..e847623 --- /dev/null +++ b/webskin/blogPost/displayTypeBody.cfm @@ -0,0 +1,18 @@ + + + + + + + + + + + +
+ +
+
+
+ + \ No newline at end of file diff --git a/webskin/blogPost/webtopBody.cfm b/webskin/blogPost/webtopBody.cfm new file mode 100644 index 0000000..725dc64 --- /dev/null +++ b/webskin/blogPost/webtopBody.cfm @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/webskin/configBlog/webtopExportCommentsBlogCFC.cfm b/webskin/configBlog/webtopExportCommentsBlogCFC.cfm new file mode 100644 index 0000000..0ffb7ff --- /dev/null +++ b/webskin/configBlog/webtopExportCommentsBlogCFC.cfm @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + SELECT id + FROM tblblogcomments + WHERE 1=1 + AND (moderated = 1 OR moderated IS NULL) + AND (subscribeonly = 0 OR subscribeonly IS NULL) + ORDER BY posted ASC + + + + " & cfcatch.detail> + + + + + + + + + + + + + + SELECT * + FROM tblblogcomments + WHERE 1=1 + AND entryidfk = '#qBlogPosts.objectid#' + AND (moderated = 1 OR moderated IS NULL) + AND (subscribeonly = 0 OR subscribeonly IS NULL) + ORDER BY posted ASC + + + + #xmlFormat(qBlogPosts.title)# + #xmlFormat(link)# + + #xmlFormat(qBlogPosts.objectid)# + #xmlFormat(dateFormat(qBlogPosts.posteddatetime, 'YYYY-MM-DD' ))# #xmlFormat(timeFormat(qBlogPosts.posteddatetime, 'HH:mm:ss' ))# + open + + + + #xmlFormat(qComments.id)# + #xmlFormat(qComments.name)# + #xmlFormat(qComments.email)#noreply@dummy.email + #xmlFormat(qComments.website)# + 127.0.0.1 + #xmlFormat(dateFormat(qComments.posted, 'YYYY-MM-DD' ))# #xmlFormat(timeFormat(qComments.posted, 'HH:mm:ss' ))# + + 10 + 0 + + + + + + + + + + + + + + + + + + + + +

Export Comments from BlogCFC

+ +

You can use this tool to export your old comments from a Blog CFC database.

+ +

Blog comments will be exported in a format suitable for uploading/importing to +Disqus. You can save the exported file, then log +in to your Disqus account and go to Admin > Discussions > Import > Generic (WXR) to perform the upload. +Also be sure to set your Disqus "shortname" in FarCry's Admin > Blog Configuration.

+ +

Note: You must run the Import Content from BlogCFC +before exporting comments so that the correct friendly URLs can be used in the export file.

+ + +
+ + +
+ + + +
+ + + +
+

Using DSN #form.blogcfcDSN#

+ + +

Error: #dsnError#

+ +

Ready to export...

+

+ Found #qBlogComments.recordCount# blog comments.
+

+ +

Export complete.

+ +

+
+
+
+
+ +
+ +
+ + \ No newline at end of file diff --git a/webskin/configBlog/webtopImportContentBlogCFC.cfm b/webskin/configBlog/webtopImportContentBlogCFC.cfm new file mode 100644 index 0000000..301ae6d --- /dev/null +++ b/webskin/configBlog/webtopImportContentBlogCFC.cfm @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + SELECT * + FROM tblblogcategories + ORDER BY categoryname DESC + + + SELECT * + FROM tblblogentries + + + + + + + +

+ Importing blog categories... + + + + + + + + + + + + Done.
+ + Importing blog entries... + + + + + + + + + + + + + + + + + + + SELECT categoryidfk + FROM tblblogentriescategories + WHERE entryidfk = '#qBlogPosts.id#' + + + + + SELECT relatedid + FROM tblblogentriesrelated + WHERE entryid = '#qBlogPosts.id#' + + + + + + Done. +

+

Import complete.

+
+
+ +
+ + + " & cfcatch.detail> + +
+ +
+ + + + +

Import Content from BlogCFC

+ +

You can use this tool to import your old content from a Blog CFC database.

+ +

Blog categories and blog entries will be imported into FarCry along with the original friendly URLs. +Pages and users will not be imported. After importing your content you can +Export Comments from BlogCFC in a format suitable for +uploading/importing to Disqus.

+ + +
+ + +
+ + + +
+ + + +
+

Using DSN #form.blogcfcDSN#

+ + +

Error: #dsnError#

+ +

Ready to import...

+

+ Found #qBlogCategories.recordCount# blog categories.
+ Found #qBlogPosts.recordCount# blog entries. +

+ + #migrateOutput# + +

+
+
+
+
+ +
+ +
+ + \ No newline at end of file