Skip to content

Content Command Word

createDraft

php
\FresnsCmdWord::plugin('Fresns')->createDraft($wordBody);
Parameter NameTypeRequiredDescription
uidNumberrequiredUser UID
typeNumberrequired1 Post 2 Comment
createTypeNumberrequiredCreation type 1 Quick create 2 Editor create
editorFskeyStringoptionalIs it a plugin editor, empty means no
commentPidStringoptionalComment-Only: Comment on this post
commentCidStringoptionalComment-Only: Reply to this comment
quotePidStringoptionalPost-Only: Quoted Post ID
gidStringoptionalPost-Only: Group
titleStringoptionalPost-Only: Title
contentStringoptionalContent
Insert the file in the content in the format [file:{fid}]
isMarkdownBooleanoptionalContent in MD format
isAnonymousBooleanoptionalAnonymous
commentPolicyNumberoptionalPost-Only: Who can comment?
1 Everyone 2 People you follow 3 People you follow or verified 4 No one is allowed 5 Only users you mention
commentPrivateBooleanoptionalPost Are all comments private
Comment Is this comment private
Private is only visible to the author of the comment and the author of the post.
gtidStringoptionalGeotag ID
locationInfoObjectoptionalLocation Info
archivesArrayoptionalArchive Parameter
extendsArrayoptionalExtend Content
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 NameTypeRequiredDescription
uidNumberrequiredUser UID
typeNumberrequired1 Post 2 Comment
commentPidStringoptionalComment-Only: Comment on this post
commentCidStringoptionalComment-Only: Reply to this comment
quotePidStringoptionalPost-Only: Quoted Post ID
gidStringoptionalPost-Only: Group
titleStringoptionalPost-Only: Title
contentStringoptionalContent
Insert the file in the content in the format [file:{fid}]
isMarkdownBooleanoptionalContent in MD format
isAnonymousBooleanoptionalAnonymous
commentPolicyNumberoptionalPost-Only: Who can comment?
1 Everyone 2 People you follow 3 People you follow or verified 4 No one is allowed 5 Only users you mention
commentPrivateBooleanoptionalPost Are all comments private
Comment Is this comment private
Private is only visible to the author of the comment and the author of the post.
gtidStringoptionalGeotag ID
locationInfoStringoptionalLocation Info Object to String
archivesStringoptionalArchive Parameter Array to String
extendsStringoptionalExtend Content Array to String
requireReviewBooleanoptionalWhether 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
keyStringrequiredmoreInfo key
valueString/Number/ArrayrequiredmoreInfo 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
moreInfoJsonoptionalAdditional record information (Json)

Released under the Apache-2.0 License