vB_Api_Node
extends vB_Api
in package
vB_Api_Node
Table of Contents
Constants
- DATE_RANGE_DAILY = 'daily'
- DATE_RANGE_MONTHLY = 'monthly'
- FILTER_DEPTH = 'filter_depth'
- FILTER_FOLLOW = 'filter_follow'
- FILTER_ORDER = 'order'
- FILTER_SHOW = 'filter_show'
- FILTER_SHOWALL = 'show_all'
- FILTER_SORT = 'sort'
- FILTER_SORTFEATURED = 'sort_featured'
- FILTER_SORTMOSTRECENT = 'sort_recent'
- FILTER_SORTOLDEST = 'sort_oldest'
- FILTER_SORTPOPULAR = 'sort_popular'
- FILTER_SOURCE = 'filter_source'
- FILTER_SOURCEALL = 'source_all'
- FILTER_SOURCEUSER = 'source_user'
- FILTER_SOURCEVM = 'source_vm'
- FILTER_TIME = 'date'
- OPTION_ALLOW_POST = 2
- OPTION_AUTOAPPROVE_MEMBERSHIP = 8
- OPTION_AUTOAPPROVE_SUBSCRIPTION = 128
- OPTION_AUTOSUBSCRIBE_ON_JOIN = 512
- OPTION_MODERATE_COMMENTS = 4
- OPTION_MODERATE_TOPICS = 256
- OPTION_NODE_DISABLE_BBCODE = 1024
- OPTION_NODE_DISABLE_SMILIES = 64
- OPTION_NODE_DISPLAY_FULL_IN_CATEGORY = 16384
- OPTION_NODE_DISPLAY_PAGEVIEWS = 32768
- OPTION_NODE_HIDE_AUTHOR = 4096
- OPTION_NODE_HIDE_COMMENT_COUNT = 65536
- OPTION_NODE_HIDE_PUBLISHDATE = 8192
- OPTION_NODE_HIDE_TITLE = 2048
- OPTION_NODE_INVITEONLY = 16
- OPTION_NODE_PARSELINKS = 32
- REQUEST_GRANT_MEMBER = 'member'
- REQUEST_GRANT_MODERATOR = 'moderator'
- REQUEST_GRANT_OWNER = 'owner_from'
- REQUEST_GRANT_SUBSCRIBER = 'subscriber'
- REQUEST_SG_GRANT_MEMBER = 'sg_member'
- REQUEST_SG_GRANT_MODERATOR = 'sg_moderator'
- REQUEST_SG_GRANT_OWNER = 'sg_owner_from'
- REQUEST_SG_GRANT_SUBSCRIBER = 'sg_subscriber'
- REQUEST_SG_TAKE_MEMBER = 'sg_member_to'
- REQUEST_SG_TAKE_MODERATOR = 'sg_moderator_to'
- REQUEST_SG_TAKE_OWNER = 'sg_owner_to'
- REQUEST_SG_TAKE_SUBSCRIBER = 'sg_subscriber_to'
- REQUEST_TAKE_MEMBER = 'member_to'
- REQUEST_TAKE_MODERATOR = 'moderator_to'
- REQUEST_TAKE_OWNER = 'owner_to'
- REQUEST_TAKE_SUBSCRIBER = 'subscriber_to'
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- addAttachment() : int
- Adds one or more attachments
- approve() : array<string|int, mixed>
- Sets the approved field
- approveChannelRequest() : mixed
- Approves a channel request.
- callNamed() : The
- Call the given api function by name with a named arguments list.
- canOpenCloseNode() : bool
- Check if current user has perms to open or close $nodeid
- checkApiState() : mixed
- This method checks whether the API method is enabled.
- clearCache() : mixed
- Clears all previously loaded API objects.
- clearCacheEvents() : mixed
- Clears the cache events from a given list of nodes.
- cloneNodes() : array<string|int, mixed>
- Clone Nodes and their children deeply into a new parent Node.
- closeNode() : mixed
- Closes a node for posting. Closed nodes can still be viewed but nobody can reply to one.
- deleteNodes() : array<string|int, mixed>
- Permanently/Temporarily deletes a set of nodes
- deleteNodesAsSpam() : mixed
- Delete nodes as spam
- fetchActivity() : int
- returns array of all node content for a user's activity
- fetchAlbumChannel() : int
- returns id of the Albums Channel
- fetchArticleChannel() : int
- Returns the nodeid of the articles channel
- fetchChannelDetails() : mixed
- fetchChannelNodeTree() : array<string|int, mixed>
- Fetch node tree structure of the specified parent id as the root. Root is excluded from the tree structure.
- fetchForumChannel() : int
- Returns the nodeid of the root forum channel
- fetchInfractionChannel() : int
- Returns the nodeid of the infraction channel
- fetchModLogs() : array<string|int, mixed>
- Fetches the moderator logs for a node
- fetchPMChannel() : int
- returns id of the Private Message Channel
- fetchReportChannel() : int
- returns id of the Report Channel
- fetchUsersFromNodeids() : array<string|int, mixed>
- Fetch users from given nodeids
- fetchVMChannel() : int
- returns id of the Vistor Message Channel
- getAlbums() : mixed
- This returns all the albums in a channel. Those can be photogalleries or text with attachments.
- getAnswerNodeids() : array<string|int, mixed>
- If $starterid has a selected answer(s) and current user can view the node(s), returns the answer nodeid(s).
- getApiClassName() : mixed
- getAttachmentPublicInfo() : array<string|int, mixed>
- Gets the "public" attachment information for a single attachment. If the user cannot view this attachment, it will be empty. Depending on the cangetattachment or cangetimgattachment permissions, the returned data will be consumed to create an anchor, an image, or unparsed bbcode.
- getCanDeleteForEdit() : array<string|int, mixed>
- Return whether the user can delete the node or not. Used by createcontent controller
- getChannelStatistics() : array<string|int, mixed>
- Returns channel statistics-- number of topics / posts.
- getContentforNodes() : mixed
- Gets the content info for a list of nodes
- getCreatepermissionsForEdit() : array<string|int, mixed>
- Return the specified node's createpermissions for editing for the current user
- getCurrentUserChannels() : array<string|int, mixed>
- Returns a list of channels that the current user can access.
- getFirstChildAfterTime() : array{nodeid: int}
- Returns the first immediate child node of the given node that was created after the given timestamp
- getFullContentforNodes() : array<string|int, mixed>
- Gets the content info for a list of nodes
- getGuestChannels() : mixed
- Fetches a list of channels that guests can access. Basically a public access for getUserChannels() but only for userid 0.
- getHostName() : mixed
- getMergePostsInfo() : array<string|int, mixed>
- Validates whether nodes can be merged and returns merging info.
- getNode() : mixed
- gets one node.
- getNodeAttachments() : mixed
- Gets the attachment information for a node. Which may be empty.
- getNodeAttachmentsPublicInfo() : array<string|int, mixed>
- Gets the "public" attachment information for a node. Which may be empty.
- getNodeContent() : mixed
- This gets a content record based on nodeid. Useful from ajax.
- getNodeFullContent() : array<string|int, mixed>
- This gets a content record based on nodeid including channel and starter information.
- getNodeReadTime() : array{readtime: int}
- Returns the node read time for the current user and the given nodeid
- getNodes() : mixed
- Gets the node info for a list of nodes
- getOptions() : mixed
- gets the node option bitfields
- getPinnedRepliesFullContent() : array<string|int, mixed>
- Return node arrays (with content subkeys) for any "pinned" replies. Used by widget_conversationdisplay template and frontend activity/get (pagination) controller.
- getPreviewOnly() : mixed
- Return only the safe data for a node for which previewonly is set
- getQuoteFullContent() : mixed
- This gets a content record based on nodeid including channel and starter information.
- incrementNodeview() : mixed
- Insert/Update nodeview for nodeid
- instance() : vB_Api
- Returns an instance of the API object which translates exceptions to an array Use this method for API clients.
- instanceInternal() : vB_Api
- Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API
- listNodeContent() : mixed
- lists the nodes that should be displayed on a specific page including content detail.
- listNodeFullContent() : mixed
- lists the nodes that should be displayed on a specific page including content detail.
- listNodeFullContentCount() : mixed
- Lists the "total count" that can be expected from a listNodeFullContent() call with infinite $perpage param.
- listPendingPosts() : array<string|int, mixed>
- Gets the list of unapproved posts for the current user
- listPendingPostsForCurrentUser() : mixed
- manageDeletedNode() : array<string|int, mixed>
- Manages a deleted node regarding options being passed.
- map_vb4_input_to_vb5() : string
- Returns vb5 api method name.
- map_vb5_errors_to_vb4() : mixed
- Alters the error array in any way necessary to interface correctly with vb4.
- map_vb5_output_to_vb4() : mixed
- Alters the output array in any way necessary to interface correctly with vb4.
- markChannelsRead() : array<string|int, mixed>
- Marks a channel, its child channels and all contained topics as read
- markRead() : array<string|int, mixed>
- Marks a node as read using the appropriate method.
- markReadMultiple() : array<string|int, mixed>
- Mark multiple nodes read
- markUnreadMultiple() : array<string|int, mixed>
- Mark multiple nodes unread
- mergeNodeviewsForTopics() : array<string|int, mixed>
- Merges the nodeviews into the topics array, used by the display_Topics template
- mergePostedStatusForTopics() : array<string|int, mixed>
- Merges "posted" info into the topics array, used by the display_Topics template.
- mergePosts() : mixed
- Performs the actual merging, using edited input from UI.
- mergeTopics() : array<string|int, mixed>
- Merge several topics into a target topic
- moveNodes() : mixed
- Moves nodes to a new parent
- movePosts() : array<string|int, mixed>
- DEPRECATED Move multiple posts to a new topic or to a new channel. Use moveNodes function.
- openNode() : array<string|int, mixed>
- opens a node for posting
- publish() : mixed
- Validates permission and sets a node to published status
- removeAnswers() : array<string|int, mixed>
- Removes answers from selected topics.
- removeAttachment() : mixed
- delete one or more attachments
- requestChannel() : mixed
- This creates a request for access to a channel
- setApproved() : array<string|int, mixed>
- Sets or unsets the approved field
- setApprovedPost() : bool
- Approves a post. Since the publish date might be affected user will need moderate and publish posts permissions.
- setAsAnswer() : array<string|int, mixed>
- Sets (or unsets) a reply to be a topic's Correct Answer
- setExclusiveAnswer() : mixed
- setFeatured() : array<string|int, mixed>
- sets a list of nodes to be featured
- setNodeOptions() : int|string
- Set the node options
- setNodePerms() : int|string
- Set the node special permissions
- setPublishDate() : bool
- Sets the publishdate and (optionally) the unpublish date of a node
- setSticky() : array<string|int, mixed>
- Sets or unsets the sticky field
- setUnFeatured() : array<string|int, mixed>
- sets a node list to be not featured
- setUnPublishDate() : bool
- Sets the unpublish date
- setUnPublished() : bool
- sets a node to not published
- showIp() : bool
- Checks if ip should be shown
- unapprove() : array<string|int, mixed>
- Unsets the approved field
- undeleteNodes() : array<string|int, mixed>
- undeletes a set of nodes
- unPublish() : mixed
- Validates permission and sets a node to unpublished status
- unsetSticky() : array<string|int, mixed>
- Unsets sticky field
Constants
DATE_RANGE_DAILY
public
mixed
DATE_RANGE_DAILY
= 'daily'
DATE_RANGE_MONTHLY
public
mixed
DATE_RANGE_MONTHLY
= 'monthly'
FILTER_DEPTH
public
mixed
FILTER_DEPTH
= 'filter_depth'
FILTER_FOLLOW
public
mixed
FILTER_FOLLOW
= 'filter_follow'
FILTER_ORDER
public
mixed
FILTER_ORDER
= 'order'
FILTER_SHOW
public
mixed
FILTER_SHOW
= 'filter_show'
FILTER_SHOWALL
public
mixed
FILTER_SHOWALL
= 'show_all'
FILTER_SORT
public
mixed
FILTER_SORT
= 'sort'
FILTER_SORTFEATURED
public
mixed
FILTER_SORTFEATURED
= 'sort_featured'
FILTER_SORTMOSTRECENT
public
mixed
FILTER_SORTMOSTRECENT
= 'sort_recent'
FILTER_SORTOLDEST
public
mixed
FILTER_SORTOLDEST
= 'sort_oldest'
FILTER_SORTPOPULAR
public
mixed
FILTER_SORTPOPULAR
= 'sort_popular'
FILTER_SOURCE
public
mixed
FILTER_SOURCE
= 'filter_source'
FILTER_SOURCEALL
public
mixed
FILTER_SOURCEALL
= 'source_all'
FILTER_SOURCEUSER
public
mixed
FILTER_SOURCEUSER
= 'source_user'
FILTER_SOURCEVM
public
mixed
FILTER_SOURCEVM
= 'source_vm'
FILTER_TIME
public
mixed
FILTER_TIME
= 'date'
OPTION_ALLOW_POST
public
mixed
OPTION_ALLOW_POST
= 2
OPTION_AUTOAPPROVE_MEMBERSHIP
public
mixed
OPTION_AUTOAPPROVE_MEMBERSHIP
= 8
OPTION_AUTOAPPROVE_SUBSCRIPTION
public
mixed
OPTION_AUTOAPPROVE_SUBSCRIPTION
= 128
OPTION_AUTOSUBSCRIBE_ON_JOIN
public
mixed
OPTION_AUTOSUBSCRIBE_ON_JOIN
= 512
OPTION_MODERATE_COMMENTS
public
mixed
OPTION_MODERATE_COMMENTS
= 4
OPTION_MODERATE_TOPICS
public
mixed
OPTION_MODERATE_TOPICS
= 256
OPTION_NODE_DISABLE_BBCODE
public
mixed
OPTION_NODE_DISABLE_BBCODE
= 1024
OPTION_NODE_DISABLE_SMILIES
public
mixed
OPTION_NODE_DISABLE_SMILIES
= 64
OPTION_NODE_DISPLAY_FULL_IN_CATEGORY
public
mixed
OPTION_NODE_DISPLAY_FULL_IN_CATEGORY
= 16384
OPTION_NODE_DISPLAY_PAGEVIEWS
public
mixed
OPTION_NODE_DISPLAY_PAGEVIEWS
= 32768
OPTION_NODE_HIDE_AUTHOR
public
mixed
OPTION_NODE_HIDE_AUTHOR
= 4096
OPTION_NODE_HIDE_COMMENT_COUNT
public
mixed
OPTION_NODE_HIDE_COMMENT_COUNT
= 65536
OPTION_NODE_HIDE_PUBLISHDATE
public
mixed
OPTION_NODE_HIDE_PUBLISHDATE
= 8192
OPTION_NODE_HIDE_TITLE
public
mixed
OPTION_NODE_HIDE_TITLE
= 2048
OPTION_NODE_INVITEONLY
public
mixed
OPTION_NODE_INVITEONLY
= 16
OPTION_NODE_PARSELINKS
public
mixed
OPTION_NODE_PARSELINKS
= 32
REQUEST_GRANT_MEMBER
public
mixed
REQUEST_GRANT_MEMBER
= 'member'
REQUEST_GRANT_MODERATOR
public
mixed
REQUEST_GRANT_MODERATOR
= 'moderator'
REQUEST_GRANT_OWNER
public
mixed
REQUEST_GRANT_OWNER
= 'owner_from'
REQUEST_GRANT_SUBSCRIBER
public
mixed
REQUEST_GRANT_SUBSCRIBER
= 'subscriber'
REQUEST_SG_GRANT_MEMBER
public
mixed
REQUEST_SG_GRANT_MEMBER
= 'sg_member'
REQUEST_SG_GRANT_MODERATOR
public
mixed
REQUEST_SG_GRANT_MODERATOR
= 'sg_moderator'
REQUEST_SG_GRANT_OWNER
public
mixed
REQUEST_SG_GRANT_OWNER
= 'sg_owner_from'
REQUEST_SG_GRANT_SUBSCRIBER
public
mixed
REQUEST_SG_GRANT_SUBSCRIBER
= 'sg_subscriber'
REQUEST_SG_TAKE_MEMBER
public
mixed
REQUEST_SG_TAKE_MEMBER
= 'sg_member_to'
REQUEST_SG_TAKE_MODERATOR
public
mixed
REQUEST_SG_TAKE_MODERATOR
= 'sg_moderator_to'
REQUEST_SG_TAKE_OWNER
public
mixed
REQUEST_SG_TAKE_OWNER
= 'sg_owner_to'
REQUEST_SG_TAKE_SUBSCRIBER
public
mixed
REQUEST_SG_TAKE_SUBSCRIBER
= 'sg_subscriber_to'
REQUEST_TAKE_MEMBER
public
mixed
REQUEST_TAKE_MEMBER
= 'member_to'
REQUEST_TAKE_MODERATOR
public
mixed
REQUEST_TAKE_MODERATOR
= 'moderator_to'
REQUEST_TAKE_OWNER
public
mixed
REQUEST_TAKE_OWNER
= 'owner_to'
REQUEST_TAKE_SUBSCRIBER
public
mixed
REQUEST_TAKE_SUBSCRIBER
= 'subscriber_to'
Methods
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
addAttachment()
Adds one or more attachments
public
addAttachment(mixed $nodeid, mixed $data) : int
@param int
Parameters
- $nodeid : mixed
- $data : mixed
Return values
int —an attachid
approve()
Sets the approved field
public
approve(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed
approveChannelRequest()
Approves a channel request.
public
approveChannelRequest(int $messageId) : mixed
Parameters
- $messageId : int
callNamed()
Call the given api function by name with a named arguments list.
public
callNamed() : The
Used primarily to translate REST requests into API calls.
Return values
The —return of the method or an error if the method doesn't exist, or is static, a constructor or destructor, or otherwise shouldn't be callable as and API method. It is also an error if the value of a paramater is not provided and that parameter doesn't have a default value.
canOpenCloseNode()
Check if current user has perms to open or close $nodeid
public
canOpenCloseNode(int $nodeid) : bool
Parameters
- $nodeid : int
Return values
bool —true if current user can open or close $nodeid
checkApiState()
This method checks whether the API method is enabled.
public
checkApiState(mixed $method) : mixed
For extensions check make sure $controller property is already set.
Parameters
- $method : mixed
clearCache()
Clears all previously loaded API objects.
public
static clearCache() : mixed
Intended for use in tests where the loading pattern can cause issues with objects that cache thier own data.
clearCacheEvents()
Clears the cache events from a given list of nodes.
public
clearCacheEvents(mixed $nodeIds) : mixed
Useful to keep search results updated due node changes.
Parameters
- $nodeIds : mixed
Tags
cloneNodes()
Clone Nodes and their children deeply into a new parent Node.
public
cloneNodes(array<string|int, mixed> $nodeids, string|int $to_parent[, string $newtitle = '' ]) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
-
Source nodeIDs
- $to_parent : string|int
-
Parent node id. If to_parent is a string, it should be a route path to the node
- $newtitle : string = ''
-
If parent is a channel, the oldest post will be promoted to a Thread with the new title.
Return values
array<string|int, mixed> —of origional nodeids as keys, cloned nodeids as values
closeNode()
Closes a node for posting. Closed nodes can still be viewed but nobody can reply to one.
public
closeNode(mixed $nodeid) : mixed
@param mixed integer or array of integers
Parameters
- $nodeid : mixed
Return values
mixed —Either array 'errors' => error string or array of id's.
deleteNodes()
Permanently/Temporarily deletes a set of nodes
public
deleteNodes(mixed $nodeids[, mixed $hard = true ][, mixed $reason = '' ][, mixed $modlog = true ][, mixed $reportspam = false ]) : array<string|int, mixed>
Parameters
- $nodeids : mixed
- $hard : mixed = true
- $reason : mixed = ''
- $modlog : mixed = true
- $reportspam : mixed = false
Return values
array<string|int, mixed> —nodeids that were deleted
deleteNodesAsSpam()
Delete nodes as spam
public
deleteNodesAsSpam(array<string|int, mixed> $nodeids[, array<string|int, mixed> $userids = [] ][, bool $hard = true ][, string $reason = '' ][, bool $deleteother = false ][, bool $banusers = false ][, int $banusergroupid = 0 ][, string $period = 'PERMANENT' ][, string $banreason = '' ][, mixed $report = false ]) : mixed
Parameters
- $nodeids : array<string|int, mixed>
-
The nodeids of the records to be deleted
- $userids : array<string|int, mixed> = []
-
Selected userids who are being applied punitive action to
- $hard : bool = true
-
hard/soft delete
- $reason : string = ''
- $deleteother : bool = false
-
Whether to delete other posts and threads started by the affected users
- $banusers : bool = false
-
Whether to ban the affected users
- $banusergroupid : int = 0
-
Which banned usergroup to move the users to
- $period : string = 'PERMANENT'
-
Ban period
- $banreason : string = ''
-
Ban reason
- $report : mixed = false
fetchActivity()
returns array of all node content for a user's activity
public
fetchActivity(mixed $params) : int
Parameters
- $params : mixed
Return values
int —array including
fetchAlbumChannel()
returns id of the Albums Channel
public
fetchAlbumChannel() : int
Return values
int —array including
fetchArticleChannel()
Returns the nodeid of the articles channel
public
fetchArticleChannel() : int
Return values
int —The nodeid for the articles channel
fetchChannelDetails()
public
fetchChannelDetails(mixed $nodes[, mixed $nodesOnly = [] ]) : mixed
Parameters
- $nodes : mixed
- $nodesOnly : mixed = []
fetchChannelNodeTree()
Fetch node tree structure of the specified parent id as the root. Root is excluded from the tree structure.
public
fetchChannelNodeTree([int $parentid = 0 ][, int $depth = 3 ][, int $pagenum = 1 ][, int $perpage = 20 ]) : array<string|int, mixed>
If parentid is not specified or less than 1, it is automatically set to the top-most level special category "Forum"
Parameters
- $parentid : int = 0
- $depth : int = 3
- $pagenum : int = 1
-
-- unused
- $perpage : int = 20
-
-- unused
Return values
array<string|int, mixed> —The node tree (need to fill out expected structure). May also contain 'warnings' => String[] of warnings to be displayed in debug mode.
fetchForumChannel()
Returns the nodeid of the root forum channel
public
fetchForumChannel() : int
Return values
int —The nodeid for the root forum channel
fetchInfractionChannel()
Returns the nodeid of the infraction channel
public
fetchInfractionChannel() : int
Return values
int —The nodeid for the infraction channel
fetchModLogs()
Fetches the moderator logs for a node
public
fetchModLogs(int $nodeid) : array<string|int, mixed>
Parameters
- $nodeid : int
Return values
array<string|int, mixed> —$logs list of log records
fetchPMChannel()
returns id of the Private Message Channel
public
fetchPMChannel() : int
Return values
int —array including
fetchReportChannel()
returns id of the Report Channel
public
fetchReportChannel() : int
Return values
int —array including
fetchUsersFromNodeids()
Fetch users from given nodeids
public
fetchUsersFromNodeids(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
-
Node IDs
Return values
array<string|int, mixed> —User IDs and names.
fetchVMChannel()
returns id of the Vistor Message Channel
public
fetchVMChannel() : int
Return values
int —array including
getAlbums()
This returns all the albums in a channel. Those can be photogalleries or text with attachments.
public
getAlbums(mixed $nodeid) : mixed
Parameters
- $nodeid : mixed
Tags
getAnswerNodeids()
If $starterid has a selected answer(s) and current user can view the node(s), returns the answer nodeid(s).
public
getAnswerNodeids(int $starterid) : array<string|int, mixed>
Parameters
- $starterid : int
Tags
Return values
array<string|int, mixed> —['nodeids' => int []
getApiClassName()
public
static getApiClassName(mixed $controller) : mixed
Parameters
- $controller : mixed
getAttachmentPublicInfo()
Gets the "public" attachment information for a single attachment. If the user cannot view this attachment, it will be empty. Depending on the cangetattachment or cangetimgattachment permissions, the returned data will be consumed to create an anchor, an image, or unparsed bbcode.
public
getAttachmentPublicInfo(int $attachmentid) : array<string|int, mixed>
Parameters
- $attachmentid : int
-
nodeid
Return values
array<string|int, mixed> —[ {attachmentid1} => [attachment information] ] Where attachment information contains - nodeid - parentid - filedataid - filename - filesize - settings - counter - dateline - resize_dateline - extension - userid - visible
getCanDeleteForEdit()
Return whether the user can delete the node or not. Used by createcontent controller
public
getCanDeleteForEdit(array<string|int, mixed> $node[, bool $specific = false ][, bool $hard = false ]) : array<string|int, mixed>
Parameters
- $node : array<string|int, mixed>
-
Existing node data array including nodeid, starter, channelid, contenttypeid
- $specific : bool = false
-
(OPTIONAL) Whether to specifically check for hard delete or soft delete. By default it is false, meaning it will check whether user can soft OR hard delete the node
- $hard : bool = false
-
(OPTIONAL) Only used if $specific is true. Whether it's checking if user can hard delete (true) or soft delete (false)
Return values
array<string|int, mixed> —key 'candelete': boolean true if they can delete the node
getChannelStatistics()
Returns channel statistics-- number of topics / posts.
public
getChannelStatistics(mixed $parentid) : array<string|int, mixed>
This function depends on fetchChannelNodeTree, which populates channelStatistics.
Parameters
- $parentid : mixed
Return values
array<string|int, mixed> —Channel statistics.
getContentforNodes()
Gets the content info for a list of nodes
public
getContentforNodes(mixed $nodeList[, mixed $options = false ]) : mixed
Parameters
- $nodeList : mixed
- $options : mixed = false
getCreatepermissionsForEdit()
Return the specified node's createpermissions for editing for the current user
public
getCreatepermissionsForEdit(mixed $node) : array<string|int, mixed>
Parameters
- $node : mixed
Return values
array<string|int, mixed> —key 'createpermissions': boolean false if they cannot edit the node an array with keys contenttypes => integer 1 if they can create the specified contenttype, 0 if they cannot
getCurrentUserChannels()
Returns a list of channels that the current user can access.
public
getCurrentUserChannels() : array<string|int, mixed>
This is a wrapper for getUserChannels, which shouldn't be public because then anyone could figure out the channel access permissions of any user.
Return values
array<string|int, mixed> —List of channels that the current user can access.
getFirstChildAfterTime()
Returns the first immediate child node of the given node that was created after the given timestamp
public
getFirstChildAfterTime(int $parentNodeId, int $timeStamp) : array{nodeid: int}
Parameters
- $parentNodeId : int
- $timeStamp : int
Return values
array{nodeid: int}getFullContentforNodes()
Gets the content info for a list of nodes
public
getFullContentforNodes(mixed $nodeList) : array<string|int, mixed>
Parameters
- $nodeList : mixed
Return values
array<string|int, mixed> —array of content records -- preserves the original keys
getGuestChannels()
Fetches a list of channels that guests can access. Basically a public access for getUserChannels() but only for userid 0.
public
getGuestChannels() : mixed
getHostName()
public
getHostName(mixed $ip) : mixed
Parameters
- $ip : mixed
getMergePostsInfo()
Validates whether nodes can be merged and returns merging info.
public
getMergePostsInfo(mixed $nodeIds) : array<string|int, mixed>
Parameters
- $nodeIds : mixed
Return values
array<string|int, mixed>getNode()
gets one node.
public
getNode(mixed $nodeid[, mixed $withParents = false ][, mixed $withJoinableContent = false ]) : mixed
Parameters
- $nodeid : mixed
- $withParents : mixed = false
- $withJoinableContent : mixed = false
Tags
getNodeAttachments()
Gets the attachment information for a node. Which may be empty.
public
getNodeAttachments(mixed $nodeids) : mixed
Parameters
- $nodeids : mixed
Return values
mixed —either false or an array of attachments with the following fields:
-
attach fields ** - filedataid - nodeid - parentid - visible - counter - posthash - filename - caption - reportthreadid - settings - hasthumbnail
** filedata fields ** - userid - extension - filesize - thumbnail_filesize - dateline - thumbnail_dateline ** link info ** - url - urltitle - meta ** photo info ** - caption - height - width - style
getNodeAttachmentsPublicInfo()
Gets the "public" attachment information for a node. Which may be empty.
public
getNodeAttachmentsPublicInfo(int|array<string|int, int> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : int|array<string|int, int>
-
nodeid or array of nodeids
Return values
array<string|int, mixed> —[ {nodeid1} => [ {attachmentid1} => [attachment information], {attachmentid2} => [attachment information] ], {nodeid2} => [ {attachmentid3} => [attachment information], {attachmentid4} => [attachment information] ], ] Where attachment information contains - nodeid - parentid - filedataid - filename - filesize - settings - counter - dateline - resize_dateline - extension - userid - visible
getNodeContent()
This gets a content record based on nodeid. Useful from ajax.
public
getNodeContent(mixed $nodeid[, mixed $contenttypeid = false ][, mixed $options = [] ]) : mixed
Parameters
- $nodeid : mixed
- $contenttypeid : mixed = false
- $options : mixed = []
Tags
getNodeFullContent()
This gets a content record based on nodeid including channel and starter information.
public
getNodeFullContent(int $nodeid[, bool $contenttypeid = false ][, mixed $options = [] ]) : array<string|int, mixed>
Parameters
- $nodeid : int
- $contenttypeid : bool = false
-
optional, defaults to false
- $options : mixed = []
Return values
array<string|int, mixed> —node list ($nodeid=>node record) will only have one item
getNodeReadTime()
Returns the node read time for the current user and the given nodeid
public
getNodeReadTime(int $nodeid) : array{readtime: int}
Parameters
- $nodeid : int
Return values
array{readtime: int}getNodes()
Gets the node info for a list of nodes
public
getNodes(array<string|int, mixed> $nodeList[, bool $withJoinableContent = false ]) : mixed
Parameters
- $nodeList : array<string|int, mixed>
-
-- array of nodeids
- $withJoinableContent : bool = false
-
-- Include joinable content
@return array of node records
getOptions()
gets the node option bitfields
public
getOptions() : mixed
@return array associative array of bitfield name => value
getPinnedRepliesFullContent()
Return node arrays (with content subkeys) for any "pinned" replies. Used by widget_conversationdisplay template and frontend activity/get (pagination) controller.
public
getPinnedRepliesFullContent(array<string|int, mixed> $starter, mixed $searchOptions) : array<string|int, mixed>
Parameters
- $starter : array<string|int, mixed>
-
node array for starter
- $searchOptions : mixed
Return values
array<string|int, mixed> —Array of nodes that can be passed into post display templates. May be empty.
getPreviewOnly()
Return only the safe data for a node for which previewonly is set
public
getPreviewOnly(mixed $node) : mixed
Parameters
- $node : mixed
Return values
mixed —Cleaned node data
getQuoteFullContent()
This gets a content record based on nodeid including channel and starter information.
public
getQuoteFullContent(mixed $quoteId) : mixed
Parameters
- $quoteId : mixed
incrementNodeview()
Insert/Update nodeview for nodeid
public
incrementNodeview(int $nodeid) : mixed
Parameters
- $nodeid : int
-
nodeid for which we should increment the view count
Return values
mixed —return true upon completion, or an error message
instance()
Returns an instance of the API object which translates exceptions to an array Use this method for API clients.
public
static instance(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
- $controller : string
-
-- name of the API controller to load
- $refresh_cache : bool = false
-
-- true if we want to force the cache to update with a new api object primarily intended for testing
Return values
vB_ApiinstanceInternal()
Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API
public
static instanceInternal(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
- $controller : string
-
-- name of the API controller to load
- $refresh_cache : bool = false
-
-- true if we want to force the cache to update with a new api object primarily intended for testing
Return values
vB_ApilistNodeContent()
lists the nodes that should be displayed on a specific page including content detail.
public
listNodeContent(mixed $parentid[, mixed $page = 1 ][, mixed $perpage = 20 ][, mixed $depth = 0 ][, mixed $contenttypeid = null ][, mixed $options = [] ]) : mixed
Parameters
- $parentid : mixed
- $page : mixed = 1
- $perpage : mixed = 20
- $depth : mixed = 0
- $contenttypeid : mixed = null
- $options : mixed = []
listNodeFullContent()
lists the nodes that should be displayed on a specific page including content detail.
public
listNodeFullContent(mixed $parentid[, mixed $page = 1 ][, mixed $perpage = 20 ][, mixed $depth = 0 ][, mixed $contenttypeid = null ][, mixed $options = [] ]) : mixed
Parameters
- $parentid : mixed
- $page : mixed = 1
- $perpage : mixed = 20
- $depth : mixed = 0
- $contenttypeid : mixed = null
- $options : mixed = []
Return values
mixed —array of id's
listNodeFullContentCount()
Lists the "total count" that can be expected from a listNodeFullContent() call with infinite $perpage param.
public
listNodeFullContentCount(mixed $parentid[, mixed $page = 1 ][, mixed $perpage = 20 ][, mixed $depth = 0 ][, mixed $contenttypeid = null ][, mixed $options = false ]) : mixed
Used for pagination purposes. Call it with the same parameters you called listNodeFullContent() with.
Parameters
- $parentid : mixed
- $page : mixed = 1
- $perpage : mixed = 20
- $depth : mixed = 0
- $contenttypeid : mixed = null
- $options : mixed = false
Tags
listPendingPosts()
Gets the list of unapproved posts for the current user
public
listPendingPosts([mixed $options = [] ]) : array<string|int, mixed>
Parameters
- $options : mixed = []
Return values
array<string|int, mixed> —containing the pending posts nodeIds with contenttypeid associated.
listPendingPostsForCurrentUser()
public
listPendingPostsForCurrentUser([mixed $options = [] ]) : mixed
Parameters
- $options : mixed = []
manageDeletedNode()
Manages a deleted node regarding options being passed.
public
manageDeletedNode(mixed $nodeid, mixed $params) : array<string|int, mixed>
Parameters
- $nodeid : mixed
- $params : mixed
Return values
array<string|int, mixed> —Whether manage action succeeded or not. keys -- success
map_vb4_input_to_vb5()
Returns vb5 api method name.
public
static map_vb4_input_to_vb5(string $method, array<string|int, mixed> &$request) : string
May alter request array.
Parameters
- $method : string
-
-- vb4 method name
- $request : array<string|int, mixed>
-
-- $_REQUEST array for this api request
Return values
stringmap_vb5_errors_to_vb4()
Alters the error array in any way necessary to interface correctly with vb4.
public
static map_vb5_errors_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
- $method : string
-
-- vb4 method name
- $data : array<string|int, mixed>
-
-- error array from vb5
map_vb5_output_to_vb4()
Alters the output array in any way necessary to interface correctly with vb4.
public
static map_vb5_output_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
- $method : string
-
-- vb4 method name
- $data : array<string|int, mixed>
-
-- output array from vb5
markChannelsRead()
Marks a channel, its child channels and all contained topics as read
public
markChannelsRead([int $nodeid = 0 ]) : array<string|int, mixed>
Parameters
- $nodeid : int = 0
-
The node ID of channel being marked. If 0, all channels will be marked as read
Return values
array<string|int, mixed> —Returns an array of channel ids that were marked as read
markRead()
Marks a node as read using the appropriate method.
public
markRead(int $nodeid[, int|null $readtime = null ]) : array<string|int, mixed>
Parameters
- $nodeid : int
-
The ID of node being marked
- $readtime : int|null = null
-
Timestamp of the last reply that was read. E.g. if user loaded page 3 of a 4 page thread, the
publishdate
of the last reply on page 3 should be passed here, so that page 4 will remain unread.
Return values
array<string|int, mixed> —Returns an array of nodeids that were marked as read
markReadMultiple()
Mark multiple nodes read
public
markReadMultiple(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
-
Node Ids
Return values
array<string|int, mixed> —Returns an array of nodeids that were marked as read
markUnreadMultiple()
Mark multiple nodes unread
public
markUnreadMultiple(mixed $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : mixed
-
Node Ids
Return values
array<string|int, mixed> —Returns an array of nodes that were marked as unread
mergeNodeviewsForTopics()
Merges the nodeviews into the topics array, used by the display_Topics template
public
mergeNodeviewsForTopics(array<string|int, mixed> $topicsArray) : array<string|int, mixed>
Parameters
- $topicsArray : array<string|int, mixed>
-
search results array with nodeids for keys, and each element having a 'content' array
Return values
array<string|int, mixed> —array with keys $nodeids & corresponding counts for the values
[
mergePostedStatusForTopics()
Merges "posted" info into the topics array, used by the display_Topics template.
public
mergePostedStatusForTopics(mixed $nodes) : array<string|int, mixed>
This adds the "content.posted" element to the node record. The value is the number of times the current user has posted in the topic (replies and comments); zero if none.
Parameters
- $nodes : mixed
Return values
array<string|int, mixed> —Same array of nodes, with the "posted" element added to the "content" sub-array
mergePosts()
Performs the actual merging, using edited input from UI.
public
mergePosts(mixed $input) : mixed
Parameters
- $input : mixed
mergeTopics()
Merge several topics into a target topic
public
mergeTopics(array<string|int, mixed> $nodeids, int $targetnodeid[, array<string|int, mixed> $leaveRedirectData = [] ]) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
-
Source topic node IDs
- $targetnodeid : int
-
Target topic node ID
- $leaveRedirectData : array<string|int, mixed> = []
Return values
array<string|int, mixed>moveNodes()
Moves nodes to a new parent
public
moveNodes(mixed $nodeids, mixed $to_parent[, mixed $makeTopic = false ][, mixed $newtitle = false ][, mixed $modlog = true ][, array<string|int, mixed> $leaveRedirectData = [] ]) : mixed
Parameters
- $nodeids : mixed
- $to_parent : mixed
- $makeTopic : mixed = false
- $newtitle : mixed = false
- $modlog : mixed = true
- $leaveRedirectData : array<string|int, mixed> = []
Tags
movePosts()
DEPRECATED Move multiple posts to a new topic or to a new channel. Use moveNodes function.
public
movePosts(mixed $nodeids, string|int $to_parent[, string $newtitle = '' ]) : array<string|int, mixed>
Parameters
- $nodeids : mixed
- $to_parent : string|int
-
Parent node id. If to_parent is a string, it should be a route path to the node
- $newtitle : string = ''
-
If parent is a channel, the oldest post will be promoted to a Thread with the new title.
Return values
array<string|int, mixed> —Moved node ids
openNode()
opens a node for posting
public
openNode(int|array<string|int, mixed> $nodeid) : array<string|int, mixed>
Parameters
- $nodeid : int|array<string|int, mixed>
Return values
array<string|int, mixed> —Either array 'errors' => error string or array of id's.
publish()
Validates permission and sets a node to published status
public
publish(mixed $nodes) : mixed
Parameters
- $nodes : mixed
removeAnswers()
Removes answers from selected topics.
public
removeAnswers(int $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : int
-
Topic nodeids
Tags
Return values
array<string|int, mixed> —['success' => true] on success
removeAttachment()
delete one or more attachments
public
removeAttachment(mixed $nodeid, mixed $data[, mixed $all = false ]) : mixed
@param int
Parameters
- $nodeid : mixed
- $data : mixed
- $all : mixed = false
requestChannel()
This creates a request for access to a channel
public
requestChannel(int $channelid, string $requestType[, mixed $recipient = 0 ][, string $recipientname = null ]) : mixed
Parameters
- $channelid : int
-
the nodeid of the channel to which access is requested.
- $requestType : string
-
the type of request. See vB_Api_Node::REQUEST_<> constants
- $recipient : mixed = 0
-
the userid/username of the member who will get the request
- $recipientname : string = null
-
(Optional) the username of the member who will get the request
Return values
mixed —If it is 1 or true, then it means that the follow request was successful. If it is integer and greater than 1, then the request is pending.
setApproved()
Sets or unsets the approved field
public
setApproved(array<string|int, mixed> $nodeids[, bool $approved = true ]) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
- $approved : bool = true
-
- set or unset the approved field
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed
setApprovedPost()
Approves a post. Since the publish date might be affected user will need moderate and publish posts permissions.
public
setApprovedPost(mixed $nodeid[, mixed $approved = false ][, mixed $data = [] ]) : bool
Parameters
- $nodeid : mixed
- $approved : mixed = false
- $data : mixed = []
Return values
bool —Flag to indicate if approving went succesfully done (true/false).
setAsAnswer()
Sets (or unsets) a reply to be a topic's Correct Answer
public
setAsAnswer(int $nodeid[, bool $set = true ]) : array<string|int, mixed>
Parameters
- $nodeid : int
-
Nodeid to be set as the answer
- $set : bool = true
-
(Optional) Default true. Set to false if you want to revert $nodeid from being the answer.
Tags
Return values
array<string|int, mixed> —['success' => true] on success
setExclusiveAnswer()
public
setExclusiveAnswer(mixed $nodeid[, mixed $set = true ]) : mixed
Parameters
- $nodeid : mixed
- $set : mixed = true
setFeatured()
sets a list of nodes to be featured
public
setFeatured(mixed $nodeids[, mixed $set = true ]) : array<string|int, mixed>
Parameters
- $nodeids : mixed
- $set : mixed = true
Return values
array<string|int, mixed> —nodeids that have permission to be featured
setNodeOptions()
Set the node options
public
setNodeOptions(int $nodeid[, array<string|int, mixed>|int $options = false ]) : int|string
Parameters
- $nodeid : int
- $options : array<string|int, mixed>|int = false
-
- can be an integer or an array
Return values
int|string —1 or an error message.
setNodePerms()
Set the node special permissions
public
setNodePerms(int $nodeid[, mixed $perms = [] ]) : int|string
Parameters
- $nodeid : int
- $perms : mixed = []
Return values
int|string —1 or an error message.
setPublishDate()
Sets the publishdate and (optionally) the unpublish date of a node
public
setPublishDate(mixed $nodeid, mixed $datefrom[, mixed $dateto = null ]) : bool
Parameters
- $nodeid : mixed
- $datefrom : mixed
- $dateto : mixed = null
Return values
boolsetSticky()
Sets or unsets the sticky field
public
setSticky(array<string|int, mixed> $nodeids[, bool $stick = true ]) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
- $stick : bool = true
-
- set or unset the sticky field
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed
setUnFeatured()
sets a node list to be not featured
public
setUnFeatured(mixed $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : mixed
Return values
array<string|int, mixed> —nodeids that have permission to be featured
setUnPublishDate()
Sets the unpublish date
public
setUnPublishDate(mixed $nodeid[, mixed $dateto = false ]) : bool
Parameters
- $nodeid : mixed
- $dateto : mixed = false
Return values
boolsetUnPublished()
sets a node to not published
public
setUnPublished(mixed $nodeid) : bool
Parameters
- $nodeid : mixed
Return values
boolshowIp()
Checks if ip should be shown
public
showIp(mixed $nodeid) : bool
Parameters
- $nodeid : mixed
Return values
bool —If the ip of the poster should be posted or not
unapprove()
Unsets the approved field
public
unapprove(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed
undeleteNodes()
undeletes a set of nodes
public
undeleteNodes(mixed $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : mixed
Return values
array<string|int, mixed> —nodeids that were deleted
unPublish()
Validates permission and sets a node to unpublished status
public
unPublish(mixed $nodes[, mixed $permanent = false ]) : mixed
Parameters
- $nodes : mixed
- $permanent : mixed = false
unsetSticky()
Unsets sticky field
public
unsetSticky(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed