<?php
/* Include Files *********************/
require_once('require.php');
if(  defined('LTDVERSION')  )
	die('0');
/*************************************/

global $rSdb;

$user	= new userManagement();

if(  !$user->_logged_in  )
	die(__('Access denied.','recipeshelf'));

if( ! check_ajax_referer('remove-thought', false) )
	die(__('Security Alert: Direct access not permitted!','recipeshelf'));
	
if(  isset($_POST['id'])  ){

    $UID = ' AND 0';
	$id	 = esc_sql(_rem_magic_quote($_POST['id']));
	if( $user->_user_id!='' )
 		$UID = " AND uid='{$user->_user_id}'";

    $sql		= "DELETE FROM {$rSdb->DBobjects} WHERE id = '{$id}'{$UID}";
	$del	 	= $rSdb->fetch( $sql );

}

echo ( $rSdb->affected_rows()>0 ) ? 1 : 0;
?>