Skip to content

Content Command Word

createDraft

php
\FresnsCmdWord::plugin('Fresns')->createDraft($wordBody);
Parameter NameTypeRequiredPost DescriptionComment Description
uidNumberrequiredUser UID
typeNumberrequired1 Post2 Comment
createTypeNumberrequiredCreation Type 1. Quick Create 2. Editor Create
editorFskeyStringoptionalIs it a plugin editor? Empty means no
postGidStringoptionalGroup, default selected groupPost specific
postTitleStringoptionalTitle, default with titlePost specific
postIsCommentDisabledBooleanNOWhether comments are disabledPost-specific
postIsCommentPrivateBooleanNOWhether the comment is private
Visible only to the comment author and post author
Post-specific
postQuotePidStringoptionalQuoted post PID
Not required
Post specific
commentPidStringoptionalComment specificWhich post to comment, required
commentCidStringoptionalComment specificLeave empty to comment on the post
If there is a value, it means to reply to this comment
contentStringoptionalMain content, default with content
isMarkdownBooleanoptionalIs the content in MD format?
isAnonymousBooleanoptionalIs it anonymous?
mapObjectoptionalLocation information
extendsArrayoptionalExtended content
archivesArrayoptionalExtended parameters
Return Example
json
{
    "code": 0,
    "message": "ok",
    "data": {
        "type": 1, // 1.Post 2.Comment
        "logId": "post_logs->id" // or comment_logs->id
    }
}

generateDraft

php
\FresnsCmdWord::plugin('Fresns')->generateDraft($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
fsidStringoptionalPost posts->pid
Comment comments->cid
  • Revert published formal content to an editable draft.
  • Comments do not support descendant-level comments, only first-level comments can generate drafts.
Return Example
json
{
    "code": 0,
    "message": "ok",
    "data": {
        "type": 1, // 1.Post 2.Comment
        "logId": "post_logs->id", // or comment_logs->id
        "editableStatus": true, // Whether it is editable
        "editableTime": "03:00", // Remaining editable duration, 3 minutes left
        "deadlineTime": "2022-07-01 15:05:00" // The specific date and time remaining for editing
    }
}

contentPublishByDraft

php
\FresnsCmdWord::plugin('Fresns')->contentPublishByDraft($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
logIdNumberrequiredPost post_logs->id
Comment comment_logs->id
Return Example
json
{
    "code": 0,
    "message": "ok",
    "data": {
        "type": 1, // 1.Post 2.Comment
        "id": "posts->id", // or comments->id
        "fsid": "posts->pid" // or comments->cid
    }
}

contentQuickPublish

php
\FresnsCmdWord::plugin('Fresns')->contentQuickPublish($wordBody);
Parameter NameTypeRequiredPost DescriptionComment Description
uidNumberrequiredUser UID
typeNumberrequired1 Post2 Comment
postGidStringoptionalGroup, default selected groupPost specific
postTitleStringoptionalTitle, default with titlePost specific
postIsCommentDisabledBooleanNOWhether comments are disabledPost-specific
postIsCommentPrivateBooleanNOWhether the comment is private
Visible only to the comment author and post author
Post-specific
postQuotePidStringoptionalQuoted post PID
Not required
Post specific
commentPidStringoptionalComment specificWhich post to comment, required
commentCidStringoptionalComment specificLeave empty to comment on the post
If there is a value, it means to reply to this comment
contentStringoptionalMain content, default with content
isMarkdownBooleanoptionalIs the content in MD format?
isAnonymousBooleanoptionalIs it anonymous?
mapObjectoptionalLocation information
extendsArrayoptionalExtended content
archivesArrayoptionalExtended parameters
requireReviewBooleanoptionalWhether review is required
Default to false, meaning no review is needed
Whether review is required
Default to false, meaning no review is needed
Return Example
json
{
    "code": 0,
    "message": "ok",
    "data": {
        "type": 1, // 1.Post 2.Comment
        "logId": "post_logs->id", // or comment_logs->id
        "id": "posts->id", // or comments->id
        "fsid": "posts->pid" // or comments->cid
    }
}

logicalDeletionContent

php
\FresnsCmdWord::plugin('Fresns')->logicalDeletionContent($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
contentTypeNumberrequired1.Main table content 2.Log table contents
contentFsidStringoptionalcontentType=1 specific: Post pidComment cid
contentLogIdNumberoptionalcontentType=2 specific: Log table primary id

This command word is a full logical deletion. If the business scenario involves a withdrawal function, do not use it to avoid processing too much data during recovery.

physicalDeletionContent

php
\FresnsCmdWord::plugin('Fresns')->physicalDeletionContent($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
contentTypeNumberrequired1.Main table content 2.Log table contents
contentFsidStringoptionalcontentType=1 specific: Post pidComment cid
contentLogIdNumberoptionalcontentType=2 specific: Log table primary id

addContentMoreInfo

php
\FresnsCmdWord::plugin('Fresns')->addContentMoreInfo($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
fsidStringrequiredpid or cid
keyStringrequiredmoreJson key
valueString/Number/ArrayrequiredmoreJson value
View Examples
php
$wordBody = [
    'type' => 1,
    'fsid' => 'fresns-post',
    'key' => 'ipLocation',
    'value' => 'Singapore',
];

$wordBody = [
    'type' => 1,
    'fsid' => 'fresns-post',
    'key' => 'deviceName',
    'value' => 'iPhone',
];

setContentSticky

php
\FresnsCmdWord::plugin('Fresns')->setContentSticky($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
fsidStringrequiredpid or cid
stateNumberrequiredPost: 1.No / 2.Group Sticky / 3.Global Sticky
Comment: 1.No / 2.Sticky

setContentDigest

php
\FresnsCmdWord::plugin('Fresns')->setContentDigest($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
fsidStringrequiredpid or cid
stateNumberrequired1.No / 2.General Digest / 3.Premium Digest

setContentCloseDelete

php
\FresnsCmdWord::plugin('Fresns')->setContentCloseDelete($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequired1.Post 2.Comment
fsidStringrequiredpid or cid
canDeleteBooleanrequired0.Cannot be deleted 1.Can be deleted

setPostAuth

php
\FresnsCmdWord::plugin('Fresns')->setPostAuth($wordBody);
Parameter NameTypeRequiredDescription
pidStringrequired
typeStringrequiredadd or remove
uidNumberoptionalSpecify user
ridNumberoptionalSpecify role
  • Choose one between uid and rid to pass as a parameter

setPostAffiliateUser

php
\FresnsCmdWord::plugin('Fresns')->setPostAffiliateUser($wordBody);
Parameter NameTypeRequiredDescription
pidStringrequired
typeStringrequiredadd or remove
uidNumberrequiredSpecify user
fskeyStringrequiredPlugin Fskey
moreJsonJsonoptionalAdditional record information (Json)

setCommentExtendButton

php
\FresnsCmdWord::plugin('Fresns')->setCommentExtendButton($wordBody);
Parameter NameTypeRequiredDescription
cidStringrequired
closeBooleanoptionalfalse disables extension button
true enables extension button
changeStringoptionaldefault Default
active Two-state
activeNameKeyStringoptionalFor change=active only, leave blank for no change
Passing configuration table configs->item_key can adapt to multiple languages
activeStyleStringoptionalFor change=active only, leave blank for no change
primary, secondary, success, danger, warning, info
  • Choose one between close and change to pass as a parameter

Released under the Apache-2.0 License