Help with getting flags to display in member profile

Hey guys i'm having some issues getting some code to work on my site. I am using two plugins for Wordpress 'Quick Flag' and 'Register IP'

Following the guide of this article:

http://thecode.smeak.com/2013/01/22/how-to-add-users-country-flag-in-buddypress-members-profile/

I managed to get flags to display in the members loop. It works perfectly but when trying to recreate this in the members-header.php nothing appears and the code is ignored.

I'm trying to get the flag of the user to display in their profile either based on a xprofile field or the meta entry that is recording the users ip 'signup_up'

You can see the example at http://www.tombunn.net/members

Using the following code nothing is displaying in the member profile page. Is there something wrong with the code or is this not possible outside of a loop.

<?php
$ip_address = get_user_meta(( bp_get_member_user_id() ), 'signup_ip', true);
// echo $ip_address;
global $quick_flag;
if(isset($quick_flag) && is_object($quick_flag)){
if(($info = $quick_flag->get_info($ip_address)) != false){
$version = $info->version; // Quick Flag version (float): 2.00
$ip = $info->ip;
$code = $info->code; // Country code (string): HR
$name = $info->name; // Country name (string): Croatia
$latitude = $info->latitude; // Country latitude (float): 45.1667
$longitude = $info->longitude; // Country longitude (float): 15.5
$flag = $quick_flag->get_flag($info, 'my-own-css-class'); // CSS class is optional, 'quick-flag' by default
echo $flag;
}
}
?>

Any help would be much appreciated.