I think I may have solved this problem using existing UBB Classic 6.5 functionality - look here.