removeAttachments

Description

Removes attachments or avatars based on a given query condition.

Syntax

mixed removeAttachments (string $condition[, string $query_type, bool $return_affected_messages[, bool $autoThumbRemoval]])



Parameter $condition

Expected type: String
Description: A MySQL WHERE condition (a.attachmentSize < x, etc.).



Parameter $query_type

Expected type: Enumerated String
Description:

Possible string values
Allowed values Description
''' (empty string)' Condition is not dependent on members or messages
'members' Indicates that the condition is based on one or more columns in the members table
'messages' Indicates that the condition is based on one or more columns in the messages table



Parameter $return_affected_messages

Expected type: Boolean
Description: Whether or not to return an array containing the IDs of the affected messages (default is false)



Parameter $autoThumbRemoval

Expected type: Boolean
Description: Whether or not to automatically remove thumbnails as well. Default is true.



Return value

Expected type: Mixed
Description:

Possible types
Allowed values Description
Void If $return_affected_messages is false, nothing is returned.
Array of Integers If $return_affected_messages is true, returns an array containing the IDs of the affected messages


Notes

  • Called by several remove avatar/attachment functions in this file.
  • Removes attachments based that match the $condition.
  • Allows query_types 'messages' and 'members', whichever is need by the $condition parameter
Advertisement: