uid; if ($account_id != 0) { if (user_access('View statistics')) { $variables['user_stats_posts'] = user_stats_get_stats('post_count', $account_id); } // IP part has access check built in. $ip = user_stats_get_stats('ip_address', $account_id); $variables['user_stats_ip'] = $ip; } }