vBulletin v5.7.2

vB_Api_Node extends vB_Api
in package

vB_Api_Node

Tags
access

public

Table of Contents

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'
__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.
clearUnpublishDate()  : bool
clears the unpublishdate flag.
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()  : 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()  : 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()  : 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
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>
Return values
void

__wakeup()

public __wakeup() : void
Return values
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
throws
vB_Exception_Api
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
Return values
mixed

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
Return values
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.

Return values
mixed

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
Return values
mixed

clearUnpublishDate()

clears the unpublishdate flag.

public clearUnpublishDate(mixed $nodeid) : bool
Parameters
$nodeid : mixed
Return values
bool

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 = array() ][, bool $hard = true ][, string $reason = "" ][, bool $deleteother = false ][, bool $banusers = false ], int $banusergroupid[, 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> = array()

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

Which banned usergroup to move the users to

$period : string = 'PERMANENT'

Ban period

$banreason : string = ''

Ban reason

$report : mixed = false
Return values
mixed

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 = []
Return values
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[, 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
$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
mixed

array of node records. Each node includes the node content and userinfo, and attachment records.

Return values
mixed

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
throws
vB_Exception_Api

no_permission if user does not have permissions to view $starterid of the answer, or lacks view permissions on every currently set answer.

Return values
array<string|int, mixed>

['nodeids' => int [] ]

getApiClassName()

public static getApiClassName(mixed $controller) : mixed
Parameters
$controller : mixed
Return values
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>

Array( {attachmentid1} => array(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
Return values
mixed

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(mixed $parentNodeId, mixed $timeStamp) : int
Parameters
$parentNodeId : mixed
$timeStamp : mixed
Return values
int

Node ID

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
Return values
mixed

getHostName()

public getHostName(mixed $ip) : mixed
Parameters
$ip : mixed
Return values
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
Return values
mixed

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>

Array( {nodeid1} => array( {attachmentid1} => [attachment information], {attachmentid2} => [attachment information] ), {nodeid2} => array( {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 = array() ]) : mixed
Parameters
$nodeid : mixed
$contenttypeid : mixed = false
$options : mixed = array()
Return values
mixed

getNodeFullContent()

This gets a content record based on nodeid including channel and starter information.

public getNodeFullContent(int $nodeid[, bool $contenttypeid = false ][, mixed $options = array() ]) : array<string|int, mixed>
Parameters
$nodeid : int
$contenttypeid : bool = false

optional, defaults to false

$options : mixed = array()
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(mixed $nodeid) : int
Parameters
$nodeid : mixed
Return values
int

Read time for the node

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

Return values
mixed

getOptions()

gets the node option bitfields

public getOptions() : mixed
@return	array 	associative array of bitfield name => value
Return values
mixed

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
Return values
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_Api

instanceInternal()

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_Api

listNodeContent()

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[, mixed $contenttypeid = null ][, mixed $options = [] ]) : mixed
Parameters
$parentid : mixed
$page : mixed = 1
$perpage : mixed = 20
$depth : mixed
$contenttypeid : mixed = null
$options : mixed = []
Return values
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[, mixed $contenttypeid = null ][, mixed $options = [] ]) : mixed
Parameters
$parentid : mixed
$page : mixed = 1
$perpage : mixed = 20
$depth : mixed
$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[, 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
$contenttypeid : mixed = null
$options : mixed = false
Tags
See

vB_Api_Node::listNodeFullContent() for function param info

Return values
mixed

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 = []
Return values
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
string

map_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

Return values
mixed

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

Return values
mixed

markChannelsRead()

Marks a channel, its child channels and all contained topics as read

public markChannelsRead(int $nodeid) : array<string|int, mixed>
Parameters
$nodeid : int

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) : array<string|int, mixed>
Parameters
$nodeid : int

The ID of node being marked

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( $nodeids) : array<string|int, mixed>
Parameters
$nodeids :

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 array( => , => ...)

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
Return values
mixed

mergeTopics()

Merge several topics into a target topic

public mergeTopics(array<string|int, mixed> $nodeids, int $targetnodeid[, array<string|int, mixed> $leaveRedirectData = array() ]) : 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> = array()
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 = array() ]) : mixed
Parameters
$nodeids : mixed
$to_parent : mixed
$makeTopic : mixed = false
$newtitle : mixed = false
$modlog : mixed = true
$leaveRedirectData : array<string|int, mixed> = array()
Return values
mixed

movePosts()

DEPRECATED Move multiple posts to a new topic or to a new channel. Use moveNodes function.

public movePosts( $nodeids, string|int $to_parent[, string $newtitle = '' ]) : array<string|int, mixed>
Parameters
$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.

Tags
deprecated
Return values
array<string|int, mixed>

Moved node ids

openNode()

opens a node for posting

public openNode(mixed $nodeid) : mixed
Parameters
$nodeid : mixed
Return values
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
Return values
mixed

removeAnswers()

Removes answers from selected topics.

public removeAnswers(int $nodeids) : array<string|int, mixed>
Parameters
$nodeids : int

Topic nodeids

Tags
throws
no_permission

if current user lacks the required group or channel permissions

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
Return values
mixed

requestChannel()

This creates a request for access to a channel

public requestChannel(int $channelid, string $requestType, mixed $recipient[, 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

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
throws
vB_Exception_Api
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 = array() ]) : bool
Parameters
$nodeid : mixed
$approved : mixed = false
$data : mixed = array()
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
throws
no_permission

if current user lacks the required group or channel permissions

throws
node_cannot_be_answer

if nodeid is not a valid reply or comment

throws
is_already_answer

if trying to set an answer as an answer again (there is no toggle)

throws
is_not_answer

if trying to unset a non-answer

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
Return values
mixed

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[, mixed $options = false ]) : int|string
Parameters
$nodeid : int
$options : mixed = false
Return values
int|string

1 or an error message.

setNodePerms()

Set the node special permissions

public setNodePerms(int $nodeid[, mixed $perms = array() ]) : int|string
Parameters
$nodeid : int
$perms : mixed = array()
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
bool

setSticky()

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
throws
vB_Exception_Api
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
bool

setUnPublished()

sets a node to not published

public setUnPublished(mixed $nodeid) : bool
Parameters
$nodeid : mixed
Return values
bool

showIp()

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
throws
vB_Exception_Api
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
Return values
mixed

unsetSticky()

Unsets sticky field

public unsetSticky(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
$nodeids : array<string|int, mixed>
Tags
throws
vB_Exception_Api
Return values
array<string|int, mixed>
  • the nodeids that have the permission to be changed

Search results