vBulletin 5.6.5 API

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'
$channelStatistics  : array<string|int, mixed>
$contentAPIs  : mixed
$contentLibraries  : array<string|int, mixed>
$controller  : string
API Controller
$db  : vB_Database
Database object.
$disabled  : bool
Indicates whether the API was disabled
$disableFalseReturnOnly  : array<string|int, mixed>
Contains white listed methods which return a false response when API is disabled in special scenarios like forum closed, password expiry, ip ban and others.
$disableWhiteList  : array<string|int, mixed>
Contains white listed methods which act as normal when API is disabled no matter of special scenarios like forum closed, password expiry, ip ban and others.
$library  : vB_Library_Node
$previewFields  : mixed
$instances  : mixed
$instancesRaw  : array<string|int, mixed>
We want API subclasses to access the instances only through getters
$vb4_input_mappings  : mixed
$wrappers  : mixed
__serialize()  : mixed
__sleep()  : mixed
__unserialize()  : mixed
__wakeup()  : mixed
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.
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.
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
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
listAlbums()  : array<string|int, mixed>
This returns a list of a user's albums
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
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.
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
__construct()  : mixed
addChannelTotals()  : array<string|int, mixed>
This starts at the bottom and sums the totalcount and textcount fields to topics and posts in the userChannels.
addFinalBranches()  : mixed
assembleTree()  : array<string|int, mixed>
assertNodeidStr()  : int
Convert node path or id string to node id.
checkHasAdminPermission()  : none
Determines if the calling user has the given admin permission, and if not throws an exception
checkHasPermission()  : none
Determines if the calling user has the given bitfield permission, and if not, throws a 'no_permission' exception.
checkIsLoggedIn()  : mixed
Determines if the calling user has the given admin permission, and if not throws an exception
getApiClass()  : mixed
getApiClassNameInternal()  : mixed
getChannelTree()  : array<string|int, mixed>
This function builds the basic channel tree. This is global, without reference to depth or user permissions.
getNodeviews()  : array<string|int, mixed>
Fetch nodeview count(s) for nodeid(s), used by mergeNodeviewsForTopics() below
getUserChannels()  : mixed
hasAdminPermission()  : bool
Determines if the calling user has the given admin permission
inDebugMode()  : mixed
inlinemodAuthCheck()  : mixed
Check whether current logged-in user is "authenticated" for moderation actions.
isDisableFalseReturnOnly()  : bool
Checks if method returns false response only when API is disabled.
isWhiteListed()  : bool
Checks if method is white listed when API is disabled.
setController()  : mixed
Set controller
validateMergePosts()  : array<string|int, mixed>
Validates whether nodes can be merged and returns the merging info. If nodes cannot be merged, an error is returned.
addChannelLastData()  : mixed
This takes the total tree and adds 'last' data to it
cms_vb4_to_vb5_method_mapping()  : mixed
default_vb4_to_vb5_method_mapping()  : mixed
filterPublicAttachmentInfo()  : mixed
hasAdminPermissionInternal()  : mixed
Internal function to power the previous cover functions
moveIsTopicMerge()  : mixed
remove_nulls()  : mixed
validateNodeList()  : array<string|int, mixed>
Given a list of nodes, removes those the user can't see.
wrapLoggerIfNeeded()  : mixed
Wrap the api object with the log wrapper class if needed.

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'

Properties

$channelStatistics

protected array<string|int, mixed> $channelStatistics = alse

$contentAPIs

protected mixed $contentAPIs = array()
Tags
TODO:

this is duplicated info which is already declared in querydef. We should read it from there.

$contentLibraries

protected array<string|int, mixed> $contentLibraries = array()

$controller

API Controller

protected string $controller

$disabled

Indicates whether the API was disabled

protected bool $disabled = alse

$disableFalseReturnOnly

Contains white listed methods which return a false response when API is disabled in special scenarios like forum closed, password expiry, ip ban and others.

protected array<string|int, mixed> $disableFalseReturnOnly = array()

$disableWhiteList

Contains white listed methods which act as normal when API is disabled no matter of special scenarios like forum closed, password expiry, ip ban and others.

protected array<string|int, mixed> $disableWhiteList = array()

