Depending on how much you want to go with it, your circuitry can become quite complex. It seems to me that the basic elements you need to track are as follows:
Badges awarded Points earned
Pretty simple so far, but you want to be able to dynamically create new badges and new categories of points. Signs of awards will depend on the points of earnings in one or more point categories, which may amount to a certain amount. Therefore, you need to track the relationship between the categories of points (and the points gained) and the icons:
Point categories Badge categories
Thus, the key will be a table of your user points, which will refer to the categories of points that refer to the icons. Users receive points in a certain category, which will help attract points to one or more icons.
badges: badge_id badge_name required_points .... point_categories: point_id category_name weighting (optional) ... point_groups: badge_id point_id weighting (optional) ... user_points: user_id point_id points ... user_badges: user_id badge_id points_earned badge_awarded (yes/no) ...
Your admin interface will allow someone to create a new badge and choose which categories of points are needed to get this badge (point_groups). Whenever a user earns points (user_points), you update the user_points table and then determine which icons these points could contribute to (point_groups). Then you recompile the badge points affected by the points received and update the user_badges table with point_earned. Then check the points_earned field in user_badges for the required_points in the icon table.
You can become much more attractive by assigning different weights to different categories of points or even different weights for point categories for certain icons. But this setting allows you to create and manage an unlimited number of icons and categories of points without changing the structure of the tables.
If this is not at all what you are looking for, I think I should at least get a voice or two to type a lot.
Brent Baisley Jun 26 '09 at 15:12 2009-06-26 15:12
source share