class vB_Library_Content_Report extends vB_Library_Content_Text

vB_Library_Content_Report

Traits

Constants

ACTION_ADD

ACTION_UPDATE

ACTION_VIEW

ACTION_DELETE

ACTION_APPROVE

ACTION_PUBLISH

CACHELEVEL_NODE

CACHELEVEL_CONTENT

CACHELEVEL_FULLCONTENT

Properties

static protected $instance from vB_Library
protected $contenttype
protected $contenttypeid from vB_Library_Content
protected $tablename
protected $index_fields from vB_Library_Content_Text
protected $textCountChange from vB_Library_Content_Text
protected $inheritViewPerms from vB_Library_Content_Text
protected $inlist from vB_Library_Content
protected $showSignature from vB_Library_Content_Text
protected $doFloodCheck from vB_Library_Content
protected $assertor from vB_Library_Content
protected $nodeApi from vB_Library_Content
protected $nodeLibrary from vB_Library_Content
static protected $cacheNodes Whether we are caching node content from vB_Library_Content
protected $channelTypeId from vB_Library_Content
protected $cannotDelete from vB_Library_Content
protected $qryAfterAdd from vB_Library_Content
protected $allCanview from vB_Library_Content
protected bool $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.
static protected $defaultNodeOptions from vB_Library_Content
protected bool $doIncompleteNodeCleanup from vB_Library_Content
protected $bbcode_parser from vB_Library_Content_Text
protected $spamType from vB_Library_Content_Text
protected $spamKey from vB_Library_Content_Text
protected $ReportChannel
protected $skipModNotification

Methods

__sleep()

No description

__wakeup()

No description

__construct()

No description

static vB_PageCache
instance($class)

Returns singleton instance of self.

static 
getLibraryClassNameInternal($controller)

No description

static 
getContentInstance($contenttypeid)

No description

static 
clearCache()

No description

reloadOptions()

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

fetchContentType()

No description

getAllCanView()

No description

fetchContentTypeId()

No description

int
getTextCountChange()

Returns textCountChange property

int
getInlist()

Returns inlist property

add(mixed $data, array $options = array(), bool $convertWysiwygTextToBbcode = true)

Adds a new node.

beforeCommit($nodeid, $data, $options, $cacheEvents, $nodevals)

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

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

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

sendModeratorNotification($nodeid)

Sends emails to moderators configured in admincp

needsFloodCheck($data, $options)

No description

checkFloodAndThrowException($data)

No description

string|boolean
duplicateCheck(array $data)

Checks accidental duplicate posting

updateNodeOptions($nodeid, $data)

Sets node options from individual fields.

incrementUserPostCount(array $node)

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

decrementUserPostCount(array $node, (unpublish|unapprove) $action = '')

Decrements the number of posts for a user

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.

boolean
countInUserPostCount(array $node, (unpublish|unapprove) $action = '')

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

boolean
shouldChangeUserPostCountForChildNodes(array $node, (unpublish|unapprove) $action = '')

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

boolean
delete(array|int $nodeids)

Permanently deletes a node

deleteChildren(array $childrenIds)

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

bool
isPublished(mixed $data)

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

update(int $nodeid, array $data, bool $convertWysiwygTextToBbcode = true)

Report is not allowed to be updated.

static mixed
getContentApi(int $contenttypeid)

Returns a content api of the appropriate type

static mixed
getContentLib(int $contenttypeid)

Returns a content api of the appropriate type

int
getContent($nodeids)

Returns the node content as an associative array

Array[Int]
getBareContent(integer $nodeids)

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.

array
getFullContent($nodeid, array $permissions = false)

Returns the node content as an associative array with fullcontent

array
getRawContent($nodeids)

Prepares basic content. Used by both getBareContent and getFullContent.

bool
getCanEdit(int $node, int $userContext = null, mixed $channelPerms = array())

Determines whether the current user can edit a node

bool
getCanDelete(mixed $node, int $userContext = null, mixed $channelPerms = array(), bool $hard = false)

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

bool
getCanModerate(mixed $node, object $userContext = null, mixed $channelPerms = array(), int $nodeid = 0)