$previewFields

protected mixed $previewFields = array('nodeid' => 'nodeid', 'title' => 'title', 'publishdate' => 'publishdate', 'showpublished' => 'showpublished', 'showapproved' => 'showapproved', 'routeid' => 'routeid', 'contenttypeid' => 'contenttypeid', 'publishdate' => 'publishdate', 'unpublishdate' => 'unpublishdate', 'description' => 'description', 'htmltitle' => 'htmltitle', 'parentid' => 'parentid', 'urlident' => 'urlident', 'displayorder' => 'displayorder', 'created' => 'created', 'taglist' => 'taglist', 'showopen' => 'showopen', 'nodeoptions' => 'nodeoptions', 'public_preview' => 'public_preview', 'channelid' => 'channelid', 'channelroute' => 'channelroute', 'channeltitle' => 'channeltitle', 'starterroute' => 'starterroute', 'startertitle' => 'startertitle', 'views' => 'views', 'disable_bbcode' => 'disable_bbcode', 'hide_title' => 'hide_title', 'hide_author' => 'hide_author', 'hide_publishdate' => 'hide_publishdate', 'display_fullincategory' => 'display_fullincategory', 'display_pageviews' => 'display_pageviews', 'channeltype' => 'channeltype', 'edit_reason' => 'edit_reason', 'edit_userid' => 'edit_userid', 'edit_username' => 'edit_username', 'edit_dateline' => 'edit_dateline', 'hashistory' => 'hashistory', 'starternodeoptions' => 'starternodeoptions', 'channelnodeoptions' => 'channelnodeoptions', 'contenttypeclass' => 'contenttypeclass')

$instances

private static mixed $instances

$instancesRaw

We want API subclasses to access the instances only through getters

private static array<string|int, mixed> $instancesRaw

$vb4_input_mappings

private static mixed $vb4_input_mappings = array( 'blog.post_comment' => array('method' => 'vb4_blog.post_comment'), 'blog.post_postcomment' => array('method' => 'vb4_blog.post_postcomment'), 'blog.post_updateblog' => array('method' => 'vb4_blog.post_updateblog'), 'blog.post_newblog' => array('method' => 'vb4_blog.post_newblog'), 'blog.post_editblog' => array('method' => 'vb4_blog.post_editblog'), 'blog_list' => array('method' => 'vb4_blog.bloglist'), 'api_init' => array('method' => 'api.init'), 'api_cmssectionlist' => array('method' => 'Vb4_Cms.sectionlist'), 'api_cmscategorylist' => array('method' => 'Vb4_Cms.categorylist'), /* // These can no longer be mapped directly to vB_Api_User::login/logout // due to additional processing of devicetoken that may be required // for mapi calls. 'login_login' => array( 'method' => 'user.login', 'request_mappings' => array( 'vb_login_username' => 'username', 'vb_login_password' => 'password', 'vb_login_md5password' => 'md5password', 'vb_login_md5password_utf' => 'md5passwordutf' ) ), 'login_logout' => array( 'method' => 'user.logout' ), */ 'get_vbfromfacebook' => array('method' => 'vb4_facebook.getVbfromfacebook'), )

$wrappers

private static mixed $wrappers

Methods

__serialize()

public __serialize() : mixed
Return values
mixed

__sleep()

public __sleep() : mixed
Return values
mixed

__unserialize()

public __unserialize(mixed $serialized) : mixed
Parameters
$serialized : mixed
Return values
mixed

__wakeup()

public __wakeup() : mixed
Return values
mixed

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.

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 = array() ]) : mixed
Parameters
$nodes : mixed
$nodesOnly : mixed = array()
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

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} => array(attachment information), {attachmentid2} => array(attachment information) ), {nodeid2} => array( {attachmentid3} => array(attachment information), {attachmentid4} => array(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

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

listAlbums()

This returns a list of a user's albums

public listAlbums([int $userid = false ][, int $page = 1 ][, mixed $perpage = 100 ][, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
$userid : int = false
$page : int = 1
$perpage : mixed = 100
$options : array<string|int, mixed> = array()
Return values
array<string|int, mixed>

node list of albums

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 = false ]) : mixed
Parameters
$parentid : mixed
$page : mixed = 1
$perpage : mixed = 20
$depth : mixed
$contenttypeid : mixed = null
$options : mixed = false
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 = false ]) : mixed
Parameters
$parentid : mixed
$page : mixed = 1
$perpage : mixed = 20
$depth : mixed
$contenttypeid : mixed = null
$options : mixed = false
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 nodes that were marked as read

markReadMultiple()

Mark multiple nodes read

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

Node Ids

Return values
array<string|int, mixed>

Returns an array of nodes 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

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).

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

__construct()

protected __construct() : mixed
Return values
mixed

addChannelTotals()

This starts at the bottom and sums the totalcount and textcount fields to topics and posts in the userChannels.

protected addChannelTotals(array<string|int, mixed> &$channels, array<string|int, mixed> &$userChannels, int $channelid) : array<string|int, mixed>
Parameters
$channels : array<string|int, mixed>

array of all channel records

$userChannels : array<string|int, mixed>

array of channel records for the current user only

$channelid : int

Id of the channel we are currently processing.

Return values
array<string|int, mixed>

May contain 'warnings' => String[] of warning(s)

addFinalBranches()

protected addFinalBranches(mixed &$trunk, mixed &$tree, mixed &$userTree, mixed $maxDepth, mixed $userid) : mixed
Parameters
$trunk : mixed
$tree : mixed
$userTree : mixed
$maxDepth : mixed
$userid : mixed
Return values
mixed

assembleTree()

protected assembleTree(array<string|int, mixed> &$userTree, array<string|int, mixed> &$channels, int $rootid, int $depth, int $userid) : array<string|int, mixed>
Parameters
$userTree : array<string|int, mixed>

The channel tree that's dependent on the user. Only channels visible to the current user will be present.

$channels : array<string|int, mixed>

The COMPLETE, user-agnostic channel tree, as constructed by addChannelLastData(). Note that this function will modify this array to add user-dependent information 'topics' & 'posts, and potentially blank out some 'lastcontent' arrays, so any callers should be aware of this and pre-emptively make a copy of the array before calling this function if this array needs to stay user-independent.

$rootid : int

The root channel

$depth : int
$userid : int
Return values
array<string|int, mixed>

'channels' => list of the child channel data. May be empty if there are no children, or if user lacks view permissions.

assertNodeidStr()

Convert node path or id string to node id.

protected assertNodeidStr(string|int $nodestring) : int
Parameters
$nodestring : string|int

Node String. If $nodestring is a string, it should be a route path to the node

Return values
int

Node ID

checkHasAdminPermission()

Determines if the calling user has the given admin permission, and if not throws an exception

protected checkHasAdminPermission(string|array<string|int, mixed> $adminPermission) : none

Checks for:

  • A valid CP Session
  • The passed adminpermission.
Parameters
$adminPermission : string|array<string|int, mixed>

The admin permission to check. If an array then the check passes if the user has any of the permissions given.

Tags
throws
inlinemodauth_required

-- The current session is not a mod/admin session

throws
nopermission_loggedin

-- The user does not have the given permission

throws
no_permission

-- The user is not logged in at all.

Return values
none

checkHasPermission()

Determines if the calling user has the given bitfield permission, and if not, throws a 'no_permission' exception.

protected checkHasPermission(string $group, string $permission) : none
Parameters
$group : string

The permission group where the permission is located

$permission : string

The permission to check

Tags
throws
no_permission
Return values
none

checkIsLoggedIn()

Determines if the calling user has the given admin permission, and if not throws an exception

protected checkIsLoggedIn() : mixed
Return values
mixed

getApiClass()

protected static getApiClass(mixed $controller[, mixed $errorCheck = true ]) : mixed
Parameters
$controller : mixed
$errorCheck : mixed = true
Return values
mixed

getApiClassNameInternal()

protected static getApiClassNameInternal(mixed $controller) : mixed
Parameters
$controller : mixed
Return values
mixed

getChannelTree()

This function builds the basic channel tree. This is global, without reference to depth or user permissions.

protected getChannelTree() : array<string|int, mixed>
Return values
array<string|int, mixed>

of with nodeid => array of node information including ancestry, etc.

