开发者

Let users choice modules they want

I'm making a social gaming network, for learning but mostly b开发者_Python百科ecause php is alot of fun!

Anyway I want this future..

I wanna let my users chose which "modules" they want activated, like a message board on their profile, polls, buddy list, contact box. Some modules will have to be purchased with points.

Im thinking on something like this:

  • id
  • username
  • passwd
  • points
  • msgboard_activated
  • poll_activated
  • buddylist_activated
  • contactbox_activated

Just check if msgboard_activated equals to 1, then include that module on members profile

Some modules (feel free to come with suggestions of modules):

Message board (lets users leave messages on a specific users page)
Buddy list
Poll

I pretty much got the idea from (awesome site!): http://www.fpsbanana.com/modules

Anyway, Let me hear your thought and idea of this!

Thanks alot and have a good day!

ps.(im BR so expect spelling errors etc)


Oie, Agamemon!

I would encourage you to try a different structure. For instance, three tables, as opposed to a single table.

First, your users table which represents everybody on your site. Second, a modules table which represents all possible modules. This way you can add more in the future without having to add columns to the user table, etc. And lastly we bring them together into a relationship with the usersmodule table, which shows what modules belong to each particular user.

I hope this gives you some direction.

  • table:users
    • userid
    • username
    • ...
  • table:modules
    • moduleid
    • modulename
    • ...
  • table:usermodules
    • userid
    • moduleid
    • ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