Hello,
In a module I am making
Users pay monthly subscriptions to get access to articles. These users can refer other people to sign up and if they do, the referring user gets a “point” (virtual currency). I was wondering what would be the best way to store points for each user.
Alter the members table Use a custom member profile field Or is there a better way?
Now subscriptions grant access to a weblog and also forums, I am wondering the “best practice” way of being able to set the subscription association. Should I do it all in my module or should I customize the existing control panels.
i.e in the forum module cp you can select which subscription is required to view this forum. In the weblog preferences section you specify which subscription is required etc.
OR should I make all settings for my module in my module.
I hope this makes sense.
Greg
Greg,
Customizing an existing CP’s interface is not going to future proof your module very well. Every time an update is released for something you hacked you will need to go in and hack them again.
Doesn’t sound like a good use of your time.
I would keep the interface as self contained as possible and when not possible see if I can’t use an extension hook to add the things I need instead of a hack.
As far as tables it is usually best to leave existing tables alone (in terms of columns/format) unless absolutely necessary. In cases where you need the normal member data and your own data a good old JOIN query will let you get at the data in the various ways you need it.
As for your specific case and whether a Custom Member Profile field will be a good solution thats kind of your choice. Is there a reason you can think that one might be an advantage? A Custom Member Profile field will be more easily accessible in templates for instance. Does that make a difference for your needs?
Jamie
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.