Put a condition around it?
HTML Code:
<if condition="$bbuserinfo['userid'] == $userinfo['userid']">
edit icon
</if>
Something like that, I think. That checks if the person viewing the page ($bbuserinfo) has the same userid as the person who's page you are viewing ($userinfo). You didn't say what page you are doing this on, so you may have to change the last variable depending.