Determines whether the current user can moderate

Array
assembleContent(Array $content, mixed $permissions = false)

Assembles the response for detailed content

getIndexableFromNode($content, $include_attachments = true)

No description

array
getIndexableContent($nodeId, $include_attachments = true)

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

int
getStarter(int $nodeid)

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

array
getConversationParent(int $nodeid)

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

bool
isVisitorMessage(int $nodeid)

determines whether a specific node is a visitor message

bool
isComment(int $nodeid, array $node = null)

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

getIndexableContentForAttachments($nodeId)

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

Array
fetchTableName()

returns the tables used by this content type.

static array('found'
fetchFromCache(array|int $nodeids, integer $level)

This attempts to get the cached data for nodes

static void
writeToCache($nodes, $level)

writes new cached data for nodes

verifyPrefixid($prefixid)

No description

verifyPostIconid(int $posticonid)

Verifies that the post iconid is valid

changeContentType($nodeid, $oldcontentType, $newcontentType)

No description

string
getDuplicateHash(array $data)

Calculates the CRC based on the indexable content

fillContentTableData($node)

No description

none
removePrivateDataFromNode(array $node)

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

bool
checkComplete(array $node)

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

boolean
getCannotDelete()

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

bool
getNodeClean(integer $node)

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

bool
incompleteNodeCleanup(mixed $node)

This cleans up for a node that was found to be incomplete by deleting the child nodes and subsidiary table records. It is often overridden in child classes.

setDoIncompleteNodeCleanup(bool $value)

Sets the $doIncompleteNodeCleanup flag

handleAttachments($type, $nodeid, $data, $options = array())

Handles uploaded attachments-- Adds the attach nodes and handles updating data that needs updating after the attachments are added.

mergeContentInfo($result, $content)

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

bool
validate($data, $action = self::ACTION_ADD, $nodeid = false, $nodes = false, $userid = null)

Validates that the current can create a node with these values

addContentInfo($results)

No description

postBbcodeParseCleanRawtext(mixed $data)

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

parseAndStrip($text)

No description

replaceAndStripBbcode($text, $data = array())

No description

array|string
getQuotes(array|int $nodeids)

This returns a string with quoted strings in bbcode format.

getQuotesFromNodes(array $nodes)

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

type
mergeContent(type $data)

Performs the merge of content and updates the node.

fixAttachBBCode(mixed $nodeId, array $content = null, array $keysToAttachid = array()) deprecated

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

string
replaceAttachBbcodeForParseAndStrip(string $rawtext, array $data = array())

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

string
replaceAttachBbcodeTempids(string $rawtext, array $keysToAttachid)

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

autoPopulatePreviewImage(int $nodeId, array $node = null) deprecated

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

int|bool
getPreviewImage(array $node)

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

sendPushNotifications($data)

No description

getModeratorRecipients($reportedNodeid, $type = "email")

No description

void
openClose(array $nodeids, string $op)

Open or close reports

void
bulkdelete($nodeids)

Delete one or more reports

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 41
protected __construct()

in vB_Library at line 35
static vB_PageCache instance($class)

Returns singleton instance of self.

Parameters

$class

Return Value

vB_PageCache
  • Reference to singleton instance of the cache handler

in vB_Library at line 52
static protected getLibraryClassNameInternal($controller)

Parameters

$controller

in vB_Library at line 91
static getContentInstance($contenttypeid)

Parameters

$contenttypeid

in vB_Library at line 99
static clearCache()

in vB_Library_Content at line 158
reloadOptions()

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

in vB_Library_Content at line 163
fetchContentType()

in vB_Library_Content at line 172
getAllCanView()

in vB_Library_Content at line 177
fetchContentTypeId()

in vB_Library_Content at line 186
int getTextCountChange()

Returns textCountChange property

Return Value

int

in vB_Library_Content at line 195
int getInlist()

Returns inlist property

Return Value

int

at line 248
add(mixed $data, array $options = array(), bool $convertWysiwygTextToBbcode = true)

Adds a new node.

Parameters

mixed $data 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
array $options 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).
bool $convertWysiwygTextToBbcode Convert text to bbcode

in vB_Library_Content at line 852
protected beforeCommit($nodeid, $data, $options, $cacheEvents, $nodevals)

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

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
$data
$options
$cacheEvents
$nodevals

in vB_Library_Content at line 877
protected afterAdd(int $nodeid, mixed $data, mixed $options, mixed $cacheEvents, mixed $nodevals)

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

Parameters

int $nodeid
mixed $data Array of data being added
mixed $options Array of options for the content being created- passed from add() Understands skipNotification(s), skipUpdateLastContent.
mixed $cacheEvents Array of strings- cache events to be called
mixed $nodevals 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.

in vB_Library_Content at line 1132
protected sendModeratorNotification($nodeid)

Sends emails to moderators configured in admincp

Parameters

$nodeid

in vB_Library_Content at line 1322
protected needsFloodCheck($data, $options)

Parameters

$data
$options

in vB_Library_Content at line 1334
protected checkFloodAndThrowException($data)

Parameters

$data

in vB_Library_Content at line 1366
protected string|boolean duplicateCheck(array $data)

Checks accidental duplicate posting

Parameters

array $data

Return Value

string|boolean hash or false if check skipped

in vB_Library_Content at line 1399
protected updateNodeOptions($nodeid, $data)

Sets node options from individual fields.

@param int

Parameters

$nodeid
$data

in vB_Library_Content at line 1435
incrementUserPostCount(array $node)

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

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

array $node Array of node information for the affected node

in vB_Library_Content at line 1492
decrementUserPostCount(array $node, (unpublish|unapprove) $action = '')

Decrements the number of posts for a user

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

array $node Array of node information for the affected node
(unpublish|unapprove) $action Pass one of these strings when decrementUserPostCount is called after unpublishing or unapproving a post

in vB_Library_Content at line 1541
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.

in vB_Library_Content at line 1554
protected boolean countInUserPostCount(array $node, (unpublish|unapprove) $action = '')

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

Parameters

array $node The node
(unpublish|unapprove) $action The action that was just carried out on the node

Return Value

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

in vB_Library_Content at line 1605
protected boolean shouldChangeUserPostCountForChildNodes(array $node, (unpublish|unapprove) $action = '')

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

Parameters

array $node The node
(unpublish|unapprove) $action The action that was just carried out on the node

Return Value

boolean Whether or not the child nodes should be handled

in vB_Library_Content at line 1653
boolean delete(array|int $nodeids)

Permanently deletes a node

Parameters

array|int $nodeids

Return Value

boolean

in vB_Library_Content at line 1805
deleteChildren(array $childrenIds)

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

Parameters

array $childrenIds
  • list of node ids

in vB_Library_Content at line 1822
bool isPublished(mixed $data)

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

Parameters

mixed $data

Return Value

bool

at line 456
update(int $nodeid, array $data, bool $convertWysiwygTextToBbcode = true)

Report is not allowed to be updated.

Parameters

int $nodeid
array $data information to update the content with

@return boolean
bool $convertWysiwygTextToBbcode Flag instructing us to convert rawtext from WYSIWYG editor markup to BBCode.

Exceptions

vB_Exception_Api

in vB_Library_Content at line 2366
static mixed getContentApi(int $contenttypeid)

Returns a content api of the appropriate type

Parameters

int $contenttypeid the content type id

Return Value

mixed content api object

in vB_Library_Content at line 2377
static mixed getContentLib(int $contenttypeid)

Returns a content api of the appropriate type

Parameters

int $contenttypeid the content type id

Return Value

mixed content api object

in vB_Library_Content at line 2395
int getContent($nodeids)

Returns the node content as an associative array

Parameters

$nodeids

Return Value

int

in vB_Library_Content at line 2410
Array[Int] getBareContent(integer $nodeids)

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.

Parameters

integer $nodeids The id in the primary table.

Return Value

Array[Int] Requested data, keyed by the nodeid.

at line 380
array getFullContent($nodeid, array $permissions = false)

Returns the node content as an associative array with fullcontent

Parameters

$nodeid
array $permissions permissions

Return Value

array Nodeid-keyed array of node content, including node.*, channel & starter id, title, route and other common data, and content-specific data. see $this->getRawContent()

in vB_Library_Content at line 2473
protected array getRawContent($nodeids)

Prepares basic content. Used by both getBareContent and getFullContent.

Parameters

$nodeids

Return Value

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

Exceptions

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

in vB_Library_Content at line 2598
bool getCanEdit(int $node, int $userContext = null, mixed $channelPerms = array())

Determines whether the current user can edit a node

Parameters

int $node The nodeid
int $userContext optional usercontext
mixed $channelPerms optional array of channel permissions data, which if available prevents a userContext Call

Return Value

bool

in vB_Library_Content at line 2724
bool getCanDelete(mixed $node, int $userContext = null, mixed $channelPerms = array(), bool $hard = false)

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

Parameters

mixed $node The node
int $userContext Optional usercontext
mixed $channelPerms Optional array of channel permissions data, which if available prevents a userContext Call
bool $hard Optional flag - false get can soft delete, true get can hard delete

Return Value

bool

in vB_Library_Content at line 2880
bool getCanModerate(mixed $node, object $userContext = null, mixed $channelPerms = array(), int $nodeid = 0)

Determines whether the current user can moderate

Parameters

mixed $node The node
object $userContext optional usercontext
mixed $channelPerms optional array of channel permissions data, which if available prevents a userContext Call
int $nodeid optional nodeid,

Return Value

bool

Array assembleContent(Array $content, mixed $permissions = false)

Assembles the response for detailed content

Parameters

Array $content 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
mixed $permissions optional array of permissions

Return Value

Array 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

getIndexableFromNode($content, $include_attachments = true)

Parameters

$content
$include_attachments

in vB_Library_Content at line 3540
array getIndexableContent($nodeId, $include_attachments = true)

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

Parameters

$nodeId
$include_attachments

Return Value

array $indexableContent

in vB_Library_Content at line 3586
int getStarter(int $nodeid)

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

Parameters

int $nodeid

Return Value

int The conversation starter's nodeid

in vB_Library_Content at line 3619
array getConversationParent(int $nodeid)

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

Parameters

int $nodeid

Return Value

array The starter node array

in vB_Library_Content at line 3640
bool isVisitorMessage(int $nodeid)

determines whether a specific node is a visitor message

Parameters

int $nodeid

Return Value

bool

in vB_Library_Content at line 3657
bool isComment(int $nodeid, array $node = null)

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

Parameters

int $nodeid Node ID
array $node Node information

Return Value

bool

in vB_Library_Content at line 3681
protected getIndexableContentForAttachments($nodeId)

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

Parameters

$nodeId

in vB_Library_Content at line 3702
Array fetchTableName()

returns the tables used by this content type.

Return Value

Array

in vB_Library_Content at line 3719
static array('found' fetchFromCache(array|int $nodeids, integer $level)

This attempts to get the cached data for nodes

Parameters

array|int $nodeids
integer $level -- one of the constants for level of data

Return Value

array('found' => array of node values per the constant, 'notfound' => array of nodeids);

in vB_Library_Content at line 3796
static void writeToCache($nodes, $level)

writes new cached data for nodes

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

Parameters

$nodes
$level

Return Value

void

in vB_Library_Content at line 3816
protected verifyPrefixid($prefixid)

Parameters

$prefixid

in vB_Library_Content at line 3840
protected verifyPostIconid(int $posticonid)

Verifies that the post iconid is valid

Parameters

int $posticonid post icon ID

in vB_Library_Content at line 3854
protected changeContentType($nodeid, $oldcontentType, $newcontentType)

Parameters

$nodeid
$oldcontentType
$newcontentType

in vB_Library_Content at line 3894
protected string getDuplicateHash(array $data)

Calculates the CRC based on the indexable content

Parameters

array $data

Return Value

string

in vB_Library_Content at line 3930
protected fillContentTableData($node)

Parameters

$node

in vB_Library_Content at line 3953
none removePrivateDataFromNode(array $node)

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

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

Parameters

array $node the node array to be cleaned.

Return Value

none

in vB_Library_Content at line 3974
bool checkComplete(array $node)

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

Parameters

array $node -- node array

Return Value

bool

in vB_Library_Content at line 3996
boolean getCannotDelete()

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

Return Value

boolean

in vB_Library_Content at line 4008
protected bool getNodeClean(integer $node)

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

Parameters

integer $node the nodeid to be checked

Return Value

bool

in vB_Library_Content at line 4036
protected bool incompleteNodeCleanup(mixed $node)

This cleans up for a node that was found to be incomplete by deleting the child nodes and subsidiary table records. It is often overridden in child classes.

Parameters

mixed $node Node record, which may have missing child table data.

Return Value

bool Whether the node has been cleaned up

in vB_Library_Content at line 4095
setDoIncompleteNodeCleanup(bool $value)

Sets the $doIncompleteNodeCleanup flag

Parameters

bool $value Flag value

in vB_Library_Content_Text at line 1035
protected handleAttachments($type, $nodeid, $data, $options = array())

Handles uploaded attachments-- Adds the attach nodes and handles updating data that needs updating after the attachments are added.

Parameters

$type
$nodeid
$data
$options

mergeContentInfo($result, $content)

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

Parameters

$result
$content

at line 539
bool validate($data, $action = self::ACTION_ADD, $nodeid = false, $nodes = false, $userid = null)

Validates that the current can create a node with these values

Note that if an array is passed it returns true only if all nodes pass the constraint.

Parameters

$data
$action
$nodeid
$nodes
$userid

Return Value

bool

protected addContentInfo($results)

Parameters

$results

postBbcodeParseCleanRawtext(mixed $data)

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

Parameters

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

parseAndStrip($text)

Parameters

$text

protected replaceAndStripBbcode($text, $data = array())

Parameters

$text
$data

array|string getQuotes(array|int $nodeids)

This returns a string with quoted strings in bbcode format.

Parameters

array|int $nodeids

Return Value

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

getQuotesFromNodes(array $nodes)

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

Parameters

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

type mergeContent(type $data)

Performs the merge of content and updates the node.

Parameters

type $data

Return Value

type

in vB_Library_Content_Text at line 1178
fixAttachBBCode(mixed $nodeId, array $content = null, array $keysToAttachid = array()) deprecated

deprecated Superceded by replaceAttachBbcodeTempids

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

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

Parameters

mixed $nodeId nodeid or array of nodeids
array $content (optional) Node content array returned by getFullContent
array $keysToAttachid (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.

in vB_Library_Content_Text at line 1208
protected string replaceAttachBbcodeForParseAndStrip(string $rawtext, array $data = array())

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

Parameters

string $rawtext Text to be replaced.
array $data optional. Data array provided to add() or update() if available. May contain 'attachments' data.

Return Value

string

in vB_Library_Content_Text at line 1334
protected string replaceAttachBbcodeTempids(string $rawtext, array $keysToAttachid)

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

Parameters

string $rawtext The rawtext for the node
array $keysToAttachid Mapping of tempids => nodeid/attachid

Return Value

string The rawtext with the modified [attach] bbcodes

in vB_Library_Content_Text at line 1388
autoPopulatePreviewImage(int $nodeId, array $node = null) deprecated

deprecated Superceded by getPreviewImage

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

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

int $nodeId Nodeid
array $node (optional) Node content array returned by getFullContent

in vB_Library_Content_Text at line 1430
protected int|bool getPreviewImage(array $node)

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

Parameters

array $node The node array returned by getFullContent

Return Value

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

at line 47
protected sendPushNotifications($data)

Parameters

$data

at line 173
protected getModeratorRecipients($reportedNodeid, $type = "email")

Parameters

$reportedNodeid
$type

at line 468
void openClose(array $nodeids, string $op)

Open or close reports

Parameters

array $nodeids Array of node IDs
string $op 'open' or 'close'

Return Value

void

at line 516
void bulkdelete($nodeids)

Delete one or more reports

Parameters

$nodeids

Return Value

void

Exceptions

vB_Exception_Api