Example #1
0
function boxDeleteMessage($user_id, $box_id, $message_id)
{
    $user_id = escape($user_id);
    $box_id = escape($box_id);
    $message_id = escape($message_id);
    //move message to trash depending on settings
    $result = mysql_query("SELECT save_trash FROM message_prefs WHERE user_id = '{$user_id}'");
    if ($row = mysql_fetch_array($result)) {
        $trash_folder = $row[0];
        if ($trash_folder != 0 && $trash_folder != $box_id) {
            boxMoveMessage($user_id, $message_id, $box_id, $trash_folder);
        }
    }
    //delete the message link to the box,
    mysql_query("DELETE FROM message_boxes_contents WHERE box_id = '{$box_id}' AND message_id = '{$message_id}'");
}
Example #2
0
                     $inform["success"] = "Deleted <b>" . count($_POST['index']) . "</b> messages!";
                 } else {
                     $inform["success"] = "Deleted <b>" . count($_POST['index']) . "</b> message!";
                 }
             } else {
                 $inform['warn'] = "Select messages you would like to delete!";
             }
         } else {
             $inform['warn'] = "Select messages you would like to delete!";
         }
     } else {
         if ($_REQUEST['action']) {
             if (isset($_POST['index'])) {
                 if (count($_POST['index'])) {
                     foreach ($_POST['index'] as $id) {
                         boxMoveMessage($_SESSION['user_id'], $id, $_POST['box_id'], $_POST['action']);
                     }
                     if (count($_POST['index']) > 1) {
                         $inform["success"] = "Moved <b>" . count($_POST['index']) . "</b> messages!";
                     } else {
                         $inform["success"] = "Moved <b>" . count($_POST['index']) . "</b> message!";
                     }
                 } else {
                     $inform['warn'] = "Select messages you would like to move!";
                 }
             } else {
                 $inform['warn'] = "Select messages you would like to move!";
             }
         }
     }
 }