vB_Library_Node
extends vB_Library
in package
vB_Library_Node
Tags
Table of Contents
- $albumChannel : mixed
- $articleChannel : mixed
- $contentLibs : mixed
- $forumChannel : mixed
- $infractionChannel : mixed
- $instance : mixed
- $nodeFields : mixed
- $PMChannel : mixed
- $ReportChannel : mixed
- $SGChannel : mixed
- $VMChannel : mixed
- $channelTypeId : mixed
- $excludedLastContentTypes : mixed
- $options : mixed
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- addContentInfo() : mixed
- Takes an array of node information and adds contentInfo
- addFullContentInfo() : mixed
- Takes an array of node information and adds contentInfo
- addNode() : mixed
- Adds a new node. The record must already exist as an individual content item.
- approve() : array<string|int, mixed>
- Sets the approved field
- assertNodeidStr() : int
- Convert node path or id string to node id.
- calculateNodeLastInfo() : array<string|int, mixed>
- Calculates the last node info for a given node
- canEditThreadTitle() : mixed
- Check if the user has permission for edit the thread title also check the option editthreadtitlelimit if we pass the time and we are not moderators we can edit the thread title
- censorNode() : mixed
- Censors the different text items that need censoring
- censorNodes() : mixed
- Censors the different text items in each node that need censoring
- clearCache() : mixed
- clearCacheEvents() : bool
- Clears the cache events from a given list of nodes.
- clearChildCache() : mixed
- This clear cache for all children of a node list
- clearUnpublishDate() : bool
- clears the unpublishdate flag.
- cloneNodes() : mixed
- Clone Nodes and their children deeply into a new parent Node.
- cloneNodesInternal() : mixed
- 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
- fetchAlbumChannel() : int
- returns id of the Albums Channel
- fetchArticleChannel() : int
- Returns the nodeid of the CMS/Articles channel
- fetchAttachInfo() : mixed
- This gets the attachment information filedata for a node. Which may be empty.
- fetchClosurechildren() : mixed
- Returns closure table information given a child id
- fetchClosureParent() : mixed
- Returns closure table information given a child id
- fetchForumChannel() : int
- Returns the nodeid of the root forums channel
- fetchInfractionChannel() : int
- Returns the nodeid of the infraction channel
- fetchNodeAttachments() : mixed
- This gets the attachment information for a node. Which may be empty.
- fetchPMChannel() : int
- returns id of the Private Message Channel
- fetchReportChannel() : int
- returns id of the Report Channel
- fetchVMChannel() : int|false
- returns id of the Vistor Message Channel
- fixNodeLast() : mixed
- getAlbums() : mixed
- This returns all the albums in a channel. Those can be photogalleries or text with attachments.
- getChannelId() : mixed
- Gets the starter's parent (channel) node
- getChannelInfoForNode() : mixed
- Gets the channel title and routeid
- getChildren() : mixed
- Returns node children
- getContentforNodes() : mixed
- Gets the content info for a list of nodes
- getContentInstance() : mixed
- getForumSupermoderatorsAdmins() : array<string|int, mixed>
- Returns forum super moderators and admins
- getFullContentforNodes() : mixed
- Gets the content info for a list of nodes
- getNode() : mixed
- Gets one node.
- getNodeBare() : mixed
- Gets one node.
- getNodeContent() : mixed
- This gets a content record based on nodeid. Useful from ajax.
- getNodeFields() : mixed
- Return the list of fields in the node table
- getNodeFullContent() : array<string|int, mixed>
- Returns a content record based on nodeid including channel and starter information
- getNodeModerators() : array<string|int, mixed>
- Returns the userids of the moderators of that node
- getNodeOptions() : array<string|int, mixed>
- gets the node option as an array of values
- getNodeParents() : array<string|int, mixed>
- get the ancestors of a node
- getNodes() : mixed
- Gets the node info for a list of nodes
- getNodeviews() : array<string|int, mixed>
- Fetch nodeview count(s) for nodeid(s)
- getOptions() : mixed
- gets the node option bitfields
- getParents() : mixed
- Returns the ancestry
- getSGChannel() : mixed
- getTextChangeTypes() : array<string|int, mixed>|(int)
- Gets a list of the content types that change text type
- instance() : vB_PageCache
- Returns singleton instance of self.
- isPublished() : mixed
- Determines if a node record is published or not. Note that this only checks if the record is published, not if it should be shown as published.
- listNodes() : mixed
- lists the nodes that should be displayed on a specific page.
- listNodesInternal() : mixed
- listPendingPosts() : mixed
- Gets the list of unapproved posts for the current user
- listPendingPostsForCurrentUser() : mixed
- This was a function wrapper for listPendingPosts but used for current user.
- markChannelsRead() : array<string|int, mixed>
- Marks a channel, its child channels and all contained topics as read
- markChannelsUnread() : array<string|int, mixed>
- Marks a channel as unread
- markRead() : array<string|int, mixed>
- Marks a node as read using the appropriate method.
- markReadMultiple() : array<string|int, mixed>
- Mark multiple nodes read
- markSubscribed() : mixed
- marks nodes with "subscribed" true/false
- markUnread() : array<string|int, mixed>
- Marks a node as unread using the appropriate method.
- markUnreadMultiple() : array<string|int, mixed>
- Mark multiple nodes unread
- mergePostedStatusForTopics() : array<string|int, mixed>
- Merges "posted" info into the topics array, used by the display_Topics template.
- monitorWords() : mixed
- Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
- moveNodes() : mixed
- Moves nodes to a new parent
- nodesChanged() : mixed
- Fire the node changed event for just the nodes in the list
- openNode() : mixed
- opens a node for posting
- publishChildren() : mixed
- Updates the showpublished & count fields of $parentid & its descendents for publishing
- removePrivateDataFromNodeList() : none
- Cleans the node list according the to permissions set in the node record for the current user. For use by various APIs that return node information to consolidate the cleaning in one place.
- requestChannel() : mixed
- This creates a request for access to a channel
- resetAncestorCounts() : mixed
- Updates the ancestors counts and last data from a given node being deleted.
- 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() : either
- Set the node options
- setPublishDate() : bool
- Sets the publishdate and (optionally) the unpublish date of a node
- setUnPublishDate() : bool
- Sets the unpublish date
- setUnPublished() : bool
- sets a node to not published
- timedCountUpdates() : mixed
- Checks for any content that needs to be published or unpublished.
- unapprove() : array<string|int, mixed>
- Unsets the approved field
- undeleteNodes() : array<string|int, mixed>
- Undelete a set of nodes
- unpublishChildren() : mixed
- Updates the showpublished & count fields of $parentid & its descendents for unpublishing Caller MUST ensure that $parentid is actually unpublished (i.e. a valid unpublishdate is set)
- updateAddRemovedNodeParentCounts() : mixed
- Add or remove node counts for a given node its parents
- updateParentCounts() : mixed
- Updates the parent counts and data when saving a node.
- __construct() : mixed
- addOptionalContentInfo() : mixed
- Adds optional content information. At the time of this writing it understands showVM and withParent
- addOptionalNodeContentInfo() : mixed
- Adds optional content information for a single node.
- cleanNodeList() : void
- This takes a list of nodes, and returns node records for all that are valid nodeids.
- getLibraryClassNameInternal() : mixed
- markJoined() : mixed
- Adds the joined flag if the current user is member of content's parent.
- moveNodesInternal() : mixed
- Handles the actual move of nodes to the new parent.
- updateLastForSubtree() : mixed
- updateSubTreePublishStatus() : mixed
- getExcludedLastContentTypes() : mixed
- getParentIds() : mixed
- getRecipientFromName() : mixed
- removeDescendants() : mixed
- updateChangedNodeParentCounts() : mixed
- Update the ancestors of a changed node based on the new counts
- updateParentCountsList() : mixed
- Updates the parent counts and data when saving a node.
Properties
$albumChannel
protected
mixed
$albumChannel
= alse
$articleChannel
protected
mixed
$articleChannel
= alse
$contentLibs
protected
mixed
$contentLibs
= array()
$forumChannel
protected
mixed
$forumChannel
= alse
$infractionChannel
protected
mixed
$infractionChannel
= alse
$instance
protected
static mixed
$instance
= array()
$nodeFields
protected
mixed
$nodeFields
= array()
$PMChannel
protected
mixed
$PMChannel
= alse
$ReportChannel
protected
mixed
$ReportChannel
= alse
$SGChannel
protected
mixed
$SGChannel
= alse
$VMChannel
protected
mixed
$VMChannel
= alse
$channelTypeId
private
mixed
$channelTypeId
$excludedLastContentTypes
private
mixed
$excludedLastContentTypes
$options
private
mixed
$options
= array('allow_post' => B_Api_Node::OPTION_ALLOW_POST, 'moderate_comments' => B_Api_Node::OPTION_MODERATE_COMMENTS, 'approve_membership' => B_Api_Node::OPTION_AUTOAPPROVE_MEMBERSHIP, 'invite_only' => B_Api_Node::OPTION_NODE_INVITEONLY, 'autoparselinks' => B_Api_Node::OPTION_NODE_PARSELINKS, 'disablesmilies' => B_Api_Node::OPTION_NODE_DISABLE_SMILIES, 'approve_subscription' => B_Api_Node::OPTION_AUTOAPPROVE_SUBSCRIPTION, 'moderate_topics' => B_Api_Node::OPTION_MODERATE_TOPICS, 'auto_subscribe_on_join' => B_Api_Node::OPTION_AUTOSUBSCRIBE_ON_JOIN, 'disable_bbcode' => B_Api_Node::OPTION_NODE_DISABLE_BBCODE, 'hide_title' => B_Api_Node::OPTION_NODE_HIDE_TITLE, 'hide_author' => B_Api_Node::OPTION_NODE_HIDE_AUTHOR, 'hide_publishdate' => B_Api_Node::OPTION_NODE_HIDE_PUBLISHDATE, 'display_fullincategory' => B_Api_Node::OPTION_NODE_DISPLAY_FULL_IN_CATEGORY, 'display_pageviews' => B_Api_Node::OPTION_NODE_DISPLAY_PAGEVIEWS, 'hide_comment_count' => B_Api_Node::OPTION_NODE_HIDE_COMMENT_COUNT)
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 —addContentInfo()
Takes an array of node information and adds contentInfo
public
addContentInfo(mixed $nodeList[, mixed $options = array() ]) : mixed
Parameters
- $nodeList : mixed
- $options : mixed = array()
Return values
mixed —addFullContentInfo()
Takes an array of node information and adds contentInfo
public
addFullContentInfo(mixed $nodeList[, mixed $options = array() ]) : mixed
Parameters
- $nodeList : mixed
- $options : mixed = array()
Return values
mixed —addNode()
Adds a new node. The record must already exist as an individual content item.
public
addNode(mixed $contenttypeid, mixed $data) : mixed
Parameters
- $contenttypeid : mixed
- $data : mixed
Return values
mixed —approve()
Sets the approved field
public
approve(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed
assertNodeidStr()
Convert node path or id string to node id.
public
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
calculateNodeLastInfo()
Calculates the last node info for a given node
public
calculateNodeLastInfo(int $nodeid) : array<string|int, mixed>
this mostly exists as a public function for testing purposes. generally you will want to call fixNodeLast
Parameters
- $nodeid : int
Return values
array<string|int, mixed> —-- array('lastcontent', 'lastcontentid', 'lastcontentauthor', 'lastauthorid') values suitable for updating to the node record
canEditThreadTitle()
Check if the user has permission for edit the thread title also check the option editthreadtitlelimit if we pass the time and we are not moderators we can edit the thread title
public
canEditThreadTitle(int $nodeid[, mixed $node = false ]) : mixed
Parameters
- $nodeid : int
- $node : mixed = false
Return values
mixed —censorNode()
Censors the different text items that need censoring
public
censorNode(mixed &$node) : mixed
Parameters
- $node : mixed
Return values
mixed —censorNodes()
Censors the different text items in each node that need censoring
public
censorNodes(mixed &$nodes) : mixed
Parameters
- $nodes : mixed
Return values
mixed —clearCache()
public
static clearCache() : mixed
Return values
mixed —clearCacheEvents()
Clears the cache events from a given list of nodes.
public
clearCacheEvents(mixed $nodeIds) : bool
Useful to keep search results updated due node changes.
This will aggressively detect and clear cache for associated nodes (but not any decendants)
Parameters
- $nodeIds : mixed
Return values
bool —clearChildCache()
This clear cache for all children of a node list
public
clearChildCache(mixed $nodeids) : mixed
@param mixed array of nodes
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 = '' ]) : 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
mixed —array of origional nodeids as keys, cloned nodeids as values
cloneNodesInternal()
public
cloneNodesInternal(mixed $nodes, mixed $parent, mixed $newtitle) : mixed
Parameters
- $nodes : mixed
- $parent : mixed
- $newtitle : mixed
Return values
mixed —closeNode()
Closes a node for posting. Closed nodes can still be viewed but nobody can reply to one.
public
closeNode(mixed $nodeids) : mixed
@param mixed integer or array of integers
Parameters
- $nodeids : 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 $deleteNodeIds, mixed $hard, mixed $reason[, mixed $modlog = true ][, mixed $reportspam = false ]) : array<string|int, mixed>
Parameters
- $deleteNodeIds : mixed
- $hard : mixed
- $reason : mixed
- $modlog : mixed = true
- $reportspam : mixed = false
Return values
array<string|int, mixed> —nodeids that were deleted
fetchAlbumChannel()
returns id of the Albums Channel
public
fetchAlbumChannel() : int
Return values
int —array including
fetchArticleChannel()
Returns the nodeid of the CMS/Articles channel
public
fetchArticleChannel() : int
Return values
int —The nodeid for the CMS channel
fetchAttachInfo()
This gets the attachment information filedata for a node. Which may be empty.
public
fetchAttachInfo(mixed $parentIds) : mixed
Parameters
- $parentIds : mixed
Return values
mixed —either false or an array of filedata.
fetchClosurechildren()
Returns closure table information given a child id
public
fetchClosurechildren(mixed $parentids) : mixed
Parameters
- $parentids : mixed
Return values
mixed —fetchClosureParent()
Returns closure table information given a child id
public
fetchClosureParent(mixed $childids[, mixed $parentid = false ]) : mixed
Parameters
- $childids : mixed
- $parentid : mixed = false
Return values
mixed —fetchForumChannel()
Returns the nodeid of the root forums channel
public
fetchForumChannel() : int
Return values
int —The nodeid for the root forums channel
fetchInfractionChannel()
Returns the nodeid of the infraction channel
public
fetchInfractionChannel() : int
Return values
int —The nodeid for the infraction channel
fetchNodeAttachments()
This gets the attachment information for a node. Which may be empty.
public
fetchNodeAttachments(mixed $parentids) : mixed
Parameters
- $parentids : 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
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
fetchVMChannel()
returns id of the Vistor Message Channel
public
fetchVMChannel() : int|false
Return values
int|false —-- nodeid for the VM Channel. False if the channel doesn't exist (which should normally only be the case in the installer code);
fixNodeLast()
public
fixNodeLast(mixed $nodeid) : mixed
Parameters
- $nodeid : mixed
Return values
mixed —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
Return values
mixed —array of node records. Each node includes the node content and userinfo, and attachment records.
getChannelId()
Gets the starter's parent (channel) node
public
getChannelId(mixed $node) : mixed
Parameters
- $node : mixed
Return values
mixed —getChannelInfoForNode()
Gets the channel title and routeid
public
getChannelInfoForNode(mixed $channelId) : mixed
Parameters
- $channelId : mixed
Return values
mixed —Array of channel info
getChildren()
Returns node children
public
getChildren(mixed $nodeid) : mixed
@param int nodeid
Parameters
- $nodeid : mixed
Return values
mixed —array of partial node records
getContentforNodes()
Gets the content info for a list of nodes
public
getContentforNodes(mixed $nodeList[, mixed $options = array() ]) : mixed
Parameters
- $nodeList : mixed
- $options : mixed = array()
Return values
mixed —getContentInstance()
public
static getContentInstance(mixed $contenttypeid) : mixed
Parameters
- $contenttypeid : mixed
Return values
mixed —getForumSupermoderatorsAdmins()
Returns forum super moderators and admins
public
getForumSupermoderatorsAdmins([mixed $userids = array() ]) : array<string|int, mixed>
Parameters
- $userids : mixed = array()
Return values
array<string|int, mixed> —- the userid, username, email of the moderators of the node
getFullContentforNodes()
Gets the content info for a list of nodes
public
getFullContentforNodes(array<string|int, mixed> $nodeList[, mixed $options = array() ]) : mixed
Parameters
- $nodeList : array<string|int, mixed>
-
Ids of the nodes to be fetched
@return array array of content records -- preserves the original keys
- $options : mixed = array()
Return values
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 —getNodeBare()
Gets one node.
public
getNodeBare(mixed $nodeid) : mixed
Parameters
- $nodeid : mixed
Return values
mixed —Array of node records
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()
Tags
Return values
mixed —getNodeFields()
Return the list of fields in the node table
public
getNodeFields() : mixed
Return values
mixed —getNodeFullContent()
Returns a content record based on nodeid including channel and starter information
public
getNodeFullContent(mixed $nodeid[, mixed $contenttypeid = false ][, mixed $options = array() ]) : array<string|int, mixed>
Parameters
- $nodeid : mixed
- $contenttypeid : mixed = false
- $options : mixed = array()
Return values
array<string|int, mixed> —Content record
getNodeModerators()
Returns the userids of the moderators of that node
public
getNodeModerators(int $nodeid) : array<string|int, mixed>
Parameters
- $nodeid : int
Return values
array<string|int, mixed> —getNodeOptions()
gets the node option as an array of values
public
getNodeOptions(mixed $nodeid) : array<string|int, mixed>
@param int nodeid of the desired record
Parameters
- $nodeid : mixed
Return values
array<string|int, mixed> —associative array of bitfield name => 0 or 1
getNodeParents()
get the ancestors of a node
public
getNodeParents(int $nodeid) : array<string|int, mixed>
Parameters
- $nodeid : int
Return values
array<string|int, mixed> —getNodes()
Gets the node info for a list of nodes
public
getNodes(mixed $nodeList[, mixed $withJoinableContent = false ]) : mixed
Parameters
- $nodeList : mixed
- $withJoinableContent : mixed = false
Return values
mixed —getNodeviews()
Fetch nodeview count(s) for nodeid(s)
public
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(
getOptions()
gets the node option bitfields
public
getOptions() : mixed
@return array associative array of bitfield name => value
Return values
mixed —getParents()
Returns the ancestry
public
getParents(mixed $nodeid) : mixed
@param int nodeid
Parameters
- $nodeid : mixed
Return values
mixed —array of partial node records -- in ascending order of depth
getSGChannel()
public
getSGChannel() : mixed
Return values
mixed —getTextChangeTypes()
Gets a list of the content types that change text type
public
getTextChangeTypes() : array<string|int, mixed>|(int)
Return values
array<string|int, mixed>|(int) —instance()
Returns singleton instance of self.
public
static instance(mixed $class) : vB_PageCache
Parameters
- $class : mixed
Return values
vB_PageCache —- Reference to singleton instance of the cache handler
isPublished()
Determines if a node record is published or not. Note that this only checks if the record is published, not if it should be shown as published.
public
isPublished(mixed $node) : mixed
Parameters
- $node : mixed
Return values
mixed —listNodes()
lists the nodes that should be displayed on a specific page.
public
listNodes(mixed $parentid, mixed $page, mixed $perpage, mixed $depth, mixed $contenttypeid, mixed $options[, mixed $withJoinableContent = false ]) : mixed
Parameters
- $parentid : mixed
- $page : mixed
- $perpage : mixed
- $depth : mixed
- $contenttypeid : mixed
- $options : mixed
- $withJoinableContent : mixed = false
Return values
mixed —listNodesInternal()
public
listNodesInternal(mixed $parentid, mixed $page, mixed $perpage, mixed $depth, mixed $contenttypeid, mixed $options[, mixed $withJoinableContent = false ]) : mixed
Parameters
- $parentid : mixed
- $page : mixed
- $perpage : mixed
- $depth : mixed
- $contenttypeid : mixed
- $options : mixed
- $withJoinableContent : mixed = false
Return values
mixed —listPendingPosts()
Gets the list of unapproved posts for the current user
public
listPendingPosts([mixed $userId = false ][, mixed $options = [] ]) : mixed
Parameters
- $userId : mixed = false
- $options : mixed = []
Return values
mixed —Array containing the pending posts nodeIds with contenttypeid associated.
listPendingPostsForCurrentUser()
This was a function wrapper for listPendingPosts but used for current user.
public
listPendingPostsForCurrentUser([mixed $options = [] ]) : mixed
Now returns different information due to post processing steps.
Parameters
- $options : mixed = []
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
markChannelsUnread()
Marks a channel as unread
public
markChannelsUnread(int $nodeid) : array<string|int, mixed>
Parameters
- $nodeid : int
-
The node ID of channel being marked. If 0, all channels will be marked as unread
Return values
array<string|int, mixed> —Returns an array of channel ids that were marked as unread
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. The node should be a channel or starter.
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
Return values
array<string|int, mixed> —Returns an array of nodes that were marked as read
markSubscribed()
marks nodes with "subscribed" true/false
public
markSubscribed(mixed &$nodes) : mixed
Parameters
- $nodes : mixed
Return values
mixed —markUnread()
Marks a node as unread using the appropriate method.
public
markUnread(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 unread
markUnreadMultiple()
Mark multiple nodes unread
public
markUnreadMultiple( $nodeids) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed> —Returns an array of nodes that were marked as unread
mergePostedStatusForTopics()
Merges "posted" info into the topics array, used by the display_Topics template.
public
mergePostedStatusForTopics(mixed $nodes, mixed $userid) : array<string|int, mixed>
This adds the "content.posted" element to the node record. The value is the number of times the passed userid has posted in the topic (replies and comments); zero if none.
Parameters
- $nodes : mixed
- $userid : mixed
Return values
array<string|int, mixed> —Same array of nodes, with the "posted" element added to the "content" sub-array
monitorWords()
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
public
monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ], mixed $currentuserid) : mixed
Parameters
- $text : mixed
- $type : mixed
- $nodeid : mixed
- $userid : mixed = null
- $insertNotifications : mixed = true
- $currentuserid : mixed
Return values
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 —nodesChanged()
Fire the node changed event for just the nodes in the list
public
nodesChanged(int|array<string|int, mixed> $nodeIds) : mixed
Does not attempt to
Parameters
- $nodeIds : int|array<string|int, mixed>
Return values
mixed —openNode()
opens a node for posting
public
openNode(mixed $nodeids) : mixed
@param mixed integer or array of integers
Parameters
- $nodeids : mixed
Return values
mixed —Either array 'errors' => error string or array of id's.
publishChildren()
Updates the showpublished & count fields of $parentid & its descendents for publishing
public
publishChildren(int $parentid) : mixed
Caller MUST ensure that $parentid is actually published (i.e. a valid publishdate is set and a positive unpublishdate is removed or in the future). This claimed but not entirely true of the previous version of the function (which would set the parent node showpublished to true regardless of the dates which meant that it would work if the dates were corrected after the call to publish children). This version of the function requires that the dates are set correctly before it is called.
Caller MUST also ensure that approved and showapproved flags are correctly set in the entire substree headed by $parentid, otherwise the counts may end up being off.
Parameters
- $parentid : int
-
nodeid of node being published @return mixed An array that contains the updated count fields of $parentid, or an array with key 'errors' if the assertor hit an error while updating
Return values
mixed —removePrivateDataFromNodeList()
Cleans the node list according the to permissions set in the node record for the current user. For use by various APIs that return node information to consolidate the cleaning in one place.
public
removePrivateDataFromNodeList(array<string|int, mixed> &$nodelist) : none
Currently removes the ipaddress fields when the user should not be able to view them.
The passed node array is cleaned in place to avoid unnecesary copies of large objects instead of returned.
Parameters
- $nodelist : array<string|int, mixed>
Return values
none —requestChannel()
This creates a request for access to a channel
public
requestChannel(int $channelid, string $requestType, int $recipient[, string $recipientname = null ][, bool $skipFloodCheck = false ]) : 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 : int
-
the userid of the member who will get the request
- $recipientname : string = null
-
(Optional) the username of the member who will get the request
- $skipFloodCheck : bool = false
-
(Optional) whether request private message should skip flood check or not
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.
resetAncestorCounts()
Updates the ancestors counts and last data from a given node being deleted.
public
resetAncestorCounts(mixed $existing, mixed $ancestorsData, mixed $hard) : mixed
Counts and last data are info from the node table records: totalcount, totalunpubcount, textcount, textunpubcount lastcontentid, lastcontent, lastauthor, lastauthorid. Is critical that the ancestors are in DESC order so we can properly update.
Parameters
- $existing : mixed
- $ancestorsData : mixed
- $hard : mixed
Return values
mixed —setApproved()
Sets or unsets the approved field
public
setApproved(mixed $approveNodeIds[, bool $approved = true ]) : array<string|int, mixed>
Parameters
- $approveNodeIds : mixed
- $approved : bool = true
-
- set or unset the approved field
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed
setApprovedPost()
Approves a post. Since the publish date might be affected user will need moderate and publish posts permissions.
public
setApprovedPost([mixed $nodeid = false ][, mixed $approved = false ]) : bool
Parameters
- $nodeid : mixed = false
- $approved : mixed = false
Tags
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(mixed $nodeid[, mixed $options = false ]) : either
Parameters
- $nodeid : mixed
- $options : mixed = false
Return values
either —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 —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 —timedCountUpdates()
Checks for any content that needs to be published or unpublished.
public
timedCountUpdates([mixed $maxrows = 25 ]) : mixed
Parameters
- $maxrows : mixed = 25
Return values
mixed —unapprove()
Unsets the approved field
public
unapprove(array<string|int, mixed> $nodeids) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —- the nodeids that have the permission to be changed
undeleteNodes()
Undelete a set of nodes
public
undeleteNodes(array<string|int, mixed> $nodeids[, mixed $needRebuild = false ]) : array<string|int, mixed>
Parameters
- $nodeids : array<string|int, mixed>
- $needRebuild : mixed = false
Tags
Return values
array<string|int, mixed> —- the nodeids that have been deleted
unpublishChildren()
Updates the showpublished & count fields of $parentid & its descendents for unpublishing Caller MUST ensure that $parentid is actually unpublished (i.e. a valid unpublishdate is set)
public
unpublishChildren(mixed $parentid) : mixed
@param int $parentid nodeid of node being unpublished
Parameters
- $parentid : mixed
Return values
mixed —Can be false (for no updates), an array that contains the updated count fields of $parentid, or an array with key 'errors' if the assertor hit an error while updating
updateAddRemovedNodeParentCounts()
Add or remove node counts for a given node its parents
public
updateAddRemovedNodeParentCounts(array<string|int, mixed> $node, arrray $counts, bool $publish, bool $add[, mixed $parentids = array() ]) : mixed
Note this should be called before removing a node entire from the tree (or moving it to a new location) and after adding it to the tree (or moving it to a new location). It corrects the counts of parents based on the change made, but it affects the parents of the node at the time the function is called -- we always want to remove the count of the nodes old parents (prior to a move or delete) and add to the new parents (after a more or an add).
Parameters
- $node : array<string|int, mixed>
-
-- the node array
- $counts : arrray
-
-- the "count" array ('showpublished', 'showapproved', 'textcount', 'textunpubcount', 'totalcount', 'totalunpubcount') either from the node record or the publishChildren function (it is permissable to pass the node array here if the counts are accurate, but the function guarentees it will only access the listed fields so updated information form publishChildren can be passed instead).
- $publish : bool
-
-- controls if the parent lastcontent is also updated.
- $add : bool
-
-- true to add the counts, false to remove
- $parentids : mixed = array()
Return values
mixed —updateParentCounts()
Updates the parent counts and data when saving a node.
public
updateParentCounts(int $nodeid, int $textChange, int $textUnPubChange, int $totalPubChange, int $totalUnPubChange, bool $published[, bool $updatelastcontent = true ]) : mixed
Parameters
- $nodeid : int
-
-- ID of the node who's parents should be updated
- $textChange : int
-
-- change in the "text" count. This is the badly named field for published direct children.
- $textUnPubChange : int
-
-- Change in the direct unpublished children
- $totalPubChange : int
-
-- Change in the count of the published decendants
- $totalUnPubChange : int
-
-- Change in the count of the unpublished decendants
- $published : bool
- $updatelastcontent : bool = true
Return values
mixed —__construct()
protected
__construct() : mixed
Return values
mixed —addOptionalContentInfo()
Adds optional content information. At the time of this writing it understands showVM and withParent
protected
addOptionalContentInfo(mixed &$nodeList[, mixed $options = false ]) : mixed
Parameters
- $nodeList : mixed
- $options : mixed = false
Return values
mixed —addOptionalNodeContentInfo()
Adds optional content information for a single node.
protected
addOptionalNodeContentInfo(mixed &$node[, mixed $options = false ]) : mixed
At the time of this writing it understands showVM and withParent
Parameters
- $node : mixed
- $options : mixed = false
Return values
mixed —cleanNodeList()
This takes a list of nodes, and returns node records for all that are valid nodeids.
protected
cleanNodeList(mixed &$nodeList[, bool $withJoinableContent = false ]) : void
@param array|int $nodeList array of ints or single int
Parameters
- $nodeList : mixed
- $withJoinableContent : bool = false
-
Include joinable content
Return values
void —getLibraryClassNameInternal()
protected
static getLibraryClassNameInternal(mixed $controller) : mixed
Parameters
- $controller : mixed
Return values
mixed —markJoined()
Adds the joined flag if the current user is member of content's parent.
protected
markJoined(mixed &$nodes) : mixed
Parameters
- $nodes : mixed
Tags
Return values
mixed —moveNodesInternal()
Handles the actual move of nodes to the new parent.
protected
moveNodesInternal(array<string|int, mixed> $nodeids, mixed $newparent) : mixed
Makes all nodes ids direct children of new parent. Also cleans up some, but not all, of the various denormalized data surrounding moving a node.
This was refactored from the "moveNodes" method query and should continue to be refactored so it only handles updating the parent field and the closure table records directly involved in moving a node. The public function shoudl handle clearning up the denormalized data.
Parameters
- $nodeids : array<string|int, mixed>
-
nodes to move @param array $newparent the standard node array for the parent node
- $newparent : mixed
Return values
mixed —updateLastForSubtree()
protected
updateLastForSubtree(mixed $rootid) : mixed
Parameters
- $rootid : mixed
Return values
mixed —updateSubTreePublishStatus()
protected
updateSubTreePublishStatus(mixed $node, mixed $isParentPublished) : mixed
Parameters
- $node : mixed
- $isParentPublished : mixed
Return values
mixed —getExcludedLastContentTypes()
private
getExcludedLastContentTypes() : mixed
Return values
mixed —getParentIds()
private
getParentIds(mixed $nodeid) : mixed
Parameters
- $nodeid : mixed
Return values
mixed —getRecipientFromName()
private
getRecipientFromName(mixed $recipientname) : mixed
Parameters
- $recipientname : mixed
Return values
mixed —removeDescendants()
private
removeDescendants(mixed $db, mixed $nodeids) : mixed
Parameters
- $db : mixed
- $nodeids : mixed
Return values
mixed —updateChangedNodeParentCounts()
Update the ancestors of a changed node based on the new counts
private
updateChangedNodeParentCounts(array<string|int, mixed> $origNode, array<string|int, mixed> $counts) : mixed
Parameters
- $origNode : array<string|int, mixed>
-
-- the original node array of the node that changed prior to updating it's status
- $counts : array<string|int, mixed>
-
-- the return from the "publish children" function used to update the node's subtree.
Return values
mixed —updateParentCountsList()
Updates the parent counts and data when saving a node.
private
updateParentCountsList(array<string|int, mixed> $parentids, int $textChange, int $textUnPubChange, int $totalPubChange, int $totalUnPubChange, bool $published[, bool $updatelastcontent = true ]) : mixed
Parameters
- $parentids : array<string|int, mixed>
-
-- $ids of the node to updates parents. Should not include the node itself
- $textChange : int
-
-- change in the "text" count. This is the badly named field for published direct children.
- $textUnPubChange : int
-
-- Change in the direct unpublished children
- $totalPubChange : int
-
-- Change in the count of the published decendants
- $totalUnPubChange : int
-
-- Change in the count of the unpublished decendants
- $published : bool
-
(no longer appears to do anything)
- $updatelastcontent : bool = true