<?php if (!defined('PHORUM') || phorum_page !== 'moderation') { return; } $PHORUM['DATA']['BREADCRUMBS'][] = array('URL' => NULL, 'TEXT' => $PHORUM['DATA']['LANG']['Moderate'] . ': ' . $PHORUM['DATA']['LANG']['DeleteMessage'], 'TYPE' => 'delete'); if (count($_GET) && empty($_POST["thread"])) { $args = array("mod_step" => PHORUM_DELETE_MESSAGE, "thread" => $msgthd_id); foreach ($PHORUM["args"] as $k => $v) { if (!is_numeric($k)) { $args[$k] = $v; } } phorum_show_confirmation_form($PHORUM["DATA"]["LANG"]["ConfirmDeleteMessage"], phorum_api_url(PHORUM_MODERATION_ACTION_URL), $args); } $message = $PHORUM['DB']->get_message($msgthd_id); /* * [hook] * before_delete * * [description] * This hook allows modules to implement extra or different delete * functionality.<sbr/> * <sbr/> * The primary use of this hook would be for moving the messages * to some archive-area instead of really deleting them. * * [category] * Moderation * * [when]
if (isset($PHORUM['args']["prepost"])) { $PHORUM['DATA']["URL"]["REDIRECT"] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_UNAPPROVED); } else { $PHORUM['DATA']["URL"]["REDIRECT"] = $PHORUM["DATA"]["URL"]["LIST"]; } break; case PHORUM_DELETE_TREE: // this is a message delete if (count($_GET) && empty($_POST["thread"])) { $args = array("mod_step" => PHORUM_DELETE_TREE, "thread" => $msgthd_id); foreach ($PHORUM["args"] as $k => $v) { if (!is_numeric($k)) { $args[$k] = $v; } } return phorum_show_confirmation_form($PHORUM["DATA"]["LANG"]["ConfirmDeleteThread"], phorum_get_url(PHORUM_MODERATION_ACTION_URL), $args); } $message = phorum_db_get_message($msgthd_id); $nummsgs = 0; // A hook to allow modules to implement extra or different // delete functionality. $delete_handled = 0; if (isset($PHORUM["hooks"]["before_delete"])) { list($delete_handled, $msg_ids, $msgthd_id, $message, $delete_mode) = phorum_hook("before_delete", array(0, array(), $msgthd_id, $message, PHORUM_DELETE_TREE)); } if (!$delete_handled) { // Delete the message and all its replies. $msg_ids = phorum_db_delete_message($msgthd_id, PHORUM_DELETE_TREE); // Cleanup the attachments for all deleted messages. require_once './include/api/file_storage.php'; foreach ($msg_ids as $id) {