Should be `(!$row['display_subforum_limit'] || $parent_id == $row['parent_id'])` ?
To proof this add a functional test? :)