vBulletin 5.6.5 API

vB_Library_Content_Privatemessage extends vB_Library_Content_Text
in package

vB_Library_Content_Privatemessage

Tags
access

public

Table of Contents

ACTION_ADD  = 1
ACTION_APPROVE  = 5
ACTION_DELETE  = 4
ACTION_PUBLISH  = 6
ACTION_UPDATE  = 2
ACTION_VIEW  = 3
CACHELEVEL_CONTENT  = 2
CACHELEVEL_FULLCONTENT  = 3
CACHELEVEL_NODE  = 1
DELETED_ITEMS_FOLDER  = 'deleted_items'
INFRACTION_FOLDER  = 'infractions'
MESSAGE_FOLDER  = 'messages'
NOTIFICATION_FOLDER  = 'your_notifications'
NOTIFICATION_TYPE_COMMENT  = 'comment'
NOTIFICATION_TYPE_FOLLOW  = 'follow'
NOTIFICATION_TYPE_FOLLOWING  = 'following'
NOTIFICATION_TYPE_MODERATE  = 'moderate'
NOTIFICATION_TYPE_MONITOREDWORD  = 'monitoredword'
NOTIFICATION_TYPE_RATE  = 'rate'
NOTIFICATION_TYPE_REPLY  = 'reply'
NOTIFICATION_TYPE_REPORTEDPOST  = 'reportedpost'
NOTIFICATION_TYPE_SPAMPOST  = 'spampost'
NOTIFICATION_TYPE_SUBSCRIPTION  = 'subscription'
NOTIFICATION_TYPE_THREADCOMMENT  = 'threadcomment'
NOTIFICATION_TYPE_UNAPPROVEDPOST  = 'unapprovedpost'
NOTIFICATION_TYPE_USERMENTION  = 'usermention'
NOTIFICATION_TYPE_VM  = 'vm'
NOTIFICATION_TYPE_VOTE  = 'vote'
NOTIFICATION_TYPE_VOTEREPLY  = 'vote_reply'
PENDING_FOLDER  = 'pending_posts'
REQUEST_FOLDER  = 'requests'
SENT_FOLDER  = 'sent_items'
TRASH_FOLDER  = 'trash'
$allCanview  : mixed
$assertor  : mixed
$bbcode_parser  : mixed
$cacheNodes  : mixed
Whether we are caching node content
$canBeLastContent  : mixed
$cannotDelete  : mixed
$canSee  : mixed
$channelFollowRequests  : mixed
$channelRequests  : mixed
$channelTypeId  : mixed
$contenttype  : mixed
$contenttypeid  : mixed
$defaultNodeOptions  : mixed
$doFloodCheck  : mixed
$doIncompleteNodeCleanup  : bool
$folders  : mixed
$foldersInfo  : mixed
$includeInUserPostCount  : bool
If true, then creating a node of this content type will increment the user's post count. If false, it will not. Generally, this should be true for topic starters and replies, and false for everything else.
$index_fields  : mixed
$inheritViewPerms  : mixed
$inlist  : mixed
$instance  : mixed
$nodeApi  : mixed
$nodeLibrary  : mixed
$notificationTypes  : mixed
$pmChannel  : mixed
$qryAfterAdd  : mixed
$showSignature  : mixed
$skipModNotification  : mixed
$spamKey  : mixed
$spamType  : mixed
$tablename  : mixed
$textCountChange  : mixed
$descriptionLength  : mixed
__serialize()  : mixed
__sleep()  : mixed
__unserialize()  : mixed
__wakeup()  : mixed
acceptRequest()  : bool
This function accepts a user follow request or a channel ownership/moderation/membership request
add()  : array<string|int, mixed>
This adds a new message
addMessageInfo()  : mixed
Returns the node content as an associative array
addMessageNoFlood()  : int
Adds a message without triggering the flood check.
assembleContent()  : array<string|int, mixed>
Assembles the response for detailed content
autoPopulatePreviewImage()  : mixed
DEPRECATED: This needs to remain until the corresponding API function is removed
buildPmTotals()  : mixed
Calculates the number of private messages that a user has in the system Used to limit pm abilities based on overage of this count
checkCanReceivePM()  : mixed
checkCanSee()  : int
Checks nodes to ensure that the current user can see them.
checkComplete()  : bool
This function checks to see if a node is valid, and if not it deletes or fixes it.
checkFolders()  : array<string|int, mixed>
This function checks that we have all the folders for the current user, and the set folders are there.
clearCache()  : mixed
convertLegacyNotificationAboutString()  : string|bool
Translates the legacy notification type string into the new notification typename
convertNotificationTypeToLegacyAboutString()  : string
Translates the legacy notification type string into an array of type information
createMessageFolder()  : int
This creates a new message folder. It returns false if the record already exists and the id if it is able to create the folder
decrementUserPostCount()  : mixed
Decrements the number of posts for a user
delete()  : bool
Permanently deletes a node
deleteChildren()  : mixed
Delete the records without updating the parent info. It is used when deleting a whole channel and it's children need to be removed
deleteMessage()  : bool
Permanently deletes a message
deleteMessages()  : bool
Delete messages
deleteMessagesForUser()  : int
Deletes all pms for a given user
deleteSentMessagesForUser()  : mixed
denyRequest()  : array<string|int, mixed>
This function denies a user follow request
fetchContentType()  : mixed
fetchContentTypeId()  : mixed
fetchFolders()  : mixed
returns the cached folder information
fetchFromCache()  : mixed
This attempts to get the cached data for nodes
fetchNotificationTypes()  : mixed
Return all the valid notification types
fetchSummary()  : mixed
This summarizes messages for specified user
fetchTableName()  : array<string|int, mixed>
returns the tables used by this content type.
fixAttachBBCode()  : mixed
DEPRECATED: This needs to remain until the corresponding API function is removed
getAllCanView()  : mixed
Returns the fields that all users can see if they don't have canviewthreads
getBareContent()  : mixed
Returns the node content plus the channel routeid and title, and starter route and title the as an associative array Caller MUST ensure that $nodeids are of the correct content type.
getCanBeLastContent()  : mixed
getCanDelete()  : bool
Determines whether the current user can soft-delete or hard-delete
getCanEdit()  : bool
Determines whether the current user can edit a node
getCanModerate()  : bool
Determines whether the current user can moderate
getCannotDelete()  : bool
Whether this type can be deleted. Infractions, for example, cannot be.
getChannelRequestTypes()  : mixed
Returns array of Request message types
getContent()  : int
Returns the node content as an associative array
getContentApi()  : mixed
Returns a content api of the appropriate type
getContentInstance()  : mixed
getContentLib()  : mixed
Returns a content api of the appropriate type
getConversationParent()  : array<string|int, mixed>
Gets the conversation starter for a node. If the node is a channel it returns the channel record.
getDeletedItemsFolderId()  : int
Get the deleted_items folder id
getFolderFromId()  : array<string|int, mixed>
Gets the folder information from a given folderid. The folderid requested should belong to the user who is requesting.
getFullContent()  : array<string|int, mixed>
Returns the node content as an associative array
getIndexableContent()  : array<string|int, mixed>
The classes that inherit this should implement this function It should return the content that should be indexed If there is a title field, the array key for that field should be 'title', the rest of the text can have any key
getIndexableFromNode()  : mixed
This function is used internally by vB_Search_Core::getTitleAndText()
getInfractionFolderId()  : int
Get the infraction folder id
getInlist()  : int
Returns inlist property
getMessage()  : mixed
Get a message
getMessageTree()  : array<string|int, mixed>
Get a message and all replies and sets the message to "read"
getPendingPostFolderId()  : int
Get the pending posts folder id
getQuotes()  : array<string|int, mixed>|string
This returns a string with quoted strings in bbcode format.
getQuotesFromNodes()  : mixed
Helper function to allow getQuotes in the API and Library classes to generate the node list independantly (so that the API can check perms without loading the nodes twice).
getRequest()  : array<string|int, mixed>
Get a single request
getStarter()  : int
Gets the conversation starter for a node. If the node is a channel it returns the channelid.
getTextCountChange()  : int
Returns textCountChange property
incompleteNodeCleanup()  : mixed
This cleans up for a node that was found to be incomplete by deleting the child nodes and subsidiary table records
incrementUserPostCount()  : mixed
Increments the number of posts for a user. This function will also update user's "lastpost" field
instance()  : vB_PageCache
Returns singleton instance of self.
isComment()  : bool
Determines whether a specific node is a comment on a thread reply or not
isPublished()  : bool
Is this record in a published state based on the times?
isVisitorMessage()  : bool
determines whether a specific node is a visitor message
listFolders()  : mixed
This lists the folders.
listMessages()  : array<string|int, mixed>
This lists messages for current user
listNotifications()  : array<string|int, mixed>
listSpecialPrivateMessages()  : mixed
This lists messages for current user
mergeContent()  : type
Performs the merge of content and updates the node.
mergeContentInfo()  : mixed
monitorWords()  : mixed
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
moveMessage()  : bool
Moves a message to a different folder
parseAndStrip()  : mixed
postBbcodeParseCleanRawtext()  : mixed
Cleans the input in the $data array, specifically *after* any html/wysiwyg -> bbcode parsing.
reloadOptions()  : mixed
Reload options from datastore. Currently only used by unit tests.
removePrivateDataFromNode()  : none
Examines the node record returned from the node library and determines if any information needs to be removed before passing beyond the API layer.
resetCountCalled()  : mixed
Reset the called array- this makes sure we only increment/decrement user post counts once for a given node This is only needed by the unit tests.
resetFolders()  : mixed
Clears the cached folder information
setDoIncompleteNodeCleanup()  : mixed
Sets the $doIncompleteNodeCleanup flag
setRead()  : mixed
This sets a message to read
toTrashcan()  : mixed
Moves a node to the trashcan. Wrapper for deleteMessage()
undeleteMessage()  : bool
Move a message back to user inbox folder
unsetFolders()  : mixed
returns the cached folder information
update()  : mixed
updates a record
userReceivesNotification()  : bool
Checks if userid's notification options for notification type
validate()  : bool
Validates the data according to the action to be taken
validateRequest()  : array<string|int, mixed>
Verifies that the request exists and its valid.
writeToCache()  : void
writes new cached data for nodes
__construct()  : mixed
addContentInfo()  : mixed
afterAdd()  : mixed
Operations to be done after adding a node. Putting actions here allow child classes to minimize time keeping transaction open.
beforeCommit()  : mixed
Called by the first child class just before the commit happens.
changeContentType()  : mixed
checkFloodAndThrowException()  : mixed
countInUserPostCount()  : bool
Checks if the current node should be counted in the user post count for the author.
duplicateCheck()  : mixed
fillContentTableData()  : mixed
getDuplicateHash()  : string
Calculates the CRC based on the indexable content
getIndexableContentForAttachments()  : mixed
Get the indexable content for attachments. Separate this so that child classes can rewrite getIndexableContent entirely without having to copy as much code
getLibraryClassNameInternal()  : mixed
getNodeClean()  : bool
Checks to see if the node has all the required data.
getPreviewImage()  : int|bool
Determines the best attachment to use for the preview image and returns the attachid/nodeid.
getRawContent()  : array<string|int, mixed>
Prepares basic content. Used by both getBareContent and getFullContent.
handleAttachments()  : mixed
This function needs to be implemented by sub classes that want to handle attachments. See the text library implementation for the full description.
moveUndeleted()  : bool
Move messages to inbox marking them as undeleted.
needsFloodCheck()  : mixed
replaceAndStripBbcode()  : mixed
replaceAttachBbcodeForParseAndStrip()  : string
Replace [attach], [img] or [img2] bbcode with a plaintext keyword for use in meta description.
replaceAttachBbcodeTempids()  : string
Replaces the tempids in [attach] bbcodes with the nodeid/attachid for the attachment.
sendEmailNotification()  : mixed
Sends the email notication for a private message
sendModeratorNotification()  : mixed
Sends emails to moderators configured in admincp
sendSpamAndUnapprovedModeratorNotifications()  : mixed
Handles sending moderator notifications for "unapprovedpost" and "spampost"
shouldChangeUserPostCountForChildNodes()  : bool
Checks whether or not we should adjust user post count for descendant nodes
updateNodeOptions()  : mixed
Sets node options from individual fields.
verifyPostIconid()  : mixed
Verifies that the post iconid is valid
verifyPrefixid()  : mixed
checkSpam()  : mixed
fetchNoShoutingText()  : string
Stops text being all UPPER CASE
fetchSentenceCase()  : string
Capitalizes the first letter of each sentence, provided it is within a-z. Lower-cases the entire string first Ignores locales
monitorWordsNode()  : mixed
Handles monitoring words for node creation and updates
requiresModeration()  : mixed

Constants

ACTION_ADD

public mixed ACTION_ADD = 1

ACTION_APPROVE

public mixed ACTION_APPROVE = 5

ACTION_DELETE

public mixed ACTION_DELETE = 4

ACTION_PUBLISH

public mixed ACTION_PUBLISH = 6

ACTION_UPDATE

public mixed ACTION_UPDATE = 2

ACTION_VIEW

public mixed ACTION_VIEW = 3

CACHELEVEL_CONTENT

public mixed CACHELEVEL_CONTENT = 2

CACHELEVEL_FULLCONTENT

public mixed CACHELEVEL_FULLCONTENT = 3

CACHELEVEL_NODE

public mixed CACHELEVEL_NODE = 1

DELETED_ITEMS_FOLDER

public mixed DELETED_ITEMS_FOLDER = 'deleted_items'

INFRACTION_FOLDER

public mixed INFRACTION_FOLDER = 'infractions'

NOTIFICATION_FOLDER

public mixed NOTIFICATION_FOLDER = 'your_notifications'

NOTIFICATION_TYPE_COMMENT

public mixed NOTIFICATION_TYPE_COMMENT = 'comment'

NOTIFICATION_TYPE_FOLLOW

public mixed NOTIFICATION_TYPE_FOLLOW = 'follow'

NOTIFICATION_TYPE_FOLLOWING

public mixed NOTIFICATION_TYPE_FOLLOWING = 'following'

NOTIFICATION_TYPE_MODERATE

public mixed NOTIFICATION_TYPE_MODERATE = 'moderate'

NOTIFICATION_TYPE_MONITOREDWORD

public mixed NOTIFICATION_TYPE_MONITOREDWORD = 'monitoredword'

NOTIFICATION_TYPE_RATE

public mixed NOTIFICATION_TYPE_RATE = 'rate'

NOTIFICATION_TYPE_REPLY

public mixed NOTIFICATION_TYPE_REPLY = 'reply'

NOTIFICATION_TYPE_REPORTEDPOST

public mixed NOTIFICATION_TYPE_REPORTEDPOST = 'reportedpost'

NOTIFICATION_TYPE_SPAMPOST

public mixed NOTIFICATION_TYPE_SPAMPOST = 'spampost'

NOTIFICATION_TYPE_SUBSCRIPTION

public mixed NOTIFICATION_TYPE_SUBSCRIPTION = 'subscription'

NOTIFICATION_TYPE_THREADCOMMENT

public mixed NOTIFICATION_TYPE_THREADCOMMENT = 'threadcomment'

NOTIFICATION_TYPE_UNAPPROVEDPOST

public mixed NOTIFICATION_TYPE_UNAPPROVEDPOST = 'unapprovedpost'

NOTIFICATION_TYPE_USERMENTION

public mixed NOTIFICATION_TYPE_USERMENTION = 'usermention'

NOTIFICATION_TYPE_VOTE

public mixed NOTIFICATION_TYPE_VOTE = 'vote'

NOTIFICATION_TYPE_VOTEREPLY

public mixed NOTIFICATION_TYPE_VOTEREPLY = 'vote_reply'

Properties

$allCanview

protected mixed $allCanview = array('title' => 'title', 'channelroute' => 'channelroute', 'channeltitle' => 'channeltitle', 'channelid' => 'channelid', 'edit_reason' => 'edit_reason', 'edit_userid' => 'edit_userid', 'edit_username' => 'edit_username', 'edit_dateline' => 'edit_dateline', 'hashistory' => 'hashistory', 'starternodeoptions' => 'starternodeoptions', 'channelnodeoptions' => 'channelnodeoptions', 'contenttypeclass' => 'contenttypeclass', 'hide_title' => 'hide_title', 'hide_author' => 'hide_author', 'hide_publishdate' => 'hide_publishdate', 'display_fullincategory' => 'display_fullincategory', 'display_pageviews' => 'display_pageviews', 'channeltype' => 'channeltype', 'startertitle' => 'startertitle', 'starterauthor' => 'startertitle')

$bbcode_parser

protected mixed $bbcode_parser = alse

$cacheNodes

Whether we are caching node content

protected static mixed $cacheNodes

$canBeLastContent

protected mixed $canBeLastContent = alse

$cannotDelete

protected mixed $cannotDelete = alse

$channelFollowRequests

protected mixed $channelFollowRequests = array( B_Api_Node::REQUEST_GRANT_SUBSCRIBER, B_Api_Node::REQUEST_SG_GRANT_SUBSCRIBER)

$channelRequests

protected mixed $channelRequests = array( B_Api_Node::REQUEST_TAKE_OWNER, B_Api_Node::REQUEST_TAKE_MODERATOR, B_Api_Node::REQUEST_TAKE_MEMBER, B_Api_Node::REQUEST_GRANT_OWNER, B_Api_Node::REQUEST_GRANT_MODERATOR, B_Api_Node::REQUEST_GRANT_MEMBER, B_Api_Node::REQUEST_GRANT_SUBSCRIBER, B_Api_Node::REQUEST_SG_TAKE_OWNER, B_Api_Node::REQUEST_SG_TAKE_MODERATOR, B_Api_Node::REQUEST_SG_TAKE_MEMBER, B_Api_Node::REQUEST_SG_GRANT_OWNER, B_Api_Node::REQUEST_SG_GRANT_MODERATOR, B_Api_Node::REQUEST_SG_GRANT_MEMBER, B_Api_Node::REQUEST_SG_GRANT_SUBSCRIBER)

$channelTypeId

protected mixed $channelTypeId

$contenttype

protected mixed $contenttype = 'vBForum_PrivateMessage'

$contenttypeid

protected mixed $contenttypeid

$defaultNodeOptions

protected static mixed $defaultNodeOptions = array( 'forum' => 138, //vB_Api_Node::OPTION_AUTOAPPROVE_SUBSCRIPTION + //128 //vB_Api_Node::OPTION_AUTOAPPROVE_MEMBERSHIP + // 8 //vB_Api_Node::OPTION_ALLOW_POST //2 'blog' => 522, //vB_Api_Node::OPTION_AUTOAPPROVE_MEMBERSHIP + // 8 //vB_Api_Node::OPTION_AUTOSUBSCRIBE_ON_JOIN // 512; //vB_Api_Node::OPTION_ALLOW_POST //2 'article' => 138, 'group' => 10, //vB_Api_Node::OPTION_AUTOAPPROVE_MEMBERSHIP + // 8 //vB_Api_Node::OPTION_ALLOW_POST //2 'vm' => 138, 'pm' => 138, 'album' => 138, 'report' => 138, 'infraction' => 138, 'default' => 138, )

$doFloodCheck

protected mixed $doFloodCheck = rue

$doIncompleteNodeCleanup

protected bool $doIncompleteNodeCleanup = alse

$includeInUserPostCount

If true, then creating a node of this content type will increment the user's post count. If false, it will not. Generally, this should be true for topic starters and replies, and false for everything else.

protected bool $includeInUserPostCount = alse

$index_fields

protected mixed $index_fields = array()

$inheritViewPerms

protected mixed $inheritViewPerms = 0

$instance

protected static mixed $instance = array()

$nodeLibrary

protected mixed $nodeLibrary

$notificationTypes

protected mixed $notificationTypes = array( B_Library_Content_Privatemessage::NOTIFICATION_TYPE_VOTE, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_VOTEREPLY, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_RATE, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_REPLY, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_FOLLOW, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_FOLLOWING, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_VM, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_COMMENT, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_THREADCOMMENT, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_MODERATE, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_USERMENTION, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_MONITOREDWORD, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_REPORTEDPOST, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_UNAPPROVEDPOST, B_Library_Content_Privatemessage::NOTIFICATION_TYPE_SPAMPOST)

$qryAfterAdd

protected mixed $qryAfterAdd = array()

$showSignature

protected mixed $showSignature = alse

$skipModNotification

protected mixed $skipModNotification = rue

$spamKey

protected mixed $spamKey = alse

$spamType

protected mixed $spamType = alse

$tablename

protected mixed $tablename = array('text', 'privatemessage')

$textCountChange

protected mixed $textCountChange = 0

$descriptionLength

private static mixed $descriptionLength = 320

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

acceptRequest()

This function accepts a user follow request or a channel ownership/moderation/membership request

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

add()

This adds a new message

public add(mixed $data[, array<string|int, mixed> $options = array() ][, mixed $convertWysiwygTextToBbcode = true ]) : array<string|int, mixed>
Parameters
$data : mixed

Array of field => value pairs which define the record. Data-types & key names: int 'parentid' Nodeid of the parent, i.e. node this attachment is being added under. int 'userid' Optional. Userid of the user who is adding this record. If not provided, it will use the current session's user. string 'authorname' Optional. Name of the user who is adding this record. If not provided, it will use the username of userid above. string 'ipaddress' Optional. IP of request. Will be fetched from current request if skipped. ??? 'protected' ??? int 'starter' ??? int 'routeid' ??? ??? 'prefixid' ??? ??? 'iconid' ??? int 'created' Optional. Unix timestamp of creation date. If skipped it will use the value returned by vB::getRequest()->getTimeNow() (TIMENOW). int 'publishdate' Optional. Unix timestampe of publish date. If skipped, it will use TIMENOW. If 'publish_now' is provided, publishdate will be overwritten by TIMENOW mixed 'publish_now' Optional. If not empty, publishdate will be overwritten by TIMENOW ??? 'viewperms' ??? ??? 'featured' Optional. ???(purpose/description)??? Will only be used if the CURRENT USER has the moderatorpermissions.cansetfeatured channel permission. string 'title' ??? string 'htmltitle' ??? string 'urlident' ??? int 'setfor' Only used by visitor messages. Userid of intended visitor message recipient. ??? ??? ??? Can also contain node fields. @see vB_Library_Node::getNodeFields() or the node table structure for these fields

$options : array<string|int, mixed> = array()

Array of options for the content being created. Understands skipTransaction, skipFloodCheck, floodchecktime, many subclasses have skipNotification.

@return mixed array with nodeid (int), success (bool), cacheEvents (array of strings), nodeVals (array of field => value).

$convertWysiwygTextToBbcode : mixed = true
Return values
array<string|int, mixed>

-- nodeid (int) -- success (bool) -- cacheEvents (array of strings) -- nodeVals (array of field => value) -- attachments (array of attachment records)

addMessageInfo()

Returns the node content as an associative array

public addMessageInfo(mixed $nodes) : mixed
Parameters
$nodes : mixed
Return values
mixed

array of content records with extra "about" information for notifications.

addMessageNoFlood()

Adds a message without triggering the flood check.

public addMessageNoFlood(mixed $data[, mixed $options = array() ]) : int
Parameters
$data : mixed
$options : mixed = array()
Return values
int

The nodeid of the created message/notification

assembleContent()

Assembles the response for detailed content

public assembleContent(array<string|int, mixed> &$content) : array<string|int, mixed>
Parameters
$content : array<string|int, mixed>

getRawContent() response array. Each element is a nodeid-keyed array. Each subarray must have the following data at minimum: nodeid, channelid, contenttypeid, starter, showopen, userid, setfor (if VM), nodeoptions

Return values
array<string|int, mixed>

Nodeid-keyed array of the $content data, plus additional data such as contenttypeclass, createpermissions, moderatorperms, channeltype, permissions, etc, @TODO: complete this list Also the expanded nodeoptions of: allow_post, moderate_comments, approve_membership, invite_only, autoparselinks, disablesmilies, disable_bbcode, hide_title, hide_author, hide_publishdate, display_fullincategory, display_pageviews, hide_comment_count

autoPopulatePreviewImage()

DEPRECATED: This needs to remain until the corresponding API function is removed

public autoPopulatePreviewImage(mixed $nodeId[, array<string|int, mixed> $node = null ]) : mixed

Populates the previewimage field for this node. To be called after the node is saved and the attachments added.

Finds the first image in the post text that can be used as a previewimage (uploaded here), or uses the first image attachment.

Parameters
$nodeId : mixed
$node : array<string|int, mixed> = null

(optional) Node content array returned by getFullContent

Tags
deprecated

Superceded by getPreviewImage

Return values
mixed

buildPmTotals()

Calculates the number of private messages that a user has in the system Used to limit pm abilities based on overage of this count

public buildPmTotals(mixed $userids) : mixed
Parameters
$userids : mixed
Return values
mixed

checkCanReceivePM()

public checkCanReceivePM(mixed $recipient) : mixed
Parameters
$recipient : mixed
Return values
mixed

checkCanSee()

Checks nodes to ensure that the current user can see them.

public checkCanSee(mixed $nodeids) : int
Parameters
$nodeids : mixed
Return values
int

checkComplete()

This function checks to see if a node is valid, and if not it deletes or fixes it.

public checkComplete(array<string|int, mixed> $node) : bool
Parameters
$node : array<string|int, mixed>

-- node array

Return values
bool

checkFolders()

This function checks that we have all the folders for the current user, and the set folders are there.

public checkFolders(mixed $userid[, mixed $skipNonExistentRecipients = false ]) : array<string|int, mixed>
Parameters
$userid : mixed
$skipNonExistentRecipients : mixed = false
Return values
array<string|int, mixed>

Array with the 'result' element, indicating if the folders were loaded, were already loaded, or if the user was skipped.

clearCache()

public static clearCache() : mixed
Return values
mixed

convertLegacyNotificationAboutString()

Translates the legacy notification type string into the new notification typename

public convertLegacyNotificationAboutString(string $aboutString) : string|bool
Parameters
$aboutString : string
Return values
string|bool

New notification typename, or False if mapping is unknown

convertNotificationTypeToLegacyAboutString()

Translates the legacy notification type string into an array of type information

public convertNotificationTypeToLegacyAboutString(string $typename) : string
Parameters
$typename : string
Return values
string

Returns the legacy NOTIFICATION_TYPE_X string for the typename. If the mapping is unknown, an empty string is returned.

createMessageFolder()

This creates a new message folder. It returns false if the record already exists and the id if it is able to create the folder

public createMessageFolder(mixed $folderName, mixed $userid) : int
Parameters
$folderName : mixed
$userid : mixed
Return values
int

decrementUserPostCount()

Decrements the number of posts for a user

public decrementUserPostCount(array<string|int, mixed> $node[, mixed $action = '' ]) : mixed

When hard-deleting items, this is called from the content library, For all other state changes (unapprove, soft-delete, etc) it is called from the node library

Parameters
$node : array<string|int, mixed>
$action : mixed = ''
Return values
mixed

delete()

Permanently deletes a node

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

deleteChildren()

Delete the records without updating the parent info. It is used when deleting a whole channel and it's children need to be removed

public deleteChildren(array<string|int, mixed> $childrenIds) : mixed
Parameters
$childrenIds : array<string|int, mixed>
  • list of node ids
Return values
mixed

deleteMessage()

Permanently deletes a message

public deleteMessage(mixed $nodeid[, mixed $userid = false ]) : bool
Parameters
$nodeid : mixed
$userid : mixed = false
Return values
bool

did the deletion succeed?

deleteMessages()

Delete messages

public deleteMessages(mixed $nodeids) : bool
Parameters
$nodeids : mixed
Tags
params

array Array of the nodeids from messages to delete.

Return values
bool

Indicating if deletion were succesfully done or will throw exception.

deleteMessagesForUser()

Deletes all pms for a given user

public deleteMessagesForUser(mixed $userid) : int

This will mark all "sentto" records for the given user as deleted. In addtion it will mark any PM records for deletion that no longer have any users attached to them. The actual deletion is handled via cron script.

Parameters
$userid : mixed
Return values
int

number of sentto items marked for delete (the users pms)

deleteSentMessagesForUser()

public deleteSentMessagesForUser(mixed $userid) : mixed
Parameters
$userid : mixed
Return values
mixed

denyRequest()

This function denies a user follow request

public denyRequest(mixed $nodeid, mixed $cancelRequestFor) : array<string|int, mixed>
Parameters
$nodeid : mixed
$cancelRequestFor : mixed
Return values
array<string|int, mixed>
  • array('result' => resultphrase) if resultphrase is empty, there is nothing useful to say about what happened

fetchContentType()

public fetchContentType() : mixed
Return values
mixed

fetchContentTypeId()

public fetchContentTypeId() : mixed
Return values
mixed

fetchFolders()

returns the cached folder information

public fetchFolders(mixed $userid) : mixed
Parameters
$userid : mixed
Return values
mixed

fetchFromCache()

This attempts to get the cached data for nodes

public static fetchFromCache(array<string|int, mixed>|int $nodeids, int $level) : mixed
Parameters
$nodeids : array<string|int, mixed>|int
$level : int

-- one of the constants for level of data

Return values
mixed

fetchNotificationTypes()

Return all the valid notification types

public fetchNotificationTypes() : mixed
Return values
mixed

array of strings

fetchSummary()

This summarizes messages for specified user

public fetchSummary(mixed $userid) : mixed
Parameters
$userid : mixed
Return values
mixed
  • array-includes folderId, title, quantity not read.

fetchTableName()

returns the tables used by this content type.

public fetchTableName() : array<string|int, mixed>
Return values
array<string|int, mixed>

fixAttachBBCode()

DEPRECATED: This needs to remain until the corresponding API function is removed

public fixAttachBBCode(mixed $nodeId[, array<string|int, mixed> $content = null ][, array<string|int, mixed> $keysToAttachid = array() ]) : mixed

Used to change temporary id references in the specified node's rawtext to attach nodeids

Parameters
$nodeId : mixed

nodeid or array of nodeids

$content : array<string|int, mixed> = null

(optional) Node content array returned by getFullContent

$keysToAttachid : array<string|int, mixed> = array()

(optional) array({tempid of attachment} => {attachment's nodeid}) maps temporary-ids (array key) of newly added attachments and corresponding nodeids (array value) of said attachments. While this is optional for historical reasons, it must be provided if any temporary id references in the rawtext need to be replaced.

Tags
deprecated

Superceded by replaceAttachBbcodeTempids

Return values
mixed

getAllCanView()

Returns the fields that all users can see if they don't have canviewthreads

public getAllCanView() : mixed
Return values
mixed

array of strings

getBareContent()

Returns the node content plus the channel routeid and title, and starter route and title the as an associative array Caller MUST ensure that $nodeids are of the correct content type.

public getBareContent(mixed $nodeids) : mixed
Parameters
$nodeids : mixed
Return values
mixed

getCanBeLastContent()

public getCanBeLastContent() : mixed
Return values
mixed

getCanDelete()

Determines whether the current user can soft-delete or hard-delete

public getCanDelete(mixed $node[, mixed $userContext = null ][, mixed $channelPerms = array() ][, mixed $hard = false ]) : bool
Parameters
$node : mixed
$userContext : mixed = null
$channelPerms : mixed = array()
$hard : mixed = false
Return values
bool

getCanEdit()

Determines whether the current user can edit a node

public getCanEdit(mixed $node[, mixed $userContext = null ][, mixed $channelPerms = array() ]) : bool
Parameters
$node : mixed
$userContext : mixed = null
$channelPerms : mixed = array()
Return values
bool

getCanModerate()

Determines whether the current user can moderate

public getCanModerate(mixed $node[, mixed $userContext = null ][, mixed $channelPerms = array() ], mixed $nodeid) : bool
Parameters
$node : mixed
$userContext : mixed = null
$channelPerms : mixed = array()
$nodeid : mixed
Return values
bool

getCannotDelete()

Whether this type can be deleted. Infractions, for example, cannot be.

public getCannotDelete() : bool
Return values
bool

getChannelRequestTypes()

Returns array of Request message types

public getChannelRequestTypes() : mixed
Return values
mixed

array of strings *

getContent()

Returns the node content as an associative array

public getContent(mixed $nodeids) : int
Parameters
$nodeids : mixed
Return values
int

getContentApi()

Returns a content api of the appropriate type

public static getContentApi(mixed $contenttypeid) : mixed
Parameters
$contenttypeid : mixed
Return values
mixed

content api object

getContentInstance()

public static getContentInstance(mixed $contenttypeid) : mixed
Parameters
$contenttypeid : mixed
Return values
mixed

getContentLib()

Returns a content api of the appropriate type

public static getContentLib(mixed $contenttypeid) : mixed
Parameters
$contenttypeid : mixed
Return values
mixed

content api object

getConversationParent()

Gets the conversation starter for a node. If the node is a channel it returns the channel record.

public getConversationParent(int $nodeid) : array<string|int, mixed>
Parameters
$nodeid : int
Return values
array<string|int, mixed>

The starter node array

getDeletedItemsFolderId()

Get the deleted_items folder id

public getDeletedItemsFolderId() : int
Return values
int

The deleted_items folder id from messagefolder.

getFolderFromId()

Gets the folder information from a given folderid. The folderid requested should belong to the user who is requesting.

public getFolderFromId(mixed $folderid, mixed $userid) : array<string|int, mixed>
Parameters
$folderid : mixed
$userid : mixed
Return values
array<string|int, mixed>

The folder information such as folder title, titlephrase and if is custom folder.

getFullContent()

Returns the node content as an associative array

public getFullContent(int $nodeid) : array<string|int, mixed>
Parameters
$nodeid : int
Return values
array<string|int, mixed>

getIndexableContent()

The classes that inherit this should implement this function It should return the content that should be indexed If there is a title field, the array key for that field should be 'title', the rest of the text can have any key

public getIndexableContent(int $nodeId[, mixed $include_attachments = true ]) : array<string|int, mixed>
Parameters
$nodeId : int
  • it might be the node (assiciative array)
$include_attachments : mixed = true
Return values
array<string|int, mixed>

$indexableContent

getIndexableFromNode()

This function is used internally by vB_Search_Core::getTitleAndText()

public getIndexableFromNode(mixed $node[, mixed $include_attachments = true ]) : mixed
Parameters
$node : mixed
$include_attachments : mixed = true
Return values
mixed

getInfractionFolderId()

Get the infraction folder id

public getInfractionFolderId() : int
Return values
int

The infraction folder id from messagefolder.

getInlist()

Returns inlist property

public getInlist() : int
Return values
int

getMessage()

Get a message

public getMessage(mixed $nodeid) : mixed
Parameters
$nodeid : mixed
Return values
mixed

array of data

getMessageTree()

Get a message and all replies and sets the message to "read"

public getMessageTree(int $nodeid, mixed $exclude, mixed $userid) : array<string|int, mixed>
Parameters
$nodeid : int

the nodeid

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

array of data

getPendingPostFolderId()

Get the pending posts folder id

public getPendingPostFolderId() : int
Return values
int

The pending posts folder id from messagefolder.

getQuotes()

This returns a string with quoted strings in bbcode format.

public getQuotes(array<string|int, mixed>|int $nodeids) : array<string|int, mixed>|string
Parameters
$nodeids : array<string|int, mixed>|int
Return values
array<string|int, mixed>|string

either the quote for the node or an array of $nodeid => $quotes for the array of nodes

getQuotesFromNodes()

Helper function to allow getQuotes in the API and Library classes to generate the node list independantly (so that the API can check perms without loading the nodes twice).

public getQuotesFromNodes(array<string|int, mixed> $nodes) : mixed
Parameters
$nodes : array<string|int, mixed>

-- array of nodes arrays from getContent (API or Library version) does not accept a single node array

Return values
mixed

getRequest()

Get a single request

public getRequest(mixed $nodeid) : array<string|int, mixed>
Parameters
$nodeid : mixed
Return values
array<string|int, mixed>

The node data array for the request

getStarter()

Gets the conversation starter for a node. If the node is a channel it returns the channelid.

public getStarter(int $nodeid) : int
Parameters
$nodeid : int
Return values
int

The conversation starter's nodeid

getTextCountChange()

Returns textCountChange property

public getTextCountChange() : int
Return values
int

incompleteNodeCleanup()

This cleans up for a node that was found to be incomplete by deleting the child nodes and subsidiary table records

public incompleteNodeCleanup(mixed $node) : mixed
Parameters
$node : mixed
Return values
mixed

incrementUserPostCount()

Increments the number of posts for a user. This function will also update user's "lastpost" field

public incrementUserPostCount(array<string|int, mixed> $node) : mixed

When creating items, this is called from the content library, For all other state changes (approve, undelete, etc) it is called from the node library

Parameters
$node : array<string|int, mixed>
Return values
mixed

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

isComment()

Determines whether a specific node is a comment on a thread reply or not

public isComment(mixed $nodeid[, array<string|int, mixed> $node = null ]) : bool
Parameters
$nodeid : mixed
$node : array<string|int, mixed> = null
Return values
bool

isPublished()

Is this record in a published state based on the times?

public isPublished(mixed $data) : bool
Parameters
$data : mixed
Return values
bool

isVisitorMessage()

determines whether a specific node is a visitor message

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

listFolders()

This lists the folders.

public listFolders([mixed $suppress = array() ]) : mixed
Parameters
$suppress : mixed = array()
Return values
mixed

array of folderid => title

listMessages()

This lists messages for current user

public listMessages(mixed $data, mixed $userid) : array<string|int, mixed>
Parameters
$data : mixed
$userid : mixed
Return values
array<string|int, mixed>
  • list of messages.

listNotifications()

public listNotifications(array<string|int, mixed> $data, int $userid) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

@see vB_Library_Notification::fetchNotificationsForCurrentUser()

$userid : int

Not used.

Tags
deprecated
5.1.6

Only used by unit tests

This lists notifications for current user

Return values
array<string|int, mixed>

@see vB_Library_Notification::fetchNotificationsForCurrentUser()

listSpecialPrivateMessages()

This lists messages for current user

public listSpecialPrivateMessages([mixed $data = array() ]) : mixed
Parameters
$data : mixed = array()
Return values
mixed
  • array-includes folderId, title, quantity not read. Also 'page' is array of node records for page 1.

mergeContent()

Performs the merge of content and updates the node.

public mergeContent(type $data) : type
Parameters
$data : type
Return values
type

mergeContentInfo()

public mergeContentInfo(mixed &$result, mixed $content) : mixed
Parameters
$result : mixed
$content : mixed
Return values
mixed

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

moveMessage()

Moves a message to a different folder

public moveMessage(mixed $nodeid, mixed $newFolderid, mixed $existing) : bool
Parameters
$nodeid : mixed
$newFolderid : mixed
$existing : mixed
Return values
bool

did it succeed?

parseAndStrip()

public parseAndStrip(mixed $text[, mixed $wysiwyg = true ]) : mixed
Parameters
$text : mixed
$wysiwyg : mixed = true
Return values
mixed

postBbcodeParseCleanRawtext()

Cleans the input in the $data array, specifically *after* any html/wysiwyg -> bbcode parsing.

public postBbcodeParseCleanRawtext(array<string|int, mixed> &$data) : mixed
Parameters
$data : array<string|int, mixed>

Array of fieldname => data pairs, passed by reference.

Return values
mixed

reloadOptions()

Reload options from datastore. Currently only used by unit tests.

public reloadOptions() : mixed
Return values
mixed

removePrivateDataFromNode()

Examines the node record returned from the node library and determines if any information needs to be removed before passing beyond the API layer.

public removePrivateDataFromNode(array<string|int, mixed> &$node) : none

This is part of the library layer because its needed for a number of API classes that return node data in various forms.

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

the node array to be cleaned.

Return values
none

resetCountCalled()

Reset the called array- this makes sure we only increment/decrement user post counts once for a given node This is only needed by the unit tests.

public resetCountCalled() : mixed
Return values
mixed

resetFolders()

Clears the cached folder information

public resetFolders() : mixed
Return values
mixed

setDoIncompleteNodeCleanup()

Sets the $doIncompleteNodeCleanup flag

public setDoIncompleteNodeCleanup(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

setRead()

This sets a message to read

public setRead( $nodeid, mixed $read, mixed $userid[, mixed $folderKey = false ]) : mixed
Parameters
$nodeid :
$read : mixed
$userid : mixed
$folderKey : mixed = false
Return values
mixed

toTrashcan()

Moves a node to the trashcan. Wrapper for deleteMessage()

public toTrashcan(mixed $nodeid) : mixed
Parameters
$nodeid : mixed
Return values
mixed

undeleteMessage()

Move a message back to user inbox folder

public undeleteMessage(mixed $nodeid, mixed $existing) : bool
Parameters
$nodeid : mixed
$existing : mixed
Tags
params

int The nodeid we are undeleting.

params

mixed array of existing sent to records.

Return values
bool

True if succesfully done.

unsetFolders()

returns the cached folder information

public unsetFolders(mixed $userid) : mixed
Parameters
$userid : mixed
Return values
mixed

update()

updates a record

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

information to update the content with

@return boolean

Return values
mixed

userReceivesNotification()

Checks if userid's notification options for notification type

public userReceivesNotification(mixed $userid, mixed $notificationType) : bool
Parameters
$userid : mixed
$notificationType : mixed
Return values
bool

true if user should receive the notificationType

validate()

Validates the data according to the action to be taken

public validate(mixed $data[, mixed $action = vB_Library_Content::ACTION_ADD ][, mixed $nodeid = false ][, mixed $nodes = false ][, mixed $userid = null ]) : bool
Parameters
$data : mixed
$action : mixed = vB_Library_Content::ACTION_ADD
$nodeid : mixed = false
$nodes : mixed = false
$userid : mixed = null
Return values
bool

validateRequest()

Verifies that the request exists and its valid.

public validateRequest(int $userid, int $nodeid) : array<string|int, mixed>

Returns the message if no error is found. Throws vB_Exception_Api if an error is found.

Parameters
$userid : int
$nodeid : int
Return values
array<string|int, mixed>
  • message info

writeToCache()

writes new cached data for nodes

public static writeToCache(mixed $nodes, mixed $level) : void

Note that this is affected by the 'cache_node_data' admin option. If that is not true then this function does nothing.

Parameters
$nodes : mixed
$level : mixed
Return values
void

__construct()

protected __construct() : mixed
Return values
mixed

addContentInfo()

protected addContentInfo(mixed $results) : mixed
Parameters
$results : mixed
Return values
mixed

afterAdd()

Operations to be done after adding a node. Putting actions here allow child classes to minimize time keeping transaction open.

protected afterAdd(int $nodeid, mixed $data, mixed $options, mixed $cacheEvents, mixed $nodevals) : mixed
Parameters
$nodeid : int
$data : mixed

Array of data being added

$options : mixed

Array of options for the content being created- passed from add() Understands skipNotification(s), skipUpdateLastContent.

$cacheEvents : mixed

Array of strings- cache events to be called

$nodevals : mixed

Array of field => value pairs representing the node table field values passed to create the record. Currently most are not used but all are passed.

Return values
mixed

beforeCommit()

Called by the first child class just before the commit happens.

protected beforeCommit(mixed $nodeid, mixed $data, mixed $options, mixed $cacheEvents, mixed $nodevals) : mixed

This is for logic that needs to be in the transaction, but relies on the child class having finished all of its processing (the flow is that content::add gets called first and then the child does it's thing, primary because the child needs the nodeid for the created node record).

Takes the same parameters as afterAdd

Parameters
$nodeid : mixed
$data : mixed
$options : mixed
$cacheEvents : mixed
$nodevals : mixed
Return values
mixed

changeContentType()

protected changeContentType(mixed $nodeid, mixed $oldcontentType, mixed $newcontentType) : mixed
Parameters
$nodeid : mixed
$oldcontentType : mixed
$newcontentType : mixed
Return values
mixed

checkFloodAndThrowException()

protected checkFloodAndThrowException(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

countInUserPostCount()

Checks if the current node should be counted in the user post count for the author.

protected countInUserPostCount(array<string|int, mixed> $node[, mixed $action = '' ]) : bool
Parameters
$node : array<string|int, mixed>
$action : mixed = ''
Return values
bool

Whether or not the node should be counted in user post count.

duplicateCheck()

protected duplicateCheck(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

fillContentTableData()

protected fillContentTableData(mixed &$node) : mixed
Parameters
$node : mixed
Return values
mixed

getDuplicateHash()

Calculates the CRC based on the indexable content

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

getIndexableContentForAttachments()

Get the indexable content for attachments. Separate this so that child classes can rewrite getIndexableContent entirely without having to copy as much code

protected getIndexableContentForAttachments(mixed $nodeId) : mixed
Parameters
$nodeId : mixed
Return values
mixed

getLibraryClassNameInternal()

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

getNodeClean()

Checks to see if the node has all the required data.

protected getNodeClean(mixed $node) : bool
Parameters
$node : mixed
Return values
bool

getPreviewImage()

Determines the best attachment to use for the preview image and returns the attachid/nodeid.

protected getPreviewImage(mixed $node) : int|bool
Parameters
$node : mixed
Return values
int|bool

The nodeid of the attachment that should be used as the preview image, or false for no preview image

getRawContent()

Prepares basic content. Used by both getBareContent and getFullContent.

protected getRawContent(mixed $nodeids) : array<string|int, mixed>
Parameters
$nodeids : mixed
Tags
throws
throw

new vB_Exception_Api('incorrect_content_class_called') If any node in $nodeids is not of $this's contenttype.

protected
Return values
array<string|int, mixed>

Nodeid-keyed array of node & content data, including node table data. Keys depend on the particular node's contenttype, but a few common ones include: node.*, channelroute, channeltitle, channelid, starterroute, startertitle, etc. See vBForum:getFullContent.

handleAttachments()

This function needs to be implemented by sub classes that want to handle attachments. See the text library implementation for the full description.

protected handleAttachments(mixed $type, mixed $nodeid, mixed $data[, mixed $options = array() ]) : mixed
Parameters
$type : mixed
$nodeid : mixed
$data : mixed
$options : mixed = array()
Return values
mixed

moveUndeleted()

Move messages to inbox marking them as undeleted.

protected moveUndeleted(mixed $nodeid, mixed $newFolderid, mixed $existing) : bool
Parameters
$nodeid : mixed
$newFolderid : mixed
$existing : mixed
Return values
bool

did it succeed?

needsFloodCheck()

protected needsFloodCheck(mixed $data, mixed $options) : mixed
Parameters
$data : mixed
$options : mixed
Return values
mixed

replaceAndStripBbcode()

protected replaceAndStripBbcode(mixed $text[, mixed $data = array() ]) : mixed
Parameters
$text : mixed
$data : mixed = array()
Return values
mixed

replaceAttachBbcodeForParseAndStrip()

Replace [attach], [img] or [img2] bbcode with a plaintext keyword for use in meta description.

protected replaceAttachBbcodeForParseAndStrip(string $rawtext[, array<string|int, mixed> $data = array() ]) : string
Parameters
$rawtext : string

Text to be replaced.

$data : array<string|int, mixed> = array()

optional. Data array provided to add() or update() if available. May contain 'attachments' data.

Return values
string

replaceAttachBbcodeTempids()

Replaces the tempids in [attach] bbcodes with the nodeid/attachid for the attachment.

protected replaceAttachBbcodeTempids(mixed $rawtext, mixed $keysToAttachid) : string
Parameters
$rawtext : mixed
$keysToAttachid : mixed
Return values
string

The rawtext with the modified [attach] bbcodes

sendEmailNotification()

Sends the email notication for a private message

protected sendEmailNotification(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>

-- 'msgtype' string => the type of PM: request | message 'about' string => type of request: follow | moderator_to | owner_to 'aboutid' => user to follow (only for request -> follow) 'userid' => id of the message sender? 'username' => username of the message recipient 'email' => address to send to 'folderid' => folder to reference for link to message center.

Return values
mixed

sendModeratorNotification()

Sends emails to moderators configured in admincp

protected sendModeratorNotification(mixed $nodeid) : mixed
Parameters
$nodeid : mixed
Return values
mixed

sendSpamAndUnapprovedModeratorNotifications()

Handles sending moderator notifications for "unapprovedpost" and "spampost"

protected sendSpamAndUnapprovedModeratorNotifications(mixed $node, mixed $isSpam) : mixed
Parameters
$node : mixed
$isSpam : mixed
Return values
mixed

shouldChangeUserPostCountForChildNodes()

Checks whether or not we should adjust user post count for descendant nodes

protected shouldChangeUserPostCountForChildNodes(mixed $node[, mixed $action = '' ]) : bool
Parameters
$node : mixed
$action : mixed = ''
Return values
bool

Whether or not the child nodes should be handled

updateNodeOptions()

Sets node options from individual fields.

protected updateNodeOptions(mixed $nodeid, mixed $data) : mixed
@param	int
Parameters
$nodeid : mixed
$data : mixed
Return values
mixed

verifyPostIconid()

Verifies that the post iconid is valid

protected verifyPostIconid(mixed $posticonid) : mixed
Parameters
$posticonid : mixed
Return values
mixed

verifyPrefixid()

protected verifyPrefixid(mixed $prefixid) : mixed
Parameters
$prefixid : mixed
Return values
mixed

checkSpam()

private checkSpam(mixed $userid, mixed $authorname, mixed $data, mixed $options, mixed $parents) : mixed
Parameters
$userid : mixed
$authorname : mixed
$data : mixed
$options : mixed
$parents : mixed
Return values
mixed

fetchNoShoutingText()

Stops text being all UPPER CASE

private fetchNoShoutingText(mixed $text) : string
Parameters
$text : mixed
Return values
string

The text with 'anti-shouting' applied

fetchSentenceCase()

Capitalizes the first letter of each sentence, provided it is within a-z. Lower-cases the entire string first Ignores locales

private fetchSentenceCase(mixed $text) : string
Parameters
$text : mixed
Return values
string

monitorWordsNode()

Handles monitoring words for node creation and updates

private monitorWordsNode(mixed $nodeid, mixed $data[, mixed $insertNotifications = true ]) : mixed
Parameters
$nodeid : mixed
$data : mixed
$insertNotifications : mixed = true
Return values
mixed

requiresModeration()

private requiresModeration(mixed $userContext, mixed $parentContent, mixed $nodevals, mixed $hasAttachments) : mixed
Parameters
$userContext : mixed
$parentContent : mixed
$nodevals : mixed
$hasAttachments : mixed
Return values
mixed

Search results