示例#1
0
 public function deletePMs($pmIDs)
 {
     require_once WCF_DIR . 'lib/data/message/attachment/AttachmentsEditor.class.php';
     // delete recipients
     $sql = "DELETE FROM wcf" . WCF_N . "_pm_to_user\n            WHERE       pmID IN (" . $pmIDs . ")";
     WCF::getDB()->sendQuery($sql);
     // delete messages
     $sql = "DELETE FROM wcf" . WCF_N . "_pm\n            WHERE       pmID IN (" . $pmIDs . ")";
     WCF::getDB()->sendQuery($sql);
     // delete pm hashes
     $sql = "DELETE FROM wcf" . WCF_N . "_pm_hash\n            WHERE       pmID IN (" . $pmIDs . ")";
     WCF::getDB()->sendQuery($sql);
     // delete attachments
     $attachments = new AttachmentsEditor($pmIDs, 'pm');
     $attachments->deleteAll();
 }