Here's the details:
A user is a member of one usergroup. For the challenge the usergroupid = 2.
Each usergroup has a default forumpermissions value. The default forumpermissions for this usergroup is 766463
The forums table has a list of the 19 different forums, each has a forumid and possibly a parent forum's id.
The forumpermission table has entries for forumid, usergroupid, forumpermissions. This table only has entries for forums that 1) aren't using the permission of their parent or 2) not using the default permission.
The results of a SQL join filtered on usergroupid=2 are in the attached Excel sheet. The challenge is to write code that will use this data in some way (from the database, array, object collection, etc) to determine the correct forumpermissions value for all the blanks.
An example of the parent child hierarchy and what results should look like is:
ID #10 > #8 > -1 = default of 766463
ID #21 > #20 = 766455
ID #22 = 766447
ID #18 > #17 = 0
Look forward to seeing the most efficient (ie, least number of SQL calls and loops) solution one of you can come up with. If you need data in other formats or have questions post back. Any language is fine, ASP, PHP, Java, etc.
Attached File(s)
-
vbusers.zip (3.85K)
Number of downloads: 1


Help
This topic is locked

MultiQuote












