Extending a CCK field formatter
D7 has this baked into the field formatters. You could look at how that is done and emulate it. But I suspect that would be quite a lot of work. How far off is D7 for you? It could be worth waiting till then to allow field settings.