vBulletin v6.0.4

vB_Library_Content_Privatemessage extends vB_Library_Content_Text
in package

vB_Library_Content_Privatemessage

Tags
access

public

Table of Contents

Constants

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'

Methods

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()  : 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.
checkFolders()  : array<string|int, mixed>
This function checks that we have all the folders for the current user, and the set folders are there.
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|false
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
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
fetchFolders()  : mixed
returns the cached folder information
fetchNotificationTypes()  : mixed
Return all the valid notification types
fetchSummary()  : mixed
This summarizes messages for specified user
getAutoparseLinks()  : mixed
Get the actual auto parse links values based on the request and context
getChannelRequestTypes()  : mixed
Returns array of Request message types
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
getIndexableFromNode()  : mixed
getInfractionFolderId()  : int
Get the infraction folder id
getMessage()  : mixed
Get a message
getMessageTree()  : array<string|int, mixed>
Get a message and all replies and sets the message to "read"
getNodeDescription()  : mixed
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
incompleteNodeCleanup()  : mixed
This cleans up for a node that was found to be incomplete by deleting the child nodes and subsidiary table records
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
Adds content info to $result so that merged content can be edited.
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.
resetFolders()  : mixed
Clears the cached folder information
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()  : bool
Updates a text node.
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.

Constants

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'

Methods

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
$options : array<string|int, mixed> = array()
$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(mixed &$content[, mixed $permissions = false ]) : mixed
Parameters
$content : mixed
$permissions : mixed = false
Return values
mixed

formatted data

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

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

checkCanReceivePM()

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

checkCanSee()

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

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

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.

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|false
Parameters
$folderName : mixed
$userid : mixed
Return values
int|false

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

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

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

fetchFolders()

returns the cached folder information

public fetchFolders(mixed $userid) : mixed
Parameters
$userid : 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.

Get the actual auto parse links values based on the request and context

public getAutoparseLinks( $parents,  $autoparselinks) : mixed

For the moment we assume that we us autoparse if

  1. It is requested by the caller AND
  2. It is allowed by channel context

There is currently no "force" auto parse. Currently the channel option is not hierarchical, we'll check the containing channel at the lowest level and allow autoparse if that channel allows it regardless of if the parents allow it or not (currently we only have an on/off flag and would need on/off/default to handle hierachy in a reasonable way since we might want to allow it for a child while prohibiting it at the parent level or vice versa.

Parameters
$parents :

-- the parents array the first element should be either the node itself (for updates) or the node's parent (for adds). It will work either way.

$autoparselinks :

-- the requested autoparse value

getChannelRequestTypes()

Returns array of Request message types

public getChannelRequestTypes() : mixed
Return values
mixed

array of strings *

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>

getIndexableFromNode()

public getIndexableFromNode(mixed $content[, mixed $include_attachments = true ]) : mixed
Parameters
$content : mixed
$include_attachments : mixed = true

getInfractionFolderId()

Get the infraction folder id

public getInfractionFolderId() : int
Return values
int

The infraction folder id from messagefolder.

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

getNodeDescription()

public getNodeDescription(mixed $data, mixed $convertWysiwygTextToBbcode) : mixed
Parameters
$data : mixed
$convertWysiwygTextToBbcode : mixed

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

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

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

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

Adds content info to $result so that merged content can be edited.

public mergeContentInfo(array<string|int, mixed> &$result, array<string|int, mixed> $content) : mixed
Parameters
$result : array<string|int, mixed>
$content : array<string|int, 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

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.

resetFolders()

Clears the cached folder information

public resetFolders() : 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

toTrashcan()

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

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

update()

Updates a text node.

public update(mixed $nodeid, mixed $data[, mixed $convertWysiwygTextToBbcode = true ]) : bool
Parameters
$nodeid : mixed
$data : mixed
$convertWysiwygTextToBbcode : mixed = true
Return values
bool

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

        
On this page

Search results