<?php
/* Include Files ***************************/
require_once('../db-config.php');
	if(  defined('LTDVERSION')  )
		die('0');
require_once('../inc/lib-compat-class.php');
require_once('../inc/lib-db-class.php');
require_once('../inc/lib-login-class.php');
/*******************************************/
global $rSdb;

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

if( ! check_ajax_referer('add-thought', false) )
	die('0|'.__('Security Alert: Direct access not permitted!','recipeshelf'));

if(  isset($_POST['thought']) && $_POST['thought']<>''  ){

    $sql		= "INSERT IGNORE INTO {$rSdb->DBobjects} (type,object,uid) VALUES ('5','".esc_sql(_rem_magic_quote((string)$_POST['thought']))."','{$user->_user_id}')";
	$insert 	= $rSdb->fetch( $sql );

}

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