this.ElementName = "Forum User Settings";
this.CCAPIName = "ForumUserSettings";
this.ElementIDfield = "usersettingsID";
var usersettingsStruct = StructNew();
var usersettingsArray = Application.ptForum.ceData.getCEData(this.ElementName,"ProfileID",arguments.ProfileID);
if ( ArrayLen(usersettingsArray) )
usersettingsStruct = usersettingsArray[1];
var usersettingsStruct = getUserSettingInfoByProfileID(TRIM(arguments.ProfileID));
var msgqty = 0;
//Application.ADF.utils.doDump(usersettingsStruct.values,"usersettingsStruct",0);
if ( structKeyExists(usersettingsStruct,"values")
AND structKeyExists(usersettingsStruct.values,"messageQty")
AND IsNumeric(usersettingsStruct.values.messageQty)
)
{
msgqty = usersettingsStruct.values.messageQty;
}
var usersettingsStruct = getUserSettingInfoByProfileID(TRIM(arguments.ProfileID));
var userjoindatetime = "";
if ( structKeyExists(usersettingsStruct,"values")
AND structKeyExists(usersettingsStruct.values,"UserJoinDateTime")
AND LEN(TRIM(usersettingsStruct.values.UserJoinDateTime))
)
{
if ( NOT IsDate(userjoindatetime) )
userjoindatetime = Application.CS.data.FROMHTML(usersettingsStruct.values.UserJoinDateTime);
if ( NOT IsDate(userjoindatetime) )
userjoindatetime = "";
}
var usersettingsStruct = StructNew();
var usersettingsArray = Application.ptForum.ceData.getCEData(this.ElementName,"UserSettingsID",arguments.UserSettingsID);
if ( ArrayLen(usersettingsArray) )
usersettingsStruct = usersettingsArray[1];
var profileStruct = StructNew();
var retStatusStruct = StructNew();
var dataValues = StructNew();
retStatusStruct["msg"] = "failed";
profileStruct = getUserSettingInfoByProfileID(TRIM(arguments.ProfileID));
dataValues = profileStruct.values;
dataValues.dataPageID = profileStruct.PageID;
dataValues.messageQty = arguments.MsgQty;
dataValues.lastpostMsgID = arguments.lastPostMsgID;
dataValues.lastpostDateTime = arguments.lastPostDateTime;
retStatusStruct = usersettingsCCAPI(dataValues);
// Check if the user is in the Forum User Settings CE
var forumUserArray = Application.ptForum.CEData.getCEData(this.ElementName,"profileID", arguments.profileID);
var dataStruct = StructNew();
var retStruct = StructNew();
var newuserStatus = StructNew();
// Check if no record exists
if ( NOT ArrayLen(forumUserArray) ) {
// Create the record for the Forum User Settings
dataStruct.userSettingsID = createUUID();
dataStruct.profileID = arguments.profileID;
dataStruct.UserJoinDateTime = now();
dataStruct.messageQty = 0;
// Create the user record
retStruct = usersettingsCCAPI(dataStruct);
if ( retStruct['CONTENTUPDATED'] IS true )
newuserStatus['USERCREATED'] = 'success';
else
newuserStatus['USERCREATED'] = 'fail';
} else {
newuserStatus['USERCREATED'] = 'exists';
}
return newuserStatus;
var retStatusStruct = "failed";
// Create the CS Content CFC
var csContent = server.ADF.objectFactory.getBean("CSContent_1_0");
//application.ADF.utils.doDump(arguments.dataValues,"arguments.dataValues", false);
// Create the page
retStatusStruct = csContent.populateContent(this.CCAPIName, arguments.dataValues);
/* retStatusStruct RETURNS: CONTENTUPDATED : true/false & CONTENTUPDATERESPONSE: Success:1 */