This could be done with a GD script...
And you could create a new field within the subscriptions table to store a
randomly generated membership number for the duration of the subscription... Then at the end of the subscription term, another script will clear the number from the database and send an updated list of valid numbers to whomever it is intended...
i.e. Bob buys a 1 year subscription to a music forum. When this subscription is processed, he has access to his membership features, and can download a picture card id to have laminated or whatever he chooses to do with it. On this card, is a randomly generated number that is stored in a field in your database. When the subscription expires the number becomes invalid, your automated script sends the updated list without Bob's number on, and therefore useless to Bob if he tries to use it again to gain membership discounts or whatever.
Sounds like an interesting project... I may take the time to do a little investigation into this on my day off
Chris