getNodeviews()

Fetch nodeview count(s) for nodeid(s), used by mergeNodeviewsForTopics() below

protected getNodeviews(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
$nodeids : array<string|int, mixed>

array of nodeid(s) for which we're grabbing the count(s)

Return values
array<string|int, mixed>

array with keys $nodeids & corresponding counts for the values array( => , => ...)

getUserChannels()

protected getUserChannels(mixed $userid) : mixed
Parameters
$userid : mixed
Return values
mixed

hasAdminPermission()

Determines if the calling user has the given admin permission

protected hasAdminPermission(string|array<string|int, mixed> $adminPermission) : bool

Useful if you need to know if the calling user but do not care why they do not have that permission. Generally useful if there is a behavior difference between admins and non admins, but the call can be processed for either.

Parameters
$adminPermission : string|array<string|int, mixed>

The admin permission to check. If an array then the check passes if the user has any of the permissions given.

Return values
bool

true if checks pass, false otherwise

inDebugMode()

protected inDebugMode() : mixed
Return values
mixed

inlinemodAuthCheck()

Check whether current logged-in user is "authenticated" for moderation actions.

protected inlinemodAuthCheck() : mixed

If the user is a moderator but not "authenticated", this will throw an exception. If the user is not a moderator, this won't throw the exception!

Tags
throws
vB_Exception_Api

inlinemodauth_required if we need user to login again

Return values
mixed

isDisableFalseReturnOnly()

Checks if method returns false response only when API is disabled.

protected isDisableFalseReturnOnly(mixed $method) : bool
Parameters
$method : mixed
Return values
bool

Indicates whether method returns false response only.

isWhiteListed()

Checks if method is white listed when API is disabled.

protected isWhiteListed(mixed $method) : bool
Parameters
$method : mixed
Return values
bool

Indicates whether method is or is not a white list.

setController()

Set controller

protected setController(mixed $controller) : mixed
Parameters
$controller : mixed
Return values
mixed

validateMergePosts()

Validates whether nodes can be merged and returns the merging info. If nodes cannot be merged, an error is returned.

protected validateMergePosts(array<string|int, mixed> $nodeIds) : array<string|int, mixed>
Parameters
$nodeIds : array<string|int, mixed>
Return values
array<string|int, mixed>

addChannelLastData()

This takes the total tree and adds 'last' data to it

private addChannelLastData() : mixed
Return values
mixed

cms_vb4_to_vb5_method_mapping()

private static cms_vb4_to_vb5_method_mapping(mixed $method, mixed &$request) : mixed
Parameters
$method : mixed
$request : mixed
Return values
mixed

default_vb4_to_vb5_method_mapping()

private static default_vb4_to_vb5_method_mapping(mixed $method) : mixed
Parameters
$method : mixed
Return values
mixed

filterPublicAttachmentInfo()

private filterPublicAttachmentInfo(mixed $rawAttachArray) : mixed
Parameters
$rawAttachArray : mixed
Return values
mixed

hasAdminPermissionInternal()

Internal function to power the previous cover functions

private hasAdminPermissionInternal(mixed $adminPermission) : mixed
@param string|array $adminPermission The admin permission to check.  If an array

then the check passes if the user has any of the permissions given.

Parameters
$adminPermission : mixed
Return values
mixed

moveIsTopicMerge()

private moveIsTopicMerge(mixed $nodeids, mixed $to_parent) : mixed
Parameters
$nodeids : mixed
$to_parent : mixed
Return values
mixed

remove_nulls()

private static remove_nulls(mixed &$data) : mixed
Parameters
$data : mixed
Return values
mixed

validateNodeList()

Given a list of nodes, removes those the user can't see.

private validateNodeList(array<string|int, mixed> $nodes) : array<string|int, mixed>
Parameters
$nodes : array<string|int, mixed>

-- list of node arrays

Return values
array<string|int, mixed>

the array passed minus any $nodes that fail the test

wrapLoggerIfNeeded()

Wrap the api object with the log wrapper class if needed.

private static wrapLoggerIfNeeded(mixed $controller, mixed $api_object) : mixed
Parameters
$controller : mixed
$api_object : mixed
Return values
mixed

Search results