How to use BuddyDev snippet to Exclude Users?

tinyurl.com/lpxbrwc - BuddyDev Article

I entered the first code snippet as is into my bp-custom.php. The only change I made was in the $excluded_user line

The exact code that I entered was below:

add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
function bpdev_exclude_users($qs=false,$object=false){
//list of users to exclude

$excluded_user='1';//comma separated ids of users whom you want to exclude

if($object!='members')//hide for members only
return $qs;

$args=wp_parse_args($qs);

//check if we are listing friends?, do not exclude in this case
if(!empty($args['user_id']))
return $qs;

if(!empty($args['exclude']))
$args['exclude']=$args['exclude'].','.$excluded_user;
else
$args['exclude']=$excluded_user;

$qs=build_query($args);

return $qs;

}

For some reason, all of the code just appeared at the top of my homepage, obviously signaling that there was some error. Is there something else that I need to modify into the above code? Have I done something wrong?