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

global $rSdb;

$user	= new userManagement();

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

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

if(  isset($_POST['submit-thought']) && $user->_user_id!='' ){

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

}

if( $rSdb->affected_rows()<=0 )
	echo '0|'.__('Idea not accepted (DB!)...!','recipeshelf');
else
	echo '1|'.__('Got it. Thanks.','recipeshelf');
?>