# Social
This section provide social functions such as ability to like/unlike a post, ability to follow and unfollow a member in the community.
# thank_post
Function:
| Function Name | Description | Level |
|---|---|---|
| thank_post | Send Thank You to a specific post. This function is used in conjunction with "can_thank" in "get_thread" function. E.g. user cannot thank to his own post and thanks to the same post multiple times. For plugin developer, please also implement "thank_count" in "get_topic", "get_unread_topic", "get_participated_topic", "get_latest_topic", "get_user_topic", "search_topic" and "get_thread" function to indicate how many times this entire topic has been "Thanked". |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| post_id | String | yes |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| result | Boolean | yes | Return "true" if the action is executed successfully. "false" otherwise. | |
| result_text | byte[] | Message to be displayed to user after this action is executed. Optional. |
# follow
Function:
| Function Name | Description | Level |
|---|---|---|
| follow | Allows user to follow a specific person |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| user_id | String | yes |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| result | Boolean | yes | Return "true" if the action is executed successfully. "false" otherwise. | |
| result_text | byte[] | Message to be displayed to user after this action is executed. Optional. |
# unfollow
Function:
| Function Name | Description | Level |
|---|---|---|
| unfollow | Allows user to unfollow a specific person |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| user_id | String | yes |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| result_text | byte[] | Message to be displayed to user after this action is executed. Optional. | ||
| result | Boolean | yes | Return "true" if the action is executed successfully. "false" otherwise. |
# like_post
Function:
| Function Name | Description | Level |
|---|---|---|
| like_post | Send Like to a specific post. This function is used in conjunction with "can_like" and "is_liked"in "get_thread" function. E.g. user cannot "Like" to his own post (using "can_like" to determine) and "Like" to the same post multiple times (using "is_liked" to determine). For plugin developer, please also implement "like_count" in "get_topic", "get_unread_topic", "get_participated_topic", "get_latest_topic", "get_user_topic", "search_topic" and "get_thread" function to indicate how many times this topic was been liked |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| post_id | String | yes |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| result | Boolean | yes | Return "true" if the action is executed successfully. "false" otherwise. | |
| result_text | byte[] | Message to be displayed to user after this action is executed. Optional. |
# unlike_post
Function:
| Function Name | Description | Level |
|---|---|---|
| unlike_post | Undo a Like to a specific post. This function is used in conjunction with "can_like" and "is_liked"in "get_thread" function. E.g. user cannot "Unlike" to his own post (using "can_like" to determine) and cannot "Unike" to the post he has never been liked before (using "is_liked" to determine). |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| post_id | String | yes |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| result | Boolean | yes | Return "true" if the action is executed successfully. "false" otherwise. | |
| result_text | byte[] | Message to be displayed to user after this action is executed. Optional. |
# get_dashboard
Function:
| Function Name | Description | Level |
|---|---|---|
| get_dashboard | return Alerts, News Feed and Likes all in one function | XenForo Only |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| alert_mark_read | Boolean | If this parameter is true, mark all alert as read. |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| total_likes | Int | yes | returns total number of likes received | |
| new_alerts | Int | yes | Yes returns total number of new alerts | |
| alerts | Array of Hash table | yes | returns an array of alerts received. See below. | |
| new_alert | Boolean | To indicate whether this alert is an unread alert. | ||
| icon_url | String | an avatar/thumbnail URL to be displayed in the app. | ||
| post_id | String | The post associated with this alert. | ||
| topic_id | String | yes | The topic associated with this alert. | |
| username | byte[] | yes | The user associated with this alert | |
| message | byte[] | yes | Message to be displayed in the app about this feed. This message can support BBCode style tag. Supported tags are [USERNAME], [TOPIC], [POST] and [URL]. E.g. a message "[USERNAME]JohnSmith[/USERNAME] likes your post [POST]Will there be Tapatalk support?[/POST]", the app will convert both username and post into a clickable link, with the keys "username" and "post_id" returned to be used by the app to handling the landing. | |
| short_content | byte[] | yes | A short text related to this alert. | |
| post_time | Date | yes | dateTime.iso8601 format. The date/time of this alert. | |
| timestamp | String | yes | Timstamp of this alert. | |
| feed | Array of Hash table | yes | returns an array of News Feed. See below. | |
| icon_url | String | an avatar/thumbnail URL to be displayed in the app. | ||
| post_id | String | The post associated with this feed. | ||
| topic_id | String | yes | The topic associated with this feed. | |
| username | byte[] | yes | The user associated with this feed | |
| message | byte[] | Message to be displayed in the app about this feed. This message can support BBCode style tag. Supported tags are [USERNAME], [TOPIC], [POST] and [URL]. E.g. a message "[USERNAME]JohnSmith[/USERNAME] likes your post [POST]Will there be Tapatalk support?[/POST]", the app will convert both username and post into a clickable link, with the keys "username" and "post_id" returned to be used by the app to handling the landing. | ||
| short_content | byte[] | yes | A short text related to this feed. | |
| timestamp | String | yes | Timestamp of this feed. | |
| post_time | Date | yes | dateTime.iso8601 format. The date/time of this feed. | |
| likes | Array of Hash table | yes | returns an array of likes received. See below. | |
| icon_url | String | an avatar/thumbnail URL to be displayed in the app. | ||
| post_id | String | The post of which the user has liked | ||
| topic_id | String | The topic of which the user has liked | ||
| username | byte[] | yes | he topic of which the user has liked | |
| message | byte[] | Message to be displayed in the app about this Likes. E.g. JohnSmith liked your post in the thread "Will there be Tapatalk support?" | ||
| short_content | byte[] | yes | A short text related to the Likes, usually the post content that the user has posted and liked. | |
| timestamp | String | yes | Timestamp of the post has "liked" | |
| post_time | Date | yes | dateTime.iso8601 format. The date/time the post has "liked" |
# get_feed
Function:
| Function Name | Description | Level |
|---|---|---|
| get_feed | return a list of recent feed for a specific user. | XenForo Only |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| user_id | String | 4 |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| feed | Array of Hash table | yes | returns an array of News Feed. See below. | |
| post_id | String | yes | The post associated with this feed. | |
| topic_id | String | yes | The topic associated with this feed. | |
| message | byte[] | yes | Message to be displayed in the app about this feed. This message can support BBCode style tag. Supported tags are [USERNAME], [TOPIC], [POST] and [URL]. E.g. a message "[USERNAME]JohnSmith[/USERNAME] likes your post [POST]Will there be Tapatalk support?[/POST]", the app will convert both username and post into a clickable link, with the keys "username" and "post_id" returned to be used by the app to handling the landing. | |
| short_content | byte[] | yes | A short text related to this feed. | |
| post_time | Date | yes | dateTime.iso8601 format. The date/time of this feed. | |
| timestamp | String | yes | Timestamp of this feed. |
# get_following
Function:
| Function Name | Description | Level |
|---|---|---|
| get_following | Returns a list of person this user follows to. | 4 |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| total_count | Int | yes | number of members | 4 |
| list | Array of Hash table | yes | 4 | |
| user_id | String | yes | 4 | |
| username | byte[] | yes | 4 | |
| display_text | byte[] | free text to be displayed under the user name in the online list. E.g. in vBulletin it can display what the user is currently doing. | 4 | |
| is_online | Boolean | return true if this user is currently online. | 4 |
# get_follower
Function:
| Function Name | Description | Level |
|---|---|---|
| get_follower | Returns a list of person this user follows to. | 4 |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| total_count | Int | yes | 4 | |
| list | Array of Hash table | yes | 4 | |
| user_id | String | yes | 4 | |
| username | byte[] | yes | 4 | |
| display_text | byte[] | free text to be displayed under the user name in the online list. E.g. in vBulletin it can display what the user is currently doing. | 4 | |
| is_online | Boolean | return true if this user is currently online. | 4 |
# set_reputation
Function:
| Function Name | Description | Level |
|---|---|---|
| set_reputation | Reputation system provides a way of rating users based on the quality of their posts. Users can add or subtract reputation points from other users. This is a vB4 feature | 4 |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| user_id | String | yes | 4 | |
| mode | String | yes | "ADD" or "SUBTRACT" | 4 |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| result | Boolean | yes | 4 | |
| result_text | byte[] | 4 |
# get_alert
Function:
| Function Name | Description | Level |
|---|---|---|
| get_alert | Return alerts of Current user. Like someone quoted or liked your post, or replied to your subscribed topic, or created new topic in you subscribed forum, etc. Flag 'get_alert' will be returned in get_config to indicate if the plugin support this function. |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| page | Int | default to be 1 | ||
| perpage | Int | default to be 20 |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| total | Int | yes | Total alerts number | |
| items | Array of Hash table | yes | ||
| user_id | String | yes | Id of user who triggered this alert | |
| username | byte[] | yes | Name of user who triggered this alert | |
| icon_url | String | yes | Avatar url of user who triggered this alert | |
| message | byte[] | yes | alert message, like ('test' replied to thread 'test thread') | |
| timestamp | String | yes | timestamp of alert trigger time | |
| content_type | String | yes | Alert type, like post or user or pm | |
| content_id | String | yes | Id of the alert content (It will always be post id if the target is thread) | |
| topic_id | String | Topic id if the target is a thread. | ||
| position | Int | For conversation only, indicate the position of the new message in conversation | ||
| unread | Boolean | Indicate if the content is unread |
# get_activity
Function:
| Function Name | Description | Level |
|---|---|---|
| get_activity | Get global Activity Stream of the forum. Normally it's not related to current user. This function was designed for guest user. As login member, get_alert will be a better method. Flag 'get_activity' will be returned in get_config to indicate if the plugin support this function. |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| page | Int | default to be 1 | ||
| perpage | Int | default to be 20 |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| total | Int | yes | Total activity number | |
| items | Array of Hash table | yes | Activity Stream content details | |
| user_id | String | yes | Id of user who triggered this activity | |
| username | byte[] | yes | Name of user who triggered this activity | |
| icon_url | String | yes | Avatar url of user who triggered this activity | |
| message | byte[] | yes | Activity message, like ('test' started a new thread 'test thread') | |
| timestamp | String | yes | timestamp of activity trigger time | |
| content_type | String | yes | activity type, like post or thread | |
| content_id | String | yes | Id of the activity content |
# add_post_emotion
Function:
| Function Name | Description | Level |
|---|---|---|
| add_post_emotion | add post emotion |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| post_id | String | yes | ||
| emotion_type | String | yes | emotion type like 'like,dislike' |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| highlight | Boolean | yes | Return if it need to be highlight | |
| total | Int | yes | total number of users | |
| refresh | Array of Hash table | Return if it need to be refresh | ||
| emotion_type | String | Return emotion type like 'like,dislike' | ||
| total | Int | total number of users |
# get_emotion_user_list
Function:
| Function Name | Description | Level |
|---|---|---|
| get_emotion_user_list | Return a list of users data by giving emotion type and post_id |
Input Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| post_id | String | yes | ||
| emotion_type | String | yes | emotion type like 'like,dislike' | |
| start_num | Int | start number defalut 0 | ||
| end_num | Int | end num defalut 5 |
Output Parameters:
| Name | Type | Required? | Description | Level |
|---|---|---|---|---|
| items | Array of Hash table | yes | ||
| username | byte[] | yes | User display name | |
| user_id | String | yes | User id | |
| avatar | String | yes | avatar url |
← Attachment Moderation →