Topic: Categories, forums and permissions

First sorry if I didn?t post this in the correct forum wink

I?ve installed PunBB a couple days back and everything works fine, however I was trying to do something like a script that created users, categories and a forum at the same time, I?ve made this already however I notice the forum permission table on the database has an input for each group/forum possibility, basically there?s an input even if the group has no rights what so ever.

My problem is that if I have 100 groups and each group has it?s own forum, then that table alone would have 10000 records or something like that, isn?t it possible to change the way punBB looks through that table, Pun would check what forum has read_forum=1 and the group of the user and then afterwards retrieve the said forums. This would make it simple because we could just insert a record for the forum they are allowed to see regardless of how many forums there are, as it is now any new group I create that doesn?t have the permissions set will see all the forum, maybe there?s a reason for this though.

I was trying to fool around with the query that retrieves the categories and forums but that one is really hardcore for MySQL noobs like me, the MySQL manual helps but the query is rather complicated to really understand it.

If someone has any idea how to change that query or any other idea on how to make it possible to have 100 forum and 100 groups without having to input a record on the permissions table for each possibility be my guest wink

BTW since I haven?t said it before, this forum rocks, it?s simple to use and has a nice code behind it thing that the one I built myself didn?t big_smile

This is the query that gets the categories and forums

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());