var results = application.ptBlog2.CSContent.populateContent("comments", arguments.data);
var results = arrayNew(1);
var filteredResults = ArrayNew(1);
var elementName = application.ptBlog2.ceData.getCENameByFormID(arguments.formID);
/* if ( arguments.approvedOnly ) {
results = application.ptBlog2.ceData.getCEdata(customElementName=elementName,
searchFields="contentPageID,approved",
searchValues="arguments.contentPageID,1",
queryType="multi");
}
else */
results = application.ptBlog2.ceData.getCEdata(elementName, "contentPageID", arguments.contentPageID);
if ( arguments.approvedOnly ) {
// If need to display only the "approved" comments, then loop over the records
for (i=1; i LTE ArrayLen(results); i++){
if ( results[i].values.approved EQ 1 )
ArrayAppend(filteredResults, results[i]);
}
}
else
filteredResults = results;
if( len(arguments.sortBy) )
results = application.ptBlog2.ceData.arrayOfCEDataSort(filteredResults, arguments.sortBy, arguments.sortOrder);
var currItm = "";
var commentPageIDList = "";
// Get the comments for the blog post
var commentsFormID = application.ptBlog2.getCommentsFormID();
var commentData = getCommentsByContentID(contentPageID=arguments.postID, formID=commentsFormID